MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / floatx80_round_to_float64

Function floatx80_round_to_float64

src/softfloat/softfloat.cpp:2106–2126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2104}
2105
2106floatx80 floatx80_round_to_float64( floatx80 a, float_status *status )
2107{
2108 flag aSign;
2109 int32_t aExp;
2110 uint64_t aSig;
2111
2112 aSign = extractFloatx80Sign( a );
2113 aSig = extractFloatx80Frac( a );
2114 aExp = extractFloatx80Exp( a );
2115
2116 if ( aExp == 0x7FFF ) {
2117 if ( (uint64_t) ( aSig<<1 ) ) return propagateFloatx80NaNOneArg( a, status );
2118 return a;
2119 }
2120 if ( aExp == 0 ) {
2121 if ( aSig == 0 ) return a;
2122 normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
2123 }
2124
2125 return roundAndPackFloatx80( 64, aSign, aExp, aSig, 0, status );
2126}
2127
2128
2129floatx80 floatx80_normalize( floatx80 a )

Callers 2

fp_round_doubleFunction · 0.85
fp_roundFunction · 0.85

Calls 6

extractFloatx80SignFunction · 0.85
extractFloatx80FracFunction · 0.85
extractFloatx80ExpFunction · 0.85
roundAndPackFloatx80Function · 0.85

Tested by

no test coverage detected