about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/ldbl-128')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_rintl.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_rintl.c b/sysdeps/ieee754/ldbl-128/s_rintl.c
index b6337e1d8a..3340c35ee1 100644
--- a/sysdeps/ieee754/ldbl-128/s_rintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_rintl.c
@@ -31,15 +31,19 @@ static char rcsid[] = "$NetBSD: $";
 #include <math.h>
 #include <math_private.h>
 #include <libm-alias-ldouble.h>
-
-static const _Float128
-TWO112[2]={
-  5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
- -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
-};
+#include <math-use-builtins.h>
 
 _Float128 __rintl(_Float128 x)
 {
+#if USE_RINTL_BUILTIN
+  return __builtin_rintl (x);
+#else
+  /* Use generic implementation.  */
+  static const _Float128
+    TWO112[2] = {
+		 5.19229685853482762853049632922009600E+33L, /* 0x406F000000000000, 0 */
+		 -5.19229685853482762853049632922009600E+33L  /* 0xC06F000000000000, 0 */
+  };
 	int64_t i0,j0,sx;
 	uint64_t i1 __attribute__ ((unused));
 	_Float128 w,t;
@@ -60,5 +64,6 @@ _Float128 __rintl(_Float128 x)
 	}
 	w = TWO112[sx]+x;
 	return w-TWO112[sx];
+#endif /* ! USE_RINTL_BUILTIN  */
 }
 libm_alias_ldouble (__rint, rint)