[xcc] minor performance tweaks
[riscv-isa-sim.git] / softfloat / ui64_to_f64.c
1
2 #include <stdint.h>
3 #include "platform.h"
4 #include "primitives.h"
5 #include "internals.h"
6 #include "softfloat.h"
7
8 float64_t ui64_to_f64( uint_fast64_t a )
9 {
10 union ui64_f64 uZ;
11
12 if ( ! a ) {
13 uZ.ui = 0;
14 return uZ.f;
15 }
16 if ( a & UINT64_C( 0x8000000000000000 ) ) {
17 return
18 softfloat_roundPackToF64(
19 0, 0x43D, softfloat_shortShift64RightJam( a, 1 ) );
20 } else {
21 return softfloat_normRoundPackToF64( 0, 0x43C, a );
22 }
23
24 }
25