qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] !fixup softfloat: get default NaN values for SNAN_BIT_IS_ONE right
@ 2014-12-11 18:00 Peter Maydell
  0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2014-12-11 18:00 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Richard Henderson, Maciej W. Rozycki,
	Aurelien Jarno, patches

The default NaN values for SNAN_BIT_IS_ONE were actually
infinities (all exponent bits set, all mantissa bits clear).
Make them really NaNs (all exponent bits set, top bit of
mantissa clear, all other mantissa bits set).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This fixes the error pointed out by Maciej.

I'll squash this patch into the other softfloat-relicensing patch;
it didn't seem worth sending out the whole series again for this
since I anticipate further review. In the meantime, here's the
correction.

 fpu/softfloat-specialize.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h
index b65505f..5b4dbcd 100644
--- a/fpu/softfloat-specialize.h
+++ b/fpu/softfloat-specialize.h
@@ -116,7 +116,7 @@ const float32 float32_default_nan = const_float32(0x7FFFFFFF);
       defined(TARGET_XTENSA)
 const float32 float32_default_nan = const_float32(0x7FC00000);
 #elif SNAN_BIT_IS_ONE
-const float32 float32_default_nan = const_float32(0xFF800000);
+const float32 float32_default_nan = const_float32(0x7FBFFFFF);
 #else
 const float32 float32_default_nan = const_float32(0xFFC00000);
 #endif
@@ -129,7 +129,7 @@ const float64 float64_default_nan = const_float64(LIT64( 0x7FFFFFFFFFFFFFFF ));
 #elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA)
 const float64 float64_default_nan = const_float64(LIT64( 0x7FF8000000000000 ));
 #elif SNAN_BIT_IS_ONE
-const float64 float64_default_nan = const_float64(LIT64(0xFFF0000000000000));
+const float64 float64_default_nan = const_float64(LIT64(0x7FF7FFFFFFFFFFFF));
 #else
 const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
 #endif
@@ -138,8 +138,8 @@ const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
 | The pattern for a default generated extended double-precision NaN.
 *----------------------------------------------------------------------------*/
 #if SNAN_BIT_IS_ONE
-#define floatx80_default_nan_high 0xFFFF
-#define floatx80_default_nan_low  LIT64(0x8000000000000000)
+#define floatx80_default_nan_high 0x7FFF
+#define floatx80_default_nan_low  LIT64(0xBFFFFFFFFFFFFFFF)
 #else
 #define floatx80_default_nan_high 0xFFFF
 #define floatx80_default_nan_low  LIT64( 0xC000000000000000 )
@@ -153,8 +153,8 @@ const floatx80 floatx80_default_nan
 | `low' values hold the most- and least-significant bits, respectively.
 *----------------------------------------------------------------------------*/
 #if SNAN_BIT_IS_ONE
-#define float128_default_nan_high LIT64(0xFFFF000000000000)
-#define float128_default_nan_low  LIT64(0x0000000000000000)
+#define float128_default_nan_high LIT64(0x7FFF7FFFFFFFFFFF)
+#define float128_default_nan_low  LIT64(0xFFFFFFFFFFFFFFFF)
 #else
 #define float128_default_nan_high LIT64( 0xFFFF800000000000 )
 #define float128_default_nan_low  LIT64( 0x0000000000000000 )
-- 
1.9.1

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

only message in thread, other threads:[~2014-12-11 18:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 18:00 [Qemu-devel] [PATCH] !fixup softfloat: get default NaN values for SNAN_BIT_IS_ONE right Peter Maydell

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).