]> git.proxmox.com Git - mirror_qemu.git/commitdiff
softfloat: Fix missing inexact for floating-point add
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 16 Aug 2018 13:05:29 +0000 (14:05 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 16 Aug 2018 13:29:58 +0000 (14:29 +0100)
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 <laurent.desnogues@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20180810193129.1556-7-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
fpu/softfloat.c

index 8cd2400081438eb0baff57c6cc7a1b70439ffedd..7d63cffdeb8614b83afc93fbfa0a97c92d5395d4 100644 (file)
@@ -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;