From: Andrew Waterman Date: Sat, 30 Jan 2016 01:54:20 +0000 (-0800) Subject: Fix NaN propagation for fcvt X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=853391c2bb814451ad88b8dbff2aec8616fc6a12;p=riscv-isa-sim.git Fix NaN propagation for fcvt --- diff --git a/softfloat/s_commonNaNToF32UI.c b/softfloat/s_commonNaNToF32UI.c index 61f2735..e16950c 100755 --- a/softfloat/s_commonNaNToF32UI.c +++ b/softfloat/s_commonNaNToF32UI.c @@ -11,7 +11,7 @@ uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a ) { - return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF; + return defaultNaNF32UI; } diff --git a/softfloat/s_commonNaNToF64UI.c b/softfloat/s_commonNaNToF64UI.c index da36c04..0555e1f 100755 --- a/softfloat/s_commonNaNToF64UI.c +++ b/softfloat/s_commonNaNToF64UI.c @@ -11,8 +11,7 @@ uint_fast64_t softfloat_commonNaNToF64UI( struct commonNaN a ) { - return - (uint_fast64_t) a.sign<<63 | UINT64_C( 0x7FFFFFFFFFFFFFFF ); + return defaultNaNF64UI; } diff --git a/softfloat/specialize.h b/softfloat/specialize.h index 72a9f16..4b0138a 100755 --- a/softfloat/specialize.h +++ b/softfloat/specialize.h @@ -68,7 +68,7 @@ bool softfloat_isSigNaNF32UI( uint_fast32_t ); struct commonNaN softfloat_f32UIToCommonNaN( uint_fast32_t ); #if defined INLINE_LEVEL && ( 1 <= INLINE_LEVEL ) INLINE uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN a ) - { return (uint_fast32_t) a.sign<<31 | 0x7FFFFFFF; } + { return defaultNaNF32UI; } #else uint_fast32_t softfloat_commonNaNToF32UI( struct commonNaN ); #endif