]> Savannah Git Hosting - gnulib.git/commitdiff
isfinite, isinf, isnan tests: fix for little-endian PowerPC
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 30 May 2014 10:34:23 +0000 (11:34 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 30 May 2014 10:39:19 +0000 (11:39 +0100)
* tests/test-isfinite.c (test_isfinitel): Only manipulate the
first double of a PowerPC "double double" pair.
* tests/test-isinf.c (test_isinfl): Likewise.
* tests/test-isnan.c (test_long_double): Likewise.
* tests/test-isnanl.h (main): Likewise.
* tests/test-signbit.c (test_signbitl): Likewise.

ChangeLog
tests/test-isfinite.c
tests/test-isinf.c
tests/test-isnan.c
tests/test-isnanl.h
tests/test-signbit.c

index 33ffe6e4107447e54e9cb51bd5321b0a36ea6900..13ea1a8c5a4ddb2b555cde7c2eff8b60d8a57139 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2014-05-30  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       isfinite, isinf, isnan tests: fix for little-endian PowerPC
+       * tests/test-isfinite.c (test_isfinitel): Only manipulate the
+       first double of a PowerPC "double double" pair.
+       * tests/test-isinf.c (test_isinfl): Likewise.
+       * tests/test-isnan.c (test_long_double): Likewise.
+       * tests/test-isnanl.h (main): Likewise.
+       * tests/test-signbit.c (test_signbitl): Likewise.
+
 2014-05-29  Paul Eggert  <eggert@cs.ucla.edu>
 
        exclude-tests: port to AIX 7.1
index fa2904ac7ae35c03ff38506c6670e8398b5364dd..5d320eafe8ae05a5bdcf893989c640baa8d0c58f 100644 (file)
@@ -152,6 +152,15 @@ test_isfinitel ()
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = zerol / zerol;
 # if LDBL_EXPBIT0_BIT > 0
index 0a13224e051c881d9a0f7b86f4330d5dd6cea184..2505c320189fa570a4f29603098cb850c42a66d0 100644 (file)
@@ -158,6 +158,15 @@ test_isinfl ()
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = zerol / zerol;
 # if LDBL_EXPBIT0_BIT > 0
index e54b654012896a515116f7513bbf9a2c3bf70649..9cb5e072adfba41e1ed77cb32d91b7f1742172fb 100644 (file)
@@ -139,6 +139,15 @@ test_long_double (void)
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDSL
+    #define NWORDSL \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = NaNl ();
 # if LDBL_EXPBIT0_BIT > 0
index eaf5da108430f409c6c298d70dafddfa5c293753..015b0864971058ba922a7b0ecccb80ed9adf3694 100644 (file)
@@ -51,6 +51,15 @@ main ()
   /* A bit pattern that is different from a Quiet NaN.  With a bit of luck,
      it's a Signalling NaN.  */
   {
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = NaNl ();
 # if LDBL_EXPBIT0_BIT > 0
index d3ebbd6ec5948322aaa5981ec9f2d4fdaec93da4..584bf4f91d2126232464f4eada94ab9d51416845 100644 (file)
@@ -151,6 +151,16 @@ test_signbitl ()
     #define NWORDS \
       ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
     typedef union { long double value; unsigned int word[NWORDS]; } memory_long_double;
+
+#if defined __powerpc__ && LDBL_MANT_DIG == 106
+    /* This is PowerPC "double double", a pair of two doubles.  Inf and Nan are
+       represented as the corresponding 64-bit IEEE values in the first double;
+       the second is ignored.  Manipulate only the first double.  */
+    #undef NWORDS
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+#endif
+
     memory_long_double m;
     m.value = zerol / zerol;
 # if LDBL_EXPBIT0_BIT > 0