Fix NaN propagation for fcvt
authorAndrew Waterman <waterman@cs.berkeley.edu>
Sat, 30 Jan 2016 01:54:20 +0000 (17:54 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Sat, 30 Jan 2016 01:54:20 +0000 (17:54 -0800)
softfloat/s_commonNaNToF32UI.c
softfloat/s_commonNaNToF64UI.c
softfloat/specialize.h

index 61f27356eebf50e770ae0d66a0b01f874144b567..e16950cd34feedc85805e3f78d0d3086f49f562f 100755 (executable)
@@ -11,7 +11,7 @@
 uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a )\r
 {\r
 \r
-    return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF;\r
+    return defaultNaNF32UI;\r
 \r
 }\r
 \r
index da36c047c10409818cdbc8ad09d1c8907759e725..0555e1f7677c310104edb9b74f8671a17b607c6c 100755 (executable)
@@ -11,8 +11,7 @@
 uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN a )
 {
 
-    return
-        (uint_fast64_t) a.sign<<63 | UINT64_C( 0x7FFFFFFFFFFFFFFF );
+    return defaultNaNF64UI;
 
 }
 
index 72a9f1690fd8d0d44bf380328c8a5a7cf2ff5d98..4b0138a279dfe608ab4d1d1d930d0737123a17ec 100755 (executable)
@@ -68,7 +68,7 @@ bool softfloat_isSigNaNF32UI( uint_fast32_t );
 struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t );\r
 #if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL )\r
 INLINE uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a )\r
-    { return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF; }\r
+    { return defaultNaNF32UI; }\r
 #else\r
 uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN );\r
 #endif\r