about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128/s_lrintl.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/s_lrintl.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/s_lrintl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lrintl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 23f828f862..b961f5be3a 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -26,19 +26,19 @@
 #include <math_private.h>
 #include <fix-fp-int-convert-overflow.h>
 
-static const long double two112[2] =
+static const _Float128 two112[2] =
 {
   5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
  -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
 };
 
 long int
-__lrintl (long double x)
+__lrintl (_Float128 x)
 {
   int32_t j0;
   u_int64_t i0,i1;
-  long double w;
-  long double t;
+  _Float128 w;
+  _Float128 t;
   long int result;
   int sx;
 
@@ -55,7 +55,7 @@ __lrintl (long double x)
 #if defined FE_INVALID || defined FE_INEXACT
 	  /* X < LONG_MAX + 1 implied by J0 < 31.  */
 	  if (sizeof (long int) == 4
-	      && x > (long double) LONG_MAX)
+	      && x > (_Float128) LONG_MAX)
 	    {
 	      /* In the event of overflow we must raise the "invalid"
 		 exception, but not "inexact".  */
@@ -82,7 +82,7 @@ __lrintl (long double x)
 #if defined FE_INVALID || defined FE_INEXACT
 	  /* X < LONG_MAX + 1 implied by J0 < 63.  */
 	  if (sizeof (long int) == 8
-	      && x > (long double) LONG_MAX)
+	      && x > (_Float128) LONG_MAX)
 	    {
 	      /* In the event of overflow we must raise the "invalid"
 		 exception, but not "inexact".  */
@@ -112,8 +112,8 @@ __lrintl (long double x)
 	 FE_INVALID must be raised and the return value is
 	 unspecified.  */
 #if defined FE_INVALID || defined FE_INEXACT
-      if (x < (long double) LONG_MIN
-	  && x > (long double) LONG_MIN - 1.0L)
+      if (x < (_Float128) LONG_MIN
+	  && x > (_Float128) LONG_MIN - 1.0L)
 	{
 	  /* If truncation produces LONG_MIN, the cast will not raise
 	     the exception, but may raise "inexact".  */
@@ -121,7 +121,7 @@ __lrintl (long double x)
 	  feraiseexcept (t == LONG_MIN ? FE_INEXACT : FE_INVALID);
 	  return LONG_MIN;
 	}
-      else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (long double) LONG_MIN)
+      else if (FIX_LDBL_LONG_CONVERT_OVERFLOW && x != (_Float128) LONG_MIN)
 	{
 	  feraiseexcept (FE_INVALID);
 	  return sx == 0 ? LONG_MAX : LONG_MIN;