about summary refs log tree commit diff
path: root/sysdeps/sparc/fpu/fraiseexcpt.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sysdeps/sparc/fpu/fraiseexcpt.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sysdeps/sparc/fpu/fraiseexcpt.c')
-rw-r--r--sysdeps/sparc/fpu/fraiseexcpt.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/sysdeps/sparc/fpu/fraiseexcpt.c b/sysdeps/sparc/fpu/fraiseexcpt.c
index cbb8be80ec..0d45ec82d2 100644
--- a/sysdeps/sparc/fpu/fraiseexcpt.c
+++ b/sysdeps/sparc/fpu/fraiseexcpt.c
@@ -25,12 +25,12 @@
 int
 __feraiseexcept (int excepts)
 {
+  static volatile double sink;
   static const struct {
     double zero, one, max, min, sixteen, pi;
   } c = {
     0.0, 1.0, DBL_MAX, DBL_MIN, 16.0, M_PI
   };
-  double d;
 
   /* Raise exceptions represented by EXPECTS.  But we must raise only
      one signal at a time.  It is important the if the overflow/underflow
@@ -39,44 +39,24 @@ __feraiseexcept (int excepts)
 
   /* First: invalid exception.  */
   if ((FE_INVALID & excepts) != 0)
-    {
-      /* One example of a invalid operation is 0/0.  */
-      __asm ("" : "=e" (d) : "0" (c.zero));
-      d /= c.zero;
-      __asm __volatile ("" : : "e" (d));
-    }
+    /* One example of a invalid operation is 0/0.  */
+    sink = c.zero / c.zero;
 
   /* Next: division by zero.  */
   if ((FE_DIVBYZERO & excepts) != 0)
-    {
-      __asm ("" : "=e" (d) : "0" (c.one));
-      d /= c.zero;
-      __asm __volatile ("" : : "e" (d));
-    }
+    sink = c.one / c.zero;
 
   /* Next: overflow.  */
   if ((FE_OVERFLOW & excepts) != 0)
-    {
-      __asm ("" : "=e" (d) : "0" (c.max));
-      d *= d;
-      __asm __volatile ("" : : "e" (d));
-    }
+    sink = c.max * c.max;
 
   /* Next: underflow.  */
   if ((FE_UNDERFLOW & excepts) != 0)
-    {
-      __asm ("" : "=e" (d) : "0" (c.min));
-      d /= c.sixteen;
-      __asm __volatile ("" : : "e" (d));
-    }
+    sink = c.min / c.sixteen;
 
   /* Last: inexact.  */
   if ((FE_INEXACT & excepts) != 0)
-    {
-      __asm ("" : "=e" (d) : "0" (c.one));
-      d /= c.pi;
-      __asm __volatile ("" : : "e" (d));
-    }
+    sink = c.one / c.pi;
 
   /* Success.  */
   return 0;