| 1982 | *----------------------------------------------------------------------------*/ |
| 1983 | |
| 1984 | float64 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 | /*---------------------------------------------------------------------------- |