]> git.ipfire.org Git - thirdparty/qemu.git/commit
fpu/softfloat: Don't set Invalid for float-to-int(MAXINT)
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 15 May 2018 13:58:42 +0000 (14:58 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 18 Jul 2018 15:45:23 +0000 (10:45 -0500)
commite653eee8d800890723018de9cbc6c44de91cdf7d
tree2dd663e8428af2c8e5d3ded1dc215d6bf673bf5f
parentfbaeb1068c731021aedb5c416b9a5f7000923cc8
fpu/softfloat: Don't set Invalid for float-to-int(MAXINT)

In float-to-integer conversion, if the floating point input
converts exactly to the largest or smallest integer that
fits in to the result type, this is not an overflow.
In this situation we were producing the correct result value,
but were incorrectly setting the Invalid flag.
For example for Arm A64, "FCVTAS w0, d0" on an input of
0x41dfffffffc00000 should produce 0x7fffffff and set no flags.

Fix the boundary case to take the right half of the if()
statements.

This fixes a regression from 2.11 introduced by the softfloat
refactoring.

Cc: qemu-stable@nongnu.org
Fixes: ab52f973a50
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180510140141.12120-1-peter.maydell@linaro.org
(cherry picked from commit 333583757c5e910b040bef793974773635ce1918)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
fpu/softfloat.c