From f591e1bedf01a4b1de0891a66320a0724412d009 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 10 Feb 2011 11:28:59 +0000 Subject: softfloat: Correctly handle NaNs in float16_to_float32() Correctly handle NaNs in float16_to_float32(), by defining and using a float16ToCommonNaN() function, as we do with the other formats. Signed-off-by: Peter Maydell Signed-off-by: Aurelien Jarno --- fpu/softfloat.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'fpu/softfloat.c') diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 80d8cc4..3abd170 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -2761,9 +2761,7 @@ float32 float16_to_float32(float16 a, flag ieee STATUS_PARAM) if (aExp == 0x1f && ieee) { if (aSig) { - /* Make sure correct exceptions are raised. */ - float32ToCommonNaN(a STATUS_VAR); - aSig |= 0x200; + return commonNaNToFloat32(float16ToCommonNaN(a STATUS_VAR) STATUS_VAR); } return packFloat32(aSign, 0xff, aSig << 13); } -- cgit v1.1