From 67e971f18ffc9b3ea57cbccba54d5203d1e6a988 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Thu, 28 Feb 2013 17:12:25 +0100 Subject: Better distinguish between NaN/qNaN/sNaN. --- ports/sysdeps/mips/bits/nan.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'ports/sysdeps') diff --git a/ports/sysdeps/mips/bits/nan.h b/ports/sysdeps/mips/bits/nan.h index 7aa157b1d6..80f7866a97 100644 --- a/ports/sysdeps/mips/bits/nan.h +++ b/ports/sysdeps/mips/bits/nan.h @@ -22,10 +22,10 @@ /* IEEE Not A Number. */ -/* Note that MIPS has the QNaN and SNaN patterns reversed compared to most - other architectures. The IEEE spec left the definition of this open to +/* Note that MIPS has the qNaN and sNaN patterns reversed compared to most + other architectures. IEEE 754-1985 left the definition of this open to implementations, and for MIPS the top bit of the mantissa must be SET to - indicate a SNaN. */ + indicate a sNaN. */ #if __GNUC_PREREQ(3,3) @@ -43,14 +43,14 @@ # include # if __BYTE_ORDER == __BIG_ENDIAN -# define __nan_bytes { 0x7f, 0xbf, 0xff, 0xff } +# define __qnan_bytes { 0x7f, 0xbf, 0xff, 0xff } # endif # if __BYTE_ORDER == __LITTLE_ENDIAN -# define __nan_bytes { 0xff, 0xff, 0xbf, 0x7f } +# define __qnan_bytes { 0xff, 0xff, 0xbf, 0x7f } # endif -static union { unsigned char __c[4]; float __d; } __nan_union - __attribute__ ((__unused__)) = { __nan_bytes }; -# define NAN (__nan_union.__d) +static union { unsigned char __c[4]; float __d; } __qnan_union + __attribute__ ((__unused__)) = { __qnan_bytes }; +# define NAN (__qnan_union.__d) #endif /* GCC. */ -- cgit 1.4.1