about summary refs log tree commit diff
path: root/sysdeps/alpha/fpu
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-01-29 16:58:13 +0000
committerUlrich Drepper <drepper@redhat.com>1999-01-29 16:58:13 +0000
commit6eaccb759aff7e3fdd679d39aabaf773b18dfbd1 (patch)
treeba33932b592d55490b64f2c76ad367e0530ad170 /sysdeps/alpha/fpu
parent21ab6fb6bc4c2eb2b3a9b533d11942b45865aca5 (diff)
downloadglibc-6eaccb759aff7e3fdd679d39aabaf773b18dfbd1.tar.gz
glibc-6eaccb759aff7e3fdd679d39aabaf773b18dfbd1.tar.xz
glibc-6eaccb759aff7e3fdd679d39aabaf773b18dfbd1.zip
1999-01-29  Richard Henderson  <rth@twiddle.net>

	* scripts/config.sub: Recognize alpha{pca5[67],ev[67]}.

	* sysdeps/generic/elf/backtracesyms.c (__backtrace_symbols):
	Format pointer differences as longs.

	* sysdeps/alpha/fpu/s_floor.c, sysdeps/alpha/fpu/s_floorf.c:
	Copy commentary from bits/mathinclude.h.  Kill unused defines.

	* sysdeps/alpha/atomicity.h: New file.
Diffstat (limited to 'sysdeps/alpha/fpu')
-rw-r--r--sysdeps/alpha/fpu/s_floor.c11
-rw-r--r--sysdeps/alpha/fpu/s_floorf.c14
2 files changed, 11 insertions, 14 deletions
diff --git a/sysdeps/alpha/fpu/s_floor.c b/sysdeps/alpha/fpu/s_floor.c
index c7e14662fe..146e19b35a 100644
--- a/sysdeps/alpha/fpu/s_floor.c
+++ b/sysdeps/alpha/fpu/s_floor.c
@@ -17,18 +17,17 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef __USE_EXTERN_INLINES
-#define __USE_EXTERN_INLINES
-#endif
-#define __floor __i_floor
-
 #include <math.h>
 
-#undef __floor
+
+/* Use the -inf rounding mode conversion instructions to implement
+   floor.  We note when the exponent is large enough that the value
+   must be integral, as this avoids unpleasant integer overflows.  */
 
 double
 __floor (double x)
 {
+  /* Check not zero since floor(-0) == -0.  */
   if (x != 0 && fabs (x) < 9007199254740992.0)  /* 1 << DBL_MANT_DIG */
     {
       double __tmp1;
diff --git a/sysdeps/alpha/fpu/s_floorf.c b/sysdeps/alpha/fpu/s_floorf.c
index 7502b6781e..9e693642dd 100644
--- a/sysdeps/alpha/fpu/s_floorf.c
+++ b/sysdeps/alpha/fpu/s_floorf.c
@@ -17,14 +17,12 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifndef __USE_EXTERN_INLINES
-#define __USE_EXTERN_INLINES
-#endif
-#define __floorf __i_floorf
-
 #include <math.h>
 
-#undef __floorf
+
+/* Use the -inf rounding mode conversion instructions to implement
+   floor.  We note when the exponent is large enough that the value
+   must be integral, as this avoids unpleasant integer overflows.  */
 
 float
 __floorf (float x)
@@ -37,7 +35,7 @@ __floorf (float x)
 	 convert back to S_Floating in the end.  The initial
 	 conversion to T_Floating is needed to handle denormals.  */
 
-      float __tmp1, __tmp2;
+      float tmp1, tmp2;
 
       __asm ("cvtst/s %3,%2\n\t"
 #ifdef _IEEE_FP_INEXACT
@@ -46,7 +44,7 @@ __floorf (float x)
 	     "cvttq/svm %2,%1\n\t"
 #endif
 	     "cvtqt/m %1,%0\n\t"
-	     : "=f"(x), "=&f"(__tmp1), "=&f"(__tmp2)
+	     : "=f"(x), "=&f"(tmp1), "=&f"(tmp2)
 	     : "f"(x));
     }
   return x;