xref: /openbsd-src/gnu/gcc/gcc/config/floatunsisf.c (revision c7cbac187684cfb8bf7fa4d2401eb831ecbf60be)
1 /* Public domain.  */
2 typedef int SItype __attribute__ ((mode (SI)));
3 typedef unsigned int USItype __attribute__ ((mode (SI)));
4 typedef float SFtype __attribute__ ((mode (SF)));
5 
6 SFtype
__floatunsisf(USItype u)7 __floatunsisf (USItype u)
8 {
9   SItype s = (SItype) u;
10   if (s < 0)
11     {
12       /* As in expand_float, compute (u & 1) | (u >> 1) to ensure
13 	 correct rounding if a nonzero bit is shifted out.  */
14       return (SFtype) 2.0 * (SFtype) (SItype) ((u & 1) | (u >> 1));
15     }
16   else
17     return (SFtype) s;
18 }
19 
20 #ifdef __ARM_EABI__
21 __asm__ (".globl\t__aeabi_ui2f\n.set\t__aeabi_ui2f, __floatunsisf\n");
22 #endif
23