diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/s_llrintl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_llrintl.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_llrintl.c b/sysdeps/ieee754/ldbl-128/s_llrintl.c index 79d3937cc9..3a5635d509 100644 --- a/sysdeps/ieee754/ldbl-128/s_llrintl.c +++ b/sysdeps/ieee754/ldbl-128/s_llrintl.c @@ -24,16 +24,22 @@ #include <math_private.h> #include <libm-alias-ldouble.h> #include <fix-fp-int-convert-overflow.h> +#include <math-use-builtins.h> -static const _Float128 two112[2] = -{ - L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */ - L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */ -}; long long int __llrintl (_Float128 x) { +#if USE_LLRINTL_BUILTIN + return __builtin_round (x); +#else + /* Use generic implementation. */ + static const _Float128 two112[2] = + { + L(5.19229685853482762853049632922009600E+33), /* 0x406F000000000000, 0 */ + L(-5.19229685853482762853049632922009600E+33) /* 0xC06F000000000000, 0 */ + }; + int32_t j0; uint64_t i0,i1; _Float128 w; @@ -102,6 +108,7 @@ __llrintl (_Float128 x) } return sx ? -result : result; +#endif /* ! USE_LLRINTL_BUILTIN */ } libm_alias_ldouble (__llrint, llrint) |