aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc')
-rw-r--r--sysdeps/powerpc/fclrexcpt.c16
-rw-r--r--sysdeps/powerpc/fegetenv.c26
-rw-r--r--sysdeps/powerpc/fegetround.c29
-rw-r--r--sysdeps/powerpc/fesetenv.c26
-rw-r--r--sysdeps/powerpc/fesetround.c41
-rw-r--r--sysdeps/powerpc/feupdateenv.c37
-rw-r--r--sysdeps/powerpc/fpu/feholdexcpt.c (renamed from sysdeps/powerpc/feholdexcpt.c)0
-rw-r--r--sysdeps/powerpc/fpu/fenv_const.c (renamed from sysdeps/powerpc/fenv_const.c)0
-rw-r--r--sysdeps/powerpc/fpu/fenv_libc.h (renamed from sysdeps/powerpc/fenv_libc.h)0
-rw-r--r--sysdeps/powerpc/fpu/fgetexcptflg.c (renamed from sysdeps/powerpc/fgetexcptflg.c)12
-rw-r--r--sysdeps/powerpc/fpu/fraiseexcpt.c (renamed from sysdeps/powerpc/fraiseexcpt.c)12
-rw-r--r--sysdeps/powerpc/fpu/fsetexcptflg.c (renamed from sysdeps/powerpc/fsetexcptflg.c)12
-rw-r--r--sysdeps/powerpc/ftestexcept.c33
13 files changed, 38 insertions, 206 deletions
diff --git a/sysdeps/powerpc/fclrexcpt.c b/sysdeps/powerpc/fclrexcpt.c
index 47254fd..4a4adbb 100644
--- a/sysdeps/powerpc/fclrexcpt.c
+++ b/sysdeps/powerpc/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear given exceptions in current floating-point environment.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999 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
@@ -20,8 +20,8 @@
#include <fenv_libc.h>
#undef feclearexcept
-void
-feclearexcept (int excepts)
+int
+__feclearexcept (int excepts)
{
fenv_union_t u;
@@ -29,9 +29,15 @@ feclearexcept (int excepts)
u.fenv = fegetenv_register ();
/* Clear the relevant bits. */
- u.l[1] = u.l[1] & ~((-((excepts) >> (31-FPSCR_VX) & 1) & FE_ALL_INVALID)
- | ((excepts) & FPSCR_STICKY_BITS));
+ u.l[1] = u.l[1] & ~((-(excepts >> (31 - FPSCR_VX) & 1) & FE_ALL_INVALID)
+ | (excepts & FPSCR_STICKY_BITS));
/* Put the new state in effect. */
fesetenv_register (u.fenv);
+
+ /* Success. */
+ return 0;
}
+strong_alias (__feclearexcept, __old_feclearexcept)
+symbol_version (__old_feclearexcept, feclearexcept, GLIBC_2.1);
+default_symbol_version (__feclearexcept, feclearexcept, GLIBC_2.1.3);
diff --git a/sysdeps/powerpc/fegetenv.c b/sysdeps/powerpc/fegetenv.c
deleted file mode 100644
index de778fa..0000000
--- a/sysdeps/powerpc/fegetenv.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Store current floating-point environment.
- Copyright (C) 1997 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <fenv_libc.h>
-
-void
-fegetenv (fenv_t *envp)
-{
- *envp = fegetenv_register ();
-}
diff --git a/sysdeps/powerpc/fegetround.c b/sysdeps/powerpc/fegetround.c
deleted file mode 100644
index 3bb9fb4..0000000
--- a/sysdeps/powerpc/fegetround.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Return current rounding direction.
- Copyright (C) 1997 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <fenv_libc.h>
-
-#undef fegetround
-int
-fegetround (void)
-{
- int result;
- asm ("mcrfs 7,7 ; mfcr %0" : "=r"(result) : : "cr7"); \
- return result & 3;
-}
diff --git a/sysdeps/powerpc/fesetenv.c b/sysdeps/powerpc/fesetenv.c
deleted file mode 100644
index 136a835..0000000
--- a/sysdeps/powerpc/fesetenv.c
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Install given floating-point environment.
- Copyright (C) 1997 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <fenv_libc.h>
-
-void
-fesetenv (const fenv_t *envp)
-{
- fesetenv_register (*envp);
-}
diff --git a/sysdeps/powerpc/fesetround.c b/sysdeps/powerpc/fesetround.c
deleted file mode 100644
index 875c897..0000000
--- a/sysdeps/powerpc/fesetround.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Set current rounding direction.
- Copyright (C) 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <fenv_libc.h>
-
-int
-fesetround (int round)
-{
- fenv_union_t u;
-
- if ((unsigned int) round > 3)
- return 0;
-
- /* Get the current state. */
- u.fenv = fegetenv_register ();
-
- /* Set the relevant bits. */
- u.l[1] = (u.l[1] & ~3) | (round & 3);
-
- /* Put the new state in effect. */
- fesetenv_register (u.fenv);
-
- return 1;
-}
diff --git a/sysdeps/powerpc/feupdateenv.c b/sysdeps/powerpc/feupdateenv.c
deleted file mode 100644
index 14fa6bb..0000000
--- a/sysdeps/powerpc/feupdateenv.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <fenv_libc.h>
-
-void
-feupdateenv (const fenv_t *envp)
-{
- fenv_union_t old, new;
-
- /* Save the currently set exceptions. */
- new.fenv = *envp;
- old.fenv = fegetenv_register ();
-
- /* Copy the set exceptions from `old' to `new'. */
- new.l[1] = (new.l[1] & 0xE00000FF) | (old.l[1] & 0x1FFFFF00);
-
- /* Atomically enable and raise (if appropriate) exceptions set in `new'. */
- fesetenv_register (new.fenv);
-}
diff --git a/sysdeps/powerpc/feholdexcpt.c b/sysdeps/powerpc/fpu/feholdexcpt.c
index a75adbf..a75adbf 100644
--- a/sysdeps/powerpc/feholdexcpt.c
+++ b/sysdeps/powerpc/fpu/feholdexcpt.c
diff --git a/sysdeps/powerpc/fenv_const.c b/sysdeps/powerpc/fpu/fenv_const.c
index 506bd43..506bd43 100644
--- a/sysdeps/powerpc/fenv_const.c
+++ b/sysdeps/powerpc/fpu/fenv_const.c
diff --git a/sysdeps/powerpc/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
index 343be16..343be16 100644
--- a/sysdeps/powerpc/fenv_libc.h
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
diff --git a/sysdeps/powerpc/fgetexcptflg.c b/sysdeps/powerpc/fpu/fgetexcptflg.c
index adbdfe2..280203a 100644
--- a/sysdeps/powerpc/fgetexcptflg.c
+++ b/sysdeps/powerpc/fpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999 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
@@ -19,8 +19,8 @@
#include <fenv_libc.h>
-void
-fegetexceptflag (fexcept_t *flagp, int excepts)
+int
+__fegetexceptflag (fexcept_t *flagp, int excepts)
{
fenv_union_t u;
@@ -29,4 +29,10 @@ fegetexceptflag (fexcept_t *flagp, int excepts)
/* Return (all of) it. */
*flagp = u.l[1];
+
+ /* Success. */
+ return 0;
}
+strong_alias (__fegetexceptflag, __old_fegetexceptflag)
+symbol_version (__old_fegetexceptflag, fegetexceptflag, GLIBC_2.1);
+default_symbol_version (__fegetexceptflag, fegetexceptflag, GLIBC_2.1.3);
diff --git a/sysdeps/powerpc/fraiseexcpt.c b/sysdeps/powerpc/fpu/fraiseexcpt.c
index 39e3fbd..b72f7cb 100644
--- a/sysdeps/powerpc/fraiseexcpt.c
+++ b/sysdeps/powerpc/fpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999 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
@@ -20,8 +20,8 @@
#include <fenv_libc.h>
#undef feraiseexcept
-void
-feraiseexcept (int excepts)
+int
+__feraiseexcept (int excepts)
{
fenv_union_t u;
@@ -50,4 +50,10 @@ feraiseexcept (int excepts)
case and raise FE_INVALID_SNAN instead. */
&& !fetestexcept (FE_INVALID))
set_fpscr_bit (FPSCR_VXSNAN);
+
+ /* Success. */
+ return 0;
}
+strong_alias (__feraiseexcept, __old_feraiseexcept)
+symbol_version (__old_feraiseexcept, feraiseexcept, GLIBC_2.1);
+default_symbol_version (__feraiseexcept, feraiseexcept, GLIBC_2.1.3);
diff --git a/sysdeps/powerpc/fsetexcptflg.c b/sysdeps/powerpc/fpu/fsetexcptflg.c
index 347035e..9ce59ac 100644
--- a/sysdeps/powerpc/fsetexcptflg.c
+++ b/sysdeps/powerpc/fpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999 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
@@ -19,8 +19,8 @@
#include <fenv_libc.h>
-void
-fesetexceptflag (const fexcept_t *flagp, int excepts)
+int
+__fesetexceptflag (const fexcept_t *flagp, int excepts)
{
fenv_union_t u;
fexcept_t flag;
@@ -45,4 +45,10 @@ fesetexceptflag (const fexcept_t *flagp, int excepts)
/* Deal with FE_INVALID_SOFTWARE not being implemented on some chips. */
if (flag & FE_INVALID)
feraiseexcept(FE_INVALID);
+
+ /* Success. */
+ return 0;
}
+strong_alias (__fesetexceptflag, __old_fesetexceptflag)
+symbol_version (__old_fesetexceptflag, fesetexceptflag, GLIBC_2.1);
+default_symbol_version (__fesetexceptflag, fesetexceptflag, GLIBC_2.1.3);
diff --git a/sysdeps/powerpc/ftestexcept.c b/sysdeps/powerpc/ftestexcept.c
deleted file mode 100644
index 6cb8dd5..0000000
--- a/sysdeps/powerpc/ftestexcept.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test exception in current environment.
- Copyright (C) 1997 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
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#include <fenv_libc.h>
-
-int
-fetestexcept (int excepts)
-{
- fenv_union_t u;
-
- /* Get the current state. */
- u.fenv = fegetenv_register ();
-
- /* The FE_INVALID bit is dealt with correctly by the hardware, so we can
- just: */
- return u.l[1] & excepts;
-}