about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64')
-rw-r--r--sysdeps/ieee754/dbl-64/s_trunc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_trunc.c b/sysdeps/ieee754/dbl-64/s_trunc.c
index 0de68ce298..c3129fea7b 100644
--- a/sysdeps/ieee754/dbl-64/s_trunc.c
+++ b/sysdeps/ieee754/dbl-64/s_trunc.c
@@ -22,11 +22,16 @@
 
 #include <math_private.h>
 #include <libm-alias-double.h>
+#include <math-use-builtins.h>
 
 
 double
 __trunc (double x)
 {
+#if USE_TRUNC_BUILTIN
+  return __builtin_trunc (x);
+#else
+  /* Use generic implementation.  */
   int64_t i0, j0;
   int64_t sx;
 
@@ -49,6 +54,7 @@ __trunc (double x)
     }
 
   return x;
+#endif /* ! USE_TRUNC_BUILTIN  */
 }
 #ifndef __trunc
 libm_alias_double (__trunc, trunc)