[xcc] minor performance tweaks
[riscv-isa-sim.git] / softfloat / ui32_to_f32.c
1
2 #include <stdint.h>
3 #include "platform.h"
4 #include "primitives.h"
5 #include "internals.h"
6 #include "softfloat.h"
7
8 float32_t ui32_to_f32( uint_fast32_t a )
9 {
10 union ui32_f32 uZ;
11
12 if ( ! a ) {
13 uZ.ui = 0;
14 return uZ.f;
15 }
16 if ( a & 0x80000000 ) {
17 return
18 softfloat_roundPackToF32(
19 0, 0x9D, softfloat_shortShift32Right1Jam( a ) );
20 } else {
21 return softfloat_normRoundPackToF32( 0, 0x9C, a );
22 }
23
24 }
25