summaryrefslogtreecommitdiff
path: root/sysdeps/alpha/fpu/s_ceil.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-03-17 21:53:01 +0000
committerJakub Jelinek <jakub@redhat.com>2007-03-17 21:53:01 +0000
commit6ce38a95a4c8318df75cf91fbd90101601b3fa7f (patch)
tree044df11ca5f10f967644dffe5b0f621d6ac36188 /sysdeps/alpha/fpu/s_ceil.c
parentb428b742cf54d423e5a7a68fcbec9473303eeafa (diff)
Updated to fedora-glibc-20070317T2130cvs/fedora-glibc-2_5_90-19
Diffstat (limited to 'sysdeps/alpha/fpu/s_ceil.c')
-rw-r--r--sysdeps/alpha/fpu/s_ceil.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/sysdeps/alpha/fpu/s_ceil.c b/sysdeps/alpha/fpu/s_ceil.c
index ec58fd9486..40c2379286 100644
--- a/sysdeps/alpha/fpu/s_ceil.c
+++ b/sysdeps/alpha/fpu/s_ceil.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 2000, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Richard Henderson.
@@ -27,25 +27,20 @@
double
__ceil (double x)
{
- if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
- {
- double tmp1, new_x;
-
- new_x = -x;
- __asm (
+ double two52 = copysign (0x1.0p52, x);
+ double r, tmp;
+
+ __asm (
#ifdef _IEEE_FP_INEXACT
- "cvttq/svim %2,%1\n\t"
+ "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
#else
- "cvttq/svm %2,%1\n\t"
+ "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
#endif
- "cvtqt/m %1,%0\n\t"
- : "=f"(new_x), "=&f"(tmp1)
- : "f"(new_x));
-
- /* Fix up the negation we did above, as well as handling -0 properly. */
- x = copysign(new_x, x);
- }
- return x;
+ : "=&f"(r), "=&f"(tmp)
+ : "f"(-x), "f"(-two52));
+
+ /* Fix up the negation we did above, as well as handling -0 properly. */
+ return copysign (r, x);
}
weak_alias (__ceil, ceil)