Softfloat fcvt.{w/l}.d now returns -MaxInt for -NaN
authorAndrew Waterman <waterman@cs.berkeley.edu>
Tue, 24 Feb 2015 02:35:14 +0000 (18:35 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Tue, 24 Feb 2015 02:35:14 +0000 (18:35 -0800)
softfloat/f64_to_i32.c
softfloat/f64_to_i64.c

index 0778a8616775bca0fe0238fb039287c69a0aba89..8259ee2854247546a5917291b3f88e0709727c73 100755 (executable)
@@ -20,7 +20,6 @@ int_fast32_t f64_to_i32( float64_t a, int_fast8_t roundingMode, bool exact )
     sign = signF64UI( uiA );\r
     exp = expF64UI( uiA );\r
     sig = fracF64UI( uiA );\r
-    if ( ( exp == 0x7FF ) && sig ) sign = 0;\r
     if ( exp ) sig |= UINT64_C( 0x0010000000000000 );\r
     shiftCount = 0x42C - exp;\r
     if ( 0 < shiftCount ) sig = softfloat_shift64RightJam( sig, shiftCount );\r
index 676e944dd6ceb48ada3d224be07ea9281db25976..0e6ddcde58d4d063ce30f7b8b5ff9bb72bf2e165 100755 (executable)
@@ -28,8 +28,6 @@ int_fast64_t f64_to_i64( float64_t a, int_fast8_t roundingMode, bool exact )
             softfloat_raiseFlags( softfloat_flag_invalid );\r
             return\r
                 ! sign\r
-                    || ( ( exp == 0x7FF )\r
-                             && fracF64UI( uiA ) )\r
                     ? INT64_C( 0x7FFFFFFFFFFFFFFF )\r
                     : - INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1;\r
         }\r