annotate libgcc/floatunsisf.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Public domain. */
kono
parents:
diff changeset
2 typedef int SItype __attribute__ ((mode (SI)));
kono
parents:
diff changeset
3 typedef unsigned int USItype __attribute__ ((mode (SI)));
kono
parents:
diff changeset
4 typedef float SFtype __attribute__ ((mode (SF)));
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 SFtype
kono
parents:
diff changeset
7 __floatunsisf (USItype u)
kono
parents:
diff changeset
8 {
kono
parents:
diff changeset
9 SItype s = (SItype) u;
kono
parents:
diff changeset
10 if (s < 0)
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 /* As in expand_float, compute (u & 1) | (u >> 1) to ensure
kono
parents:
diff changeset
13 correct rounding if a nonzero bit is shifted out. */
kono
parents:
diff changeset
14 return (SFtype) 2.0 * (SFtype) (SItype) ((u & 1) | (u >> 1));
kono
parents:
diff changeset
15 }
kono
parents:
diff changeset
16 else
kono
parents:
diff changeset
17 return (SFtype) s;
kono
parents:
diff changeset
18 }