aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-09-28 16:17:03 +0100
committerDoug Goldstein <cardoe@cardoe.com>2012-11-21 15:20:46 -0600
commite3aa256c1f74e664f89691490e46f233ce56feac (patch)
tree8d4bbfd6a5bda48b00e6fa60790c07ac640a7a20
parentusb-audio: fix usb version (diff)
downloadqemu-kvm-e3aa256c1f74e664f89691490e46f233ce56feac.tar.gz
qemu-kvm-e3aa256c1f74e664f89691490e46f233ce56feac.tar.bz2
qemu-kvm-e3aa256c1f74e664f89691490e46f233ce56feac.zip
fpu/softfloat.c: Return correctly signed values from uint64_to_float32
The uint64_to_float32() conversion function was incorrectly always returning numbers with the sign bit set (ie negative numbers). Correct this so we return positive numbers instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> (cherry picked from commit e744c06fca438dc08271e626034e632a270c91c8)
-rw-r--r--fpu/softfloat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index b29256a8e..91497e8fb 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -1238,7 +1238,7 @@ float32 uint64_to_float32( uint64 a STATUS_PARAM )
if ( a == 0 ) return float32_zero;
shiftCount = countLeadingZeros64( a ) - 40;
if ( 0 <= shiftCount ) {
- return packFloat32( 1 > 0, 0x95 - shiftCount, a<<shiftCount );
+ return packFloat32(0, 0x95 - shiftCount, a<<shiftCount);
}
else {
shiftCount += 7;
@@ -1248,7 +1248,7 @@ float32 uint64_to_float32( uint64 a STATUS_PARAM )
else {
a <<= shiftCount;
}
- return roundAndPackFloat32( 1 > 0, 0x9C - shiftCount, a STATUS_VAR );
+ return roundAndPackFloat32(0, 0x9C - shiftCount, a STATUS_VAR);
}
}