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

Function floatx80_to_float64

src/softfloat/softfloat.cpp:1984–2012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1982*----------------------------------------------------------------------------*/
1983
1984float64 floatx80_to_float64(floatx80 a, float_status *status)
1985{
1986 flag aSign;
1987 int32_t aExp;
1988 uint64_t aSig, zSig;
1989
1990 aSig = extractFloatx80Frac( a );
1991 aExp = extractFloatx80Exp( a );
1992 aSign = extractFloatx80Sign( a );
1993 if ( aExp == 0x7FFF ) {
1994 if ( (uint64_t) ( aSig<<1 ) ) {
1995 return commonNaNToFloat64(floatx80ToCommonNaN(a, status), status);
1996 }
1997 return packFloat64( aSign, 0x7FF, 0 );
1998 }
1999#ifdef SOFTFLOAT_68K
2000 if ( aExp == 0 ) {
2001 if ( aSig == 0) return packFloat64( aSign, 0, 0 );
2002 normalizeFloatx80Subnormal( aSig, &aExp, &aSig );
2003 }
2004 shift64RightJamming( aSig, 1, &zSig );
2005 aExp -= 0x3C01;
2006#else
2007 shift64RightJamming( aSig, 1, &zSig );
2008 if ( aExp || aSig ) aExp -= 0x3C01;
2009#endif
2010 return roundAndPackFloat64(aSign, aExp, zSig, status);
2011
2012}
2013
2014#ifdef SOFTFLOAT_68K // 31-01-2017
2015/*----------------------------------------------------------------------------

Callers 8

fpu_precision_validFunction · 0.85
fill_memory_bufferFunction · 0.85
putfpuimmFunction · 0.85
f80todoubleFunction · 0.85
converterFunction · 0.85
from_doubleFunction · 0.85
fp_to_extenFunction · 0.85
softfloat_tanFunction · 0.85

Calls 9

extractFloatx80FracFunction · 0.85
extractFloatx80ExpFunction · 0.85
extractFloatx80SignFunction · 0.85
commonNaNToFloat64Function · 0.85
floatx80ToCommonNaNFunction · 0.85
packFloat64Function · 0.85
shift64RightJammingFunction · 0.85
roundAndPackFloat64Function · 0.85

Tested by 3

fpu_precision_validFunction · 0.68
fill_memory_bufferFunction · 0.68
putfpuimmFunction · 0.68