diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-15 22:07:50 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-12-15 22:07:50 +0000 |
commit | 8d6c92b6b18a95e079d340db117c77f0e01b71f1 (patch) | |
tree | 8fdfa86765d3d587c3dcd7c620dd49fecabae185 /fpu/softfloat-native.h | |
parent | ce9ede844c5153bc3f6bd27b676cc502c0b36a61 (diff) |
softfloat-native: improve correctness of floatXX_is_neg()
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6059 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'fpu/softfloat-native.h')
-rw-r--r-- | fpu/softfloat-native.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fpu/softfloat-native.h b/fpu/softfloat-native.h index c795795151..c885f1b51f 100644 --- a/fpu/softfloat-native.h +++ b/fpu/softfloat-native.h @@ -265,7 +265,9 @@ INLINE float32 float32_is_infinity(float32 a) INLINE float32 float32_is_neg(float32 a) { - return a < 0.0; + float32u u; + u.f = a; + return u.i >> 31; } INLINE float32 float32_is_zero(float32 a) @@ -372,7 +374,9 @@ INLINE float64 float64_is_infinity(float64 a) INLINE float64 float64_is_neg(float64 a) { - return a < 0.0; + float64u u; + u.f = a; + return u.i >> 63; } INLINE float64 float64_is_zero(float64 a) @@ -474,7 +478,9 @@ INLINE floatx80 floatx80_is_infinity(floatx80 a) INLINE floatx80 floatx80_is_neg(floatx80 a) { - return a < 0.0; + floatx80u u; + u.f = a; + return u.i.high >> 15; } INLINE floatx80 floatx80_is_zero(floatx80 a) |