From 7e4df4d518b5090eb76f88e6195d8206ae413ca7 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 22 Feb 2015 19:27:37 -0800 Subject: [PATCH] Softfloat fcvt.{w/h}.s now returns -MaxInt for -NaN Behavior now consistent with RISC-V user spec. --- softfloat/f32_to_i32.c | 1 - softfloat/f32_to_i64.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/softfloat/f32_to_i32.c b/softfloat/f32_to_i32.c index bbbaee0..98c67c9 100755 --- a/softfloat/f32_to_i32.c +++ b/softfloat/f32_to_i32.c @@ -21,7 +21,6 @@ int_fast32_t f32_to_i32( float32_t a, int_fast8_t roundingMode, bool exact ) sign = signF32UI( uiA ); exp = expF32UI( uiA ); sig = fracF32UI( uiA ); - if ( ( exp == 0xFF ) && sig ) sign = 0; if ( exp ) sig |= 0x00800000; sig64 = (uint_fast64_t) sig<<32; shiftCount = 0xAF - exp; diff --git a/softfloat/f32_to_i64.c b/softfloat/f32_to_i64.c index c0b8981..34f877f 100755 --- a/softfloat/f32_to_i64.c +++ b/softfloat/f32_to_i64.c @@ -25,7 +25,7 @@ int_fast64_t f32_to_i64( float32_t a, int_fast8_t roundingMode, bool exact ) shiftCount = 0xBE - exp; if ( shiftCount < 0 ) { softfloat_raiseFlags( softfloat_flag_invalid ); - if ( ! sign || ( ( exp == 0xFF ) && sig ) ) { + if ( ! sign ) { return INT64_C( 0x7FFFFFFFFFFFFFFF ); } return - INT64_C( 0x7FFFFFFFFFFFFFFF ) - 1; -- 2.30.2