]> git.proxmox.com Git - mirror_qemu.git/commitdiff
fpu/softfloat: Fix conversion from uint64 to float128
authorPetr Tesarik <ptesarik@suse.com>
Fri, 11 May 2018 07:10:52 +0000 (09:10 +0200)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 17 May 2018 22:24:19 +0000 (15:24 -0700)
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>
fpu/softfloat.c

index bc0f52fa54706644785a9229c8efe93b297fbc0b..d07419324a960189e1f72903d57c80c4ce6489d7 100644 (file)
@@ -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);
 }