diff options
Diffstat (limited to 'sysdeps/alpha/fpu/s_ceilf.c')
-rw-r--r-- | sysdeps/alpha/fpu/s_ceilf.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/sysdeps/alpha/fpu/s_ceilf.c b/sysdeps/alpha/fpu/s_ceilf.c index aba1697a55..0df651f405 100644 --- a/sysdeps/alpha/fpu/s_ceilf.c +++ b/sysdeps/alpha/fpu/s_ceilf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1998, 2000, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Richard Henderson. @@ -26,30 +26,20 @@ float __ceilf (float x) { - if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */ - { - /* Note that Alpha S_Floating is stored in registers in a - restricted T_Floating format, so we don't even need to - convert back to S_Floating in the end. The initial - conversion to T_Floating is needed to handle denormals. */ - - float tmp1, tmp2, new_x; - - new_x = -x; - __asm ("cvtst/s %3,%2\n\t" + float two23 = copysignf (0x1.0p23, x); + float r, tmp; + + __asm ( #ifdef _IEEE_FP_INEXACT - "cvttq/svim %2,%1\n\t" + "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0" #else - "cvttq/svm %2,%1\n\t" + "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0" #endif - "cvtqt/m %1,%0\n\t" - : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2) - : "f"(new_x)); - - /* Fix up the negation we did above, as well as handling -0 properly. */ - x = copysignf(new_x, x); - } - return x; + : "=&f"(r), "=&f"(tmp) + : "f"(-x), "f"(-two23)); + + /* Fix up the negation we did above, as well as handling -0 properly. */ + return copysignf (r, x); } weak_alias (__ceilf, ceilf) |