summaryrefslogtreecommitdiffstats
path: root/fpu
diff options
context:
space:
mode:
authorPetr Tesarik2018-05-11 09:10:52 +0200
committerRichard Henderson2018-05-18 00:24:19 +0200
commit6603d50648901e8b9e6d66ec1142accf0b1df1e6 (patch)
tree9e55fb5b7cd0b67925d8a67142fab2d278917a3a /fpu
parentMerge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (diff)
downloadqemu-6603d50648901e8b9e6d66ec1142accf0b1df1e6.tar.gz
qemu-6603d50648901e8b9e6d66ec1142accf0b1df1e6.tar.xz
qemu-6603d50648901e8b9e6d66ec1142accf0b1df1e6.zip
fpu/softfloat: Fix conversion from uint64 to float128
The significand is passed to normalizeRoundAndPackFloat128() as high first, low second. The current code passes the integer first, so the result is incorrectly shifted left by 64 bits. This bug affects the emulation of s390x instruction CXLGBR (convert from logical 64-bit binary-integer operand to extended BFP result). Cc: qemu-stable@nongnu.org Tested-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Petr Tesarik <ptesarik@suse.com> Message-Id: <20180511071052.1443-1-ptesarik@suse.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'fpu')
-rw-r--r--fpu/softfloat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index bc0f52fa54..d07419324a 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -3147,7 +3147,7 @@ float128 uint64_to_float128(uint64_t a, float_status *status)
if (a == 0) {
return float128_zero;
}
- return normalizeRoundAndPackFloat128(0, 0x406E, a, 0, status);
+ return normalizeRoundAndPackFloat128(0, 0x406E, 0, a, status);
}