about summary refs log tree commit diff
path: root/sysdeps/powerpc/fpu/fraiseexcpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/fpu/fraiseexcpt.c')
-rw-r--r--sysdeps/powerpc/fpu/fraiseexcpt.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sysdeps/powerpc/fpu/fraiseexcpt.c b/sysdeps/powerpc/fpu/fraiseexcpt.c
index dbe36c3d5a..2d983d97c7 100644
--- a/sysdeps/powerpc/fpu/fraiseexcpt.c
+++ b/sysdeps/powerpc/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
 /* Raise given exceptions.
-   Copyright (C) 1997,99,2000,01,02 Free Software Foundation, Inc.
+   Copyright (C) 1997,1999-2002, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -45,12 +45,15 @@ __feraiseexcept (int excepts)
      triggering any appropriate exceptions.  */
   fesetenv_register (u.fenv);
 
-  if ((excepts & FE_INVALID)
+  if ((excepts & FE_INVALID))
+    {
       /* For some reason, some PowerPC chips (the 601, in particular)
 	 don't have FE_INVALID_SOFTWARE implemented.  Detect this
 	 case and raise FE_INVALID_SNAN instead.  */
-      && !fetestexcept (FE_INVALID))
-    set_fpscr_bit (FPSCR_VXSNAN);
+      u.fenv = fegetenv_register ();
+      if ((u.l[1] & FE_INVALID) == 0)
+	set_fpscr_bit (FPSCR_VXSNAN);
+    }
 
   /* Success.  */
   return 0;