about summary refs log tree commit diff
path: root/sysdeps/alpha/fpu/s_ceilf.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_ceilf.c
parentb428b742cf54d423e5a7a68fcbec9473303eeafa (diff)
downloadglibc-6ce38a95a4c8318df75cf91fbd90101601b3fa7f.tar.gz
glibc-6ce38a95a4c8318df75cf91fbd90101601b3fa7f.tar.xz
glibc-6ce38a95a4c8318df75cf91fbd90101601b3fa7f.zip
Updated to fedora-glibc-20070317T2130 cvs/fedora-glibc-2_5_90-19
Diffstat (limited to 'sysdeps/alpha/fpu/s_ceilf.c')
-rw-r--r--sysdeps/alpha/fpu/s_ceilf.c34
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)