]> Savannah Git Hosting - gnulib.git/commitdiff
snan: Add support for m68k.
authorBruno Haible <bruno@clisp.org>
Fri, 19 Apr 2024 00:13:30 +0000 (02:13 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 19 Apr 2024 00:13:30 +0000 (02:13 +0200)
* lib/snan.h (construct_memory_SNaNl): Handle m68k specially.

ChangeLog
lib/snan.h

index 6a925743911847adc00315d0cc96d2b4c0a248ba..3fe18478975dded500b4f77cf08e15e771338e56 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-04-18  Bruno Haible  <bruno@clisp.org>
+
+       snan: Add support for m68k.
+       * lib/snan.h (construct_memory_SNaNl): Handle m68k specially.
+
 2024-04-18  Bruno Haible  <bruno@clisp.org>
 
        totalorderl: Simplify on MSVC.
index c7312e259f9f8dcc3609fbacdbd04f30f31eeb3b..caee37b515f5776f5d9de035ec2df36a778f8485 100644 (file)
@@ -230,6 +230,11 @@ construct_memory_SNaNl (long double quiet_value)
     m.word[LDBL_EXPBIT0_WORD + (LDBL_EXPBIT0_WORD < HNWORDS / 2 ? 1 : - 1)]
       ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 2);
    #endif
+  #elif (defined __m68k__ && LDBL_MANT_DIG == 64) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+  /* In this representation, there is a 16-bits gap between the exponent and
+     the mantissa, and the leading 1 of the mantissa is explicitly stored.  */
+    m.word[LDBL_EXPBIT0_WORD + 1]
+      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 2);
   #else
   /* In this representation, the leading 1 of the mantissa is implicit.  */
    #if LDBL_EXPBIT0_BIT > 0