aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc32/fpu/s_llrintf.c')
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/s_llrintf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c b/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
index 021a86fada..b75655e2c1 100644
--- a/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
+++ b/sysdeps/powerpc/powerpc32/fpu/s_llrintf.c
@@ -24,6 +24,12 @@
long long int
__llrintf (float x)
{
+#ifdef _ARCH_PWR4
+ /* Assume powerpc64 instructions availability. */
+ long long int ret;
+ __asm__ ("fctid %0, %1" : "=d" (ret) : "d" (x));
+ return ret;
+#else
float rx = rintf (x);
if (HAVE_PPC_FCTIDZ || rx != x)
return (long long int) rx;
@@ -43,5 +49,6 @@ __llrintf (float x)
mant <<= exponent - 23;
return (long long int) ((i0 & 0x80000000) != 0 ? -mant : mant);
}
+#endif
}
libm_alias_float (__llrint, llrint)