From 64d450a0eaad5f02f9d6bba1dd451446297bb4dc Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 16 Aug 2018 14:05:29 +0100 Subject: softfloat: Fix missing inexact for floating-point add For 0x1.0000000000003p+0 + 0x1.ffffffep+14 = 0x1.0001fffp+15 we dropped the sticky bit and so failed to raise inexact. Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson Reviewed-by: Laurent Desnogues Tested-by: Laurent Desnogues Message-id: 20180810193129.1556-7-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- fpu/softfloat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fpu/softfloat.c') diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 8cd2400081..7d63cffdeb 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -701,7 +701,7 @@ static FloatParts addsub_floats(FloatParts a, FloatParts b, bool subtract, } a.frac += b.frac; if (a.frac & DECOMPOSED_OVERFLOW_BIT) { - a.frac >>= 1; + shift64RightJamming(a.frac, 1, &a.frac); a.exp += 1; } return a; -- cgit v1.2.3