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
This commit is contained in:
aurel32 2008-12-15 22:07:50 +00:00
parent ce9ede844c
commit 8d6c92b6b1
1 changed files with 9 additions and 3 deletions

View File

@ -265,7 +265,9 @@ INLINE float32 float32_is_infinity(float32 a)
INLINE float32 float32_is_neg(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) 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) 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) 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) 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) INLINE floatx80 floatx80_is_zero(floatx80 a)