about summary refs log tree commit diff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/bits/fenv.h7
-rw-r--r--sysdeps/powerpc/fpu/fe_nomask.c5
-rw-r--r--sysdeps/powerpc/fpu/fedisblxcpt.c6
-rw-r--r--sysdeps/powerpc/fpu/feenablxcpt.c6
-rw-r--r--sysdeps/powerpc/fpu/fegetexcept.c7
-rw-r--r--sysdeps/powerpc/fpu/fenv_libc.h6
-rw-r--r--sysdeps/powerpc/fpu/fraiseexcpt.c11
7 files changed, 30 insertions, 18 deletions
diff --git a/sysdeps/powerpc/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index 10582a6ff6..1a5720abe6 100644
--- a/sysdeps/powerpc/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 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
@@ -136,6 +136,8 @@ extern const fenv_t __fe_enabled_env;
 extern const fenv_t __fe_nonieee_env;
 # define FE_NONIEEE_ENV	(&__fe_nonieee_env)
 
+__BEGIN_DECLS
+
 /* Floating-point environment with all exceptions enabled.  Note that
    just evaluating this value does not change the processor exception mode.
    Passing this mask to fesetenv will result in a prctl syscall to change
@@ -152,4 +154,7 @@ extern const fenv_t *__fe_nomask_env (void);
    this allows the fastest possible floating point execution.*/
 extern const fenv_t *__fe_mask_env (void);
 # define FE_MASK_ENV	FE_DFL_ENV
+
+__END_DECLS
+
 #endif
diff --git a/sysdeps/powerpc/fpu/fe_nomask.c b/sysdeps/powerpc/fpu/fe_nomask.c
index 3cccee1d06..bc18bb8f80 100644
--- a/sysdeps/powerpc/fpu/fe_nomask.c
+++ b/sysdeps/powerpc/fpu/fe_nomask.c
@@ -1,5 +1,5 @@
 /* Procedure definition for FE_NOMASK_ENV.
-   Copyright (C) 1997 Free Software Foundation, Inc.
+   Copyright (C) 1997, 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
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <fenv.h>
+#include <fenv_libc.h>
 #include <errno.h>
 
 /* This is a generic stub. An OS specific override is required to set
@@ -30,4 +30,5 @@ __fe_nomask_env(void)
   __set_errno (ENOSYS);
   return FE_ENABLED_ENV;
 }
+libm_hidden_def (__fe_nomask_env)
 stub_warning (__fe_nomask_env)
diff --git a/sysdeps/powerpc/fpu/fedisblxcpt.c b/sysdeps/powerpc/fpu/fedisblxcpt.c
index 3002b1b4cc..9df4bbc7ef 100644
--- a/sysdeps/powerpc/fpu/fedisblxcpt.c
+++ b/sysdeps/powerpc/fpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
 /* Disable floating-point exceptions.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
 
@@ -26,7 +26,7 @@ fedisableexcept (int excepts)
   fenv_union_t fe;
   int result, new;
 
-  result = fegetexcept ();
+  result = __fegetexcept ();
 
   if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
     excepts = (excepts | FE_INVALID) & ~ FE_ALL_INVALID;
@@ -44,7 +44,7 @@ fedisableexcept (int excepts)
     fe.l[1] &= ~(1 << (31 - FPSCR_VE));
   fesetenv_register (fe.fenv);
 
-  new = fegetexcept ();
+  new = __fegetexcept ();
   if (new == 0 && result != 0)
     (void)__fe_mask_env ();
 
diff --git a/sysdeps/powerpc/fpu/feenablxcpt.c b/sysdeps/powerpc/fpu/feenablxcpt.c
index 7bff18b421..4875e95e32 100644
--- a/sysdeps/powerpc/fpu/feenablxcpt.c
+++ b/sysdeps/powerpc/fpu/feenablxcpt.c
@@ -1,5 +1,5 @@
 /* Enable floating-point exceptions.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
 
@@ -26,7 +26,7 @@ feenableexcept (int excepts)
   fenv_union_t fe;
   int result, new;
 
-  result = fegetexcept ();
+  result = __fegetexcept ();
 
   if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
     excepts = (excepts | FE_INVALID) & ~ FE_ALL_INVALID;
@@ -44,7 +44,7 @@ feenableexcept (int excepts)
     fe.l[1] |= (1 << (31 - FPSCR_VE));
   fesetenv_register (fe.fenv);
 
-  new = fegetexcept ();
+  new = __fegetexcept ();
   if (new != 0 && result == 0)
     (void)__fe_nomask_env ();
 
diff --git a/sysdeps/powerpc/fpu/fegetexcept.c b/sysdeps/powerpc/fpu/fegetexcept.c
index 0b5cebb6dd..c85cb1b222 100644
--- a/sysdeps/powerpc/fpu/fegetexcept.c
+++ b/sysdeps/powerpc/fpu/fegetexcept.c
@@ -1,5 +1,5 @@
 /* Get floating-point exceptions.
-   Copyright (C) 2000 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Geoffrey Keating <geoffk@geoffk.org>, 2000.
 
@@ -21,13 +21,13 @@
 #include <fenv_libc.h>
 
 int
-fegetexcept (void)
+__fegetexcept (void)
 {
   fenv_union_t fe;
   int result = 0;
 
   fe.fenv = fegetenv_register ();
- 
+
   if (fe.l[1] & (1 << (31 - FPSCR_XE)))
       result |= FE_INEXACT;
   if (fe.l[1] & (1 << (31 - FPSCR_ZE)))
@@ -41,3 +41,4 @@ fegetexcept (void)
 
   return result;
 }
+weak_alias (__fegetexcept, fegetexcept)
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index fd5fc0c767..6f116b60d5 100644
--- a/sysdeps/powerpc/fpu/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
@@ -1,5 +1,5 @@
 /* Internal libc stuff for floating point environment routines.
-   Copyright (C) 1997, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2006, 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
@@ -22,6 +22,8 @@
 
 #include <fenv.h>
 
+libm_hidden_proto (__fe_nomask_env)
+
 /* The sticky bits in the FPSCR indicating exceptions have occurred.  */
 #define FPSCR_STICKY_BITS ((FE_ALL_EXCEPT | FE_ALL_INVALID) & ~FE_INVALID)
 
@@ -137,5 +139,5 @@ enum {
    ({ float f; asm volatile ("fmuls %0,%1,%2" \
 			     : "=f"(f) \
 			     : "f" (x), "f"((float)1.0)); f; })
- 
+
 #endif /* fenv_libc.h */
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;