qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [6059] softfloat-native: improve correctness of floatXX_is_neg()
@ 2008-12-15 22:07 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2008-12-15 22:07 UTC (permalink / raw)
  To: qemu-devel

Revision: 6059
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6059
Author:   aurel32
Date:     2008-12-15 22:07:50 +0000 (Mon, 15 Dec 2008)

Log Message:
-----------
softfloat-native: improve correctness of floatXX_is_neg()

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Modified Paths:
--------------
    trunk/fpu/softfloat-native.h

Modified: trunk/fpu/softfloat-native.h
===================================================================
--- trunk/fpu/softfloat-native.h	2008-12-15 21:48:27 UTC (rev 6058)
+++ trunk/fpu/softfloat-native.h	2008-12-15 22:07:50 UTC (rev 6059)
@@ -265,7 +265,9 @@
 
 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_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_neg(floatx80 a)
 {
-    return a < 0.0;
+    floatx80u u;
+    u.f = a;
+    return u.i.high >> 15;
 }
 
 INLINE floatx80 floatx80_is_zero(floatx80 a)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-15 22:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-15 22:07 [Qemu-devel] [6059] softfloat-native: improve correctness of floatXX_is_neg() Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).