about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128/x2y2m1l.c
diff options
context:
space:
mode:
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-07-20 15:20:51 -0500
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>2016-08-31 10:38:11 -0500
commit15089e046b6c71bbefe29687fe4c7e569c9e1c03 (patch)
tree6e857cd8ec0519902d2e4cd16e4f31bda0402584 /sysdeps/ieee754/ldbl-128/x2y2m1l.c
parente9b424881a4f85284e56d8b561c54ff57a7c1c9b (diff)
downloadglibc-15089e046b6c71bbefe29687fe4c7e569c9e1c03.tar.gz
glibc-15089e046b6c71bbefe29687fe4c7e569c9e1c03.tar.xz
glibc-15089e046b6c71bbefe29687fe4c7e569c9e1c03.zip
ldbl-128: Rename 'long double' to '_Float128'
Add a layer of macro indirection for long double files
which need to be built using another typename.  Likewise,
add the L(num) macro used in a later patch to override
real constants.

These macros are only defined through the ldbl-128
math_ldbl.h header, thereby implicitly restricting
these macros to machines which back long double
with an IEEE binary128 format.

Likewise, appropriate changes are made for the few
files which indirectly include such ldbl-128 files.

These changes produce identical binaries for s390x,
aarch64, and ppc64.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/x2y2m1l.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/x2y2m1l.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sysdeps/ieee754/ldbl-128/x2y2m1l.c b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
index 4e97885d59..0f7f8bcb86 100644
--- a/sysdeps/ieee754/ldbl-128/x2y2m1l.c
+++ b/sysdeps/ieee754/ldbl-128/x2y2m1l.c
@@ -27,7 +27,7 @@
    overflow occurs.  */
 
 static inline void
-add_split (long double *hi, long double *lo, long double x, long double y)
+add_split (_Float128 *hi, _Float128 *lo, _Float128 x, _Float128 y)
 {
   /* Apply Dekker's algorithm.  */
   *hi = x + y;
@@ -40,8 +40,8 @@ add_split (long double *hi, long double *lo, long double x, long double y)
 static int
 compare (const void *p, const void *q)
 {
-  long double pld = fabsl (*(const long double *) p);
-  long double qld = fabsl (*(const long double *) q);
+  _Float128 pld = fabsl (*(const _Float128 *) p);
+  _Float128 qld = fabsl (*(const _Float128 *) q);
   if (pld < qld)
     return -1;
   else if (pld == qld)
@@ -54,22 +54,22 @@ compare (const void *p, const void *q)
    It is given that 1 > X >= Y >= epsilon / 2, and that X^2 + Y^2 >=
    0.5.  */
 
-long double
-__x2y2m1l (long double x, long double y)
+_Float128
+__x2y2m1l (_Float128 x, _Float128 y)
 {
-  long double vals[5];
+  _Float128 vals[5];
   SET_RESTORE_ROUNDL (FE_TONEAREST);
   mul_splitl (&vals[1], &vals[0], x, x);
   mul_splitl (&vals[3], &vals[2], y, y);
   vals[4] = -1.0L;
-  qsort (vals, 5, sizeof (long double), compare);
+  qsort (vals, 5, sizeof (_Float128), compare);
   /* Add up the values so that each element of VALS has absolute value
      at most equal to the last set bit of the next nonzero
      element.  */
   for (size_t i = 0; i <= 3; i++)
     {
       add_split (&vals[i + 1], &vals[i], vals[i + 1], vals[i]);
-      qsort (vals + i + 1, 4 - i, sizeof (long double), compare);
+      qsort (vals + i + 1, 4 - i, sizeof (_Float128), compare);
     }
   /* Now any error from this addition will be small.  */
   return vals[4] + vals[3] + vals[2] + vals[1] + vals[0];