Patchwork [02/20] softfloat: fix floatx80_is_infinity()

login
register
mail settings
Submitter Aurelien Jarno
Date April 18, 2011, 8:59 p.m.
Message ID <1303160412-8107-3-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/91845/
State New
Headers show

Comments

Aurelien Jarno - April 18, 2011, 8:59 p.m.
With floatx80, the explicit bit is set for infinity.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 fpu/softfloat.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Peter Maydell - April 19, 2011, 10:55 a.m.
On 18 April 2011 21:59, Aurelien Jarno <aurelien@aurel32.net> wrote:
> With floatx80, the explicit bit is set for infinity.
>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

-- PMM

Patch

diff --git a/fpu/softfloat.h b/fpu/softfloat.h
index 340f0a9..3363128 100644
--- a/fpu/softfloat.h
+++ b/fpu/softfloat.h
@@ -566,7 +566,7 @@  INLINE floatx80 floatx80_chs(floatx80 a)
 
 INLINE int floatx80_is_infinity(floatx80 a)
 {
-    return (a.high & 0x7fff) == 0x7fff && a.low == 0;
+    return (a.high & 0x7fff) == 0x7fff && a.low == 0x8000000000000000LL;
 }
 
 INLINE int floatx80_is_neg(floatx80 a)