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

Function normalizeRoundAndPackFloatx80

src/softfloat/softfloat.cpp:1605–1623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1603*----------------------------------------------------------------------------*/
1604
1605static floatx80 normalizeRoundAndPackFloatx80(int8_t roundingPrecision,
1606 flag zSign, int32_t zExp,
1607 uint64_t zSig0, uint64_t zSig1,
1608 float_status *status)
1609{
1610 int8_t shiftCount;
1611
1612 if ( zSig0 == 0 ) {
1613 zSig0 = zSig1;
1614 zSig1 = 0;
1615 zExp -= 64;
1616 }
1617 shiftCount = countLeadingZeros64( zSig0 );
1618 shortShift128Left( zSig0, zSig1, shiftCount, &zSig0, &zSig1 );
1619 zExp -= shiftCount;
1620 return roundAndPackFloatx80(roundingPrecision, zSign, zExp,
1621 zSig0, zSig1, status);
1622
1623}
1624
1625/*----------------------------------------------------------------------------
1626| Returns the result of converting the 32-bit two's complement integer `a'

Callers 6

floatx80_to_floatx80Function · 0.85
subFloatx80SigsFunction · 0.85
floatx80_remFunction · 0.85
floatx80_modFunction · 0.85
floatx80_scaleFunction · 0.85
floatx80_moveFunction · 0.85

Calls 3

countLeadingZeros64Function · 0.85
shortShift128LeftFunction · 0.85
roundAndPackFloatx80Function · 0.85

Tested by

no test coverage detected