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

Function floatx80_round_to_float32

src/softfloat/softfloat.cpp:2084–2104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2082}
2083
2084floatx80 floatx80_round_to_float32( floatx80 a, float_status *status )
2085{
2086 flag aSign;
2087 int32_t aExp;
2088 uint64_t aSig;
2089
2090 aSign = extractFloatx80Sign( a );
2091 aSig = extractFloatx80Frac( a );
2092 aExp = extractFloatx80Exp( a );
2093
2094 if ( aExp == 0x7FFF ) {
2095 if ( (uint64_t) ( aSig<<1 ) ) return propagateFloatx80NaNOneArg( a, status );
2096 return a;
2097 }
2098 if ( aExp == 0 ) {
2099 if ( aSig == 0 ) return a;
2100 normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
2101 }
2102
2103 return roundAndPackFloatx80( 32, aSign, aExp, aSig, 0, status );
2104}
2105
2106floatx80 floatx80_round_to_float64( floatx80 a, float_status *status )
2107{

Callers 2

fp_round_singleFunction · 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