Package: libprelude / 1.0.0-11.9

016_ppc64el-isnan-tests-fix-for-little-endian-PowerPC.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
curl 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=patch;h=e962c07c0c8bb18f9a5969cbf1ddb01d0fe4f55c' \
  | filterdiff \
      --strip=1 \
      --addoldprefix='a/libmissing/' \
      --addnewprefix='b/libmissing/' \
      -i '*/tests/test-isnanl.h' \
      -i '*/tests/test-signbit.c' \
  > 'ppc64el-isnan-tests-fix-for-little-endian-PowerPC.patch'

--- a/libmissing/tests/test-isnanl.h
+++ b/libmissing/tests/test-isnanl.h
@@ -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
--- a/libmissing/tests/test-signbit.c
+++ b/libmissing/tests/test-signbit.c
@@ -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