aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-10-17 23:16:26 +0000
committerUlrich Drepper <drepper@redhat.com>2002-10-17 23:16:26 +0000
commit1a8aaf919dfdacf7fd31be9cb36cad8cb9875f0f (patch)
tree7e9fd4c5c9155c18614bf5c953191cd2c4b4f3ca /sysdeps
parentb51b47f4ec6708735abd90c38f8725421d4224e2 (diff)
downloadglibc-1a8aaf919dfdacf7fd31be9cb36cad8cb9875f0f.tar.xz
glibc-1a8aaf919dfdacf7fd31be9cb36cad8cb9875f0f.zip
Update.
2002-10-08 Richard Henderson <rth@redhat.com> * soft-fp/op-4.h: Handle carry correctly in __FP_FRAC_ADD_3, __FP_FRAC_ADD_4, __FP_FRAC_SUB_3, __FP_FRAC_SUB_4, __FP_FRAC_DEC_3, __FP_FRAC_DEC_4. * soft-fp/op-common.h: New macros _FP_DIV_MEAT_N_loop. 2002-10-08 Aldy Hernandez <aldyh@redhat.com> * configure.in: Compute completely-soft. * config.make.in: Make completely-soft available to sub-makes. * sysdeps/powerpc/soft-fp/Makefile: Add gcc-single-routines and gcc-double-routines. Add sim-full.c. Add fenv_const and fe_nomask to libm-support. * sysdeps/powerpc/soft-fp/sim-full.c: New file. * sysdeps/powerpc/soft-fp/fraiseexcpt.c: New file. * sysdeps/powerpc/soft-fp/fegetexcept.c: New file. * sysdeps/powerpc/soft-fp/fclrexcpt.c: New file. * sysdeps/powerpc/soft-fp/ftestexcept.c: New file. * sysdeps/powerpc/soft-fp/fgetexcptflg.c: New file. * sysdeps/powerpc/soft-fp/fsetexcptflg.c: New file. * sysdeps/powerpc/soft-fp/fedisblxcpt.c: New file. * sysdeps/powerpc/soft-fp/feenablxcpt.c: New file. * sysdeps/powerpc/soft-fp/fegetenv.c: New file. * sysdeps/powerpc/soft-fp/fesetenv.c: New file. * sysdeps/powerpc/soft-fp/fegetround.c: New file. * sysdeps/powerpc/soft-fp/fesetround.c: New file. * sysdeps/powerpc/soft-fp/feupdateenv.c: New file. * sysdeps/powerpc/soft-fp/feholdexcpt.c: New file. * sysdeps/powerpc/soft-fp/fenv_const.c: New file. * sysdeps/powerpc/soft-fp/libm-test-ulps: New file. * sysdeps/powerpc/soft-fp/Versions: Add libgcc soft-float symbols. Add __sim_disabled_exceptions, __sim_exceptions, __sim_round_mode. * sysdeps/powerpc/soft-float/Dist: Add sim-full.c, fenv_const.c. * sysdeps/powerpc/soft-float/sfp-machine.h: Define FP_HANDLE_EXCEPTIONS. Define FP_ROUNDMODE. Redefine FP_* macros to correspond to the FE_* bit positions. Define FP_DIV_MEAT_S to _FP_DIV_MEAT_1_loop. Define externs for __sim_exceptions, __sim_disabled_exceptions, __sim_round_mode, __simulate_exceptions. * sysdeps/powerpc/fpu/bits/fenv.h: Move file from here... * sysdeps/powerpc/bits/fenv.h: ...to here. 2002-10-06 Jakub Jelinek <jakub@redhat.com> * sysdeps/powerpc/powerpc32/dl-machine.c (__process_machine_rela): Store R_PPC_UADDR32 and R_PPC_UADDR16 one byte at a time. Use __builtin_expect for R_PPC_ADDR24 overflow check. Fix R_PPC_ADDR16, R_PPC_UADDR16 and R_PPC_ADDR14* overflow check, use __builtin_expect.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/powerpc/bits/fenv.h (renamed from sysdeps/powerpc/fpu/bits/fenv.h)0
-rw-r--r--sysdeps/powerpc/soft-fp/Dist2
-rw-r--r--sysdeps/powerpc/soft-fp/Makefile6
-rw-r--r--sysdeps/powerpc/soft-fp/Versions10
-rw-r--r--sysdeps/powerpc/soft-fp/fclrexcpt.c37
-rw-r--r--sysdeps/powerpc/soft-fp/fedisblxcpt.c33
-rw-r--r--sysdeps/powerpc/soft-fp/feenablxcpt.c33
-rw-r--r--sysdeps/powerpc/soft-fp/fegetenv.c49
-rw-r--r--sysdeps/powerpc/soft-fp/fegetexcept.c28
-rw-r--r--sysdeps/powerpc/soft-fp/fegetround.c29
-rw-r--r--sysdeps/powerpc/soft-fp/feholdexcpt.c43
-rw-r--r--sysdeps/powerpc/soft-fp/fenv_const.c35
-rw-r--r--sysdeps/powerpc/soft-fp/fesetenv.c48
-rw-r--r--sysdeps/powerpc/soft-fp/fesetround.c33
-rw-r--r--sysdeps/powerpc/soft-fp/feupdateenv.c50
-rw-r--r--sysdeps/powerpc/soft-fp/fgetexcptflg.c38
-rw-r--r--sysdeps/powerpc/soft-fp/fraiseexcpt.c46
-rw-r--r--sysdeps/powerpc/soft-fp/fsetexcptflg.c40
-rw-r--r--sysdeps/powerpc/soft-fp/ftestexcept.c28
-rw-r--r--sysdeps/powerpc/soft-fp/libm-test-ulps890
-rw-r--r--sysdeps/powerpc/soft-fp/sfp-machine.h24
-rw-r--r--sysdeps/powerpc/soft-fp/sim-full.c42
22 files changed, 1537 insertions, 7 deletions
diff --git a/sysdeps/powerpc/fpu/bits/fenv.h b/sysdeps/powerpc/bits/fenv.h
index 8509b4b0c3..8509b4b0c3 100644
--- a/sysdeps/powerpc/fpu/bits/fenv.h
+++ b/sysdeps/powerpc/bits/fenv.h
diff --git a/sysdeps/powerpc/soft-fp/Dist b/sysdeps/powerpc/soft-fp/Dist
index a917524129..9e4152a77f 100644
--- a/sysdeps/powerpc/soft-fp/Dist
+++ b/sysdeps/powerpc/soft-fp/Dist
@@ -25,4 +25,6 @@ q_sub.c
q_ulltoq.c
q_util.c
q_utoq.c
+sim-full.c
+fenv_const.c
sfp-machine.h
diff --git a/sysdeps/powerpc/soft-fp/Makefile b/sysdeps/powerpc/soft-fp/Makefile
index ff0a19119a..cc60865a53 100644
--- a/sysdeps/powerpc/soft-fp/Makefile
+++ b/sysdeps/powerpc/soft-fp/Makefile
@@ -22,6 +22,9 @@
# 02111-1307 USA.
ifeq ($(subdir),soft-fp)
+ifeq ($(completely-soft),yes)
+sysdep_routines += $(gcc-single-routines) $(gcc-double-routines) sim-full
+endif
ifeq ($(sizeof-long-double),16)
powerpc-quad-routines := q_add q_cmp q_cmpe q_div q_dtoq q_feq q_fge \
q_fgt q_fle q_flt q_fne q_itoq q_mul q_neg q_qtod q_qtoi \
@@ -32,5 +35,8 @@ endif
endif
ifeq ($(subdir),math)
+ifeq ($(completely-soft),yes)
+libm-support += fenv_const fe_nomask
+endif
CPPFLAGS += -I../soft-fp/
endif
diff --git a/sysdeps/powerpc/soft-fp/Versions b/sysdeps/powerpc/soft-fp/Versions
index 5e403d5a72..4a3cbee037 100644
--- a/sysdeps/powerpc/soft-fp/Versions
+++ b/sysdeps/powerpc/soft-fp/Versions
@@ -1,5 +1,15 @@
libc {
GLIBC_2.2 {
+ __sim_exceptions; __sim_disabled_exceptions; __sim_round_mode;
+ __adddf3; __addsf3; __divdf3; __divsf3; __eqdf2; __eqsf2;
+ __extendsfdf2; __fixdfdi; __fixdfsi; __fixsfdi; __fixsfsi;
+ __fixtfdi; __fixtfsi;
+ __fixunsdfdi; __fixunsdfsi; __fixunssfdi; __fixunssfsi;
+ __floatdidf; __floatdisf; __floatsidf; __floatsisf;
+ __gedf2; __gesf2; __ledf2; __lesf2; __muldf3; __mulsf3;
+ __negdf2; __negsf2; __sqrtdf2; __sqrtsf2; __subdf3;
+ __subsf3; __truncdfsf2; __trunctfsf2;
+
_q_add; _q_cmp; _q_cmpe; _q_div; _q_dtoq; _q_feq; _q_fge; _q_fgt;
_q_fle; _q_flt; _q_fne; _q_itoq; _q_mul; _q_neg; _q_qtod; _q_qtoi;
_q_qtos; _q_qtou; _q_sqrt; _q_stoq; _q_sub;
diff --git a/sysdeps/powerpc/soft-fp/fclrexcpt.c b/sysdeps/powerpc/soft-fp/fclrexcpt.c
new file mode 100644
index 0000000000..16e96baeaf
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fclrexcpt.c
@@ -0,0 +1,37 @@
+/* Clear floating-point exceptions (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+__feclearexcept (int x)
+{
+ __sim_exceptions &= ~x;
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__feclearexcept, __old_feclearexcept)
+compat_symbol (libm, __old_feclearexcept, feclearexcept, GLIBC_2_1);
+#endif
+
+versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2);
diff --git a/sysdeps/powerpc/soft-fp/fedisblxcpt.c b/sysdeps/powerpc/soft-fp/fedisblxcpt.c
new file mode 100644
index 0000000000..3d8dd4462f
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fedisblxcpt.c
@@ -0,0 +1,33 @@
+/* Disable exceptions (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+#include <fenv.h>
+
+int
+fedisableexcept (int x)
+{
+ int old_exceptions = ~__sim_disabled_exceptions & FE_ALL_EXCEPT;
+
+ __sim_disabled_exceptions |= x;
+
+ return old_exceptions;
+}
diff --git a/sysdeps/powerpc/soft-fp/feenablxcpt.c b/sysdeps/powerpc/soft-fp/feenablxcpt.c
new file mode 100644
index 0000000000..060e450590
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/feenablxcpt.c
@@ -0,0 +1,33 @@
+/* Enable exceptions (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <fenv.h>
+
+extern int __sim_disabled_exceptions;
+
+int
+feenableexcept (int exceptions)
+{
+ int old_exceptions = ~__sim_disabled_exceptions & FE_ALL_EXCEPT;
+
+ __sim_disabled_exceptions &= ~exceptions;
+
+ return old_exceptions;
+}
diff --git a/sysdeps/powerpc/soft-fp/fegetenv.c b/sysdeps/powerpc/soft-fp/fegetenv.c
new file mode 100644
index 0000000000..3cc8b13dac
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fegetenv.c
@@ -0,0 +1,49 @@
+/* Store current floating-point environment (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+#include <bp-sym.h>
+
+extern int __sim_exceptions;
+extern int __sim_disabled_exceptions;
+extern int __sim_round_mode;
+
+int
+__fegetenv (fenv_t *envp)
+{
+ fenv_union_t u;
+
+ u.l[0] = __sim_exceptions;
+ u.l[0] |= __sim_round_mode;
+ u.l[1] = __sim_disabled_exceptions;
+
+ *envp = u.fenv;
+
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__fegetenv, __old_fegetenv)
+compat_symbol (libm, BP_SYM (__old_fegetenv), BP_SYM (fegetenv), GLIBC_2_1);
+#endif
+
+versioned_symbol (libm, BP_SYM (__fegetenv), BP_SYM (fegetenv), GLIBC_2_2);
diff --git a/sysdeps/powerpc/soft-fp/fegetexcept.c b/sysdeps/powerpc/soft-fp/fegetexcept.c
new file mode 100644
index 0000000000..0a47a09ac0
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fegetexcept.c
@@ -0,0 +1,28 @@
+/* Get floating-point exceptions (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+fegetexcept (void)
+{
+ return (__sim_disabled_exceptions ^ FE_ALL_EXCEPT) & FE_ALL_EXCEPT;
+}
diff --git a/sysdeps/powerpc/soft-fp/fegetround.c b/sysdeps/powerpc/soft-fp/fegetround.c
new file mode 100644
index 0000000000..0d01e4411f
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fegetround.c
@@ -0,0 +1,29 @@
+/* Return current rounding mode (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+#undef fegetround
+int
+fegetround (void)
+{
+ return __sim_round_mode;
+}
diff --git a/sysdeps/powerpc/soft-fp/feholdexcpt.c b/sysdeps/powerpc/soft-fp/feholdexcpt.c
new file mode 100644
index 0000000000..786c691a4b
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/feholdexcpt.c
@@ -0,0 +1,43 @@
+/* Store current floating-point environment and clear exceptions
+ (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+feholdexcept (fenv_t *envp)
+{
+ fenv_union_t u;
+
+ /* Get the current state. */
+ fegetenv (envp);
+
+ u.fenv = *envp;
+ /* Clear everything except the rounding mode. */
+ u.l[0] &= 0x3;
+
+ /* ?? Should we clear the disabled exceptions as well ?? */
+
+ /* Put the new state in effect. */
+ fesetenv (envp);
+
+ return 0;
+}
diff --git a/sysdeps/powerpc/soft-fp/fenv_const.c b/sysdeps/powerpc/soft-fp/fenv_const.c
new file mode 100644
index 0000000000..7dc2e817c8
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fenv_const.c
@@ -0,0 +1,35 @@
+/* Constants for fenv_bits.h (soft float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* We want to specify the bit pattern of the __fe_*_env constants, so
+ pretend they're really `long long' instead of `double'. */
+
+/* If the default argument is used we use this value. Disable all
+ signalling exceptions as default. */
+const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
+0x000000003e000000ULL;
+
+/* Floating-point environment where none of the exceptions are masked. */
+const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
+0xfff80000000000f8ULL;
+
+/* Floating-point environment with the NI bit set. */
+const unsigned long long __fe_nonieee_env __attribute__ ((aligned (8))) =
+0xfff8000000000004ULL;
diff --git a/sysdeps/powerpc/soft-fp/fesetenv.c b/sysdeps/powerpc/soft-fp/fesetenv.c
new file mode 100644
index 0000000000..43d03a45e2
--- /dev/null
+++ b/sysdeps/powerpc/soft-fp/fesetenv.c
@@ -0,0 +1,48 @@
+/* Set floating point environment (soft-float edition).
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
+ 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+#include <bp-sym.h>
+
+extern int __sim_exceptions attribute_hidden;
+extern int __sim_disabled_exceptions attribute_hidden;
+extern int __sim_round_mode attribute_hidden;
+
+int
+__fesetenv (const fenv_t *envp)
+{
+ fenv_union_t u;
+
+ u.fenv = *envp;
+ __sim_exceptions = u.l[0] & FE_ALL_EXCEPT;
+ __sim_round_mode = u.l[0] & 0x3;
+ __sim_disabled_exceptions = u.l[1];
+ return 0;
+}
+
+#include <shlib-compat.h>
+#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
+strong_alias (__fesetenv, __old_fesetenv)
+compat_symbol (libm, BP_SYM (__old_fesetenv), BP_SYM (fesetenv), GLIBC_2_1);
+#endif
+
+libm_hidden_ver (__fesetenv, fesetenv)
+versioned_symbol (libm, BP_SYM (__fesetenv), BP_SYM (fesetenv), GLIBC_2_2);
diff --git a/sysdeps/powerpc/soft-fp/fesetround.c b/sysdeps/powerpc/soft-fp/fesetround.c
new file mode 100644
index 0000000000..842614