summaryrefslogtreecommitdiff
path: root/sysdeps/powerpc/nofpu
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/nofpu')
-rw-r--r--sysdeps/powerpc/nofpu/Makefile43
-rw-r--r--sysdeps/powerpc/nofpu/atomic-feclearexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/atomic-feholdexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/atomic-feupdateenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fclrexcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fedisblxcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/feenablxcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fegetenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fegetexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/fegetmode.c33
-rw-r--r--sysdeps/powerpc/nofpu/fegetround.c2
-rw-r--r--sysdeps/powerpc/nofpu/feholdexcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fenv_const.c6
-rw-r--r--sysdeps/powerpc/nofpu/fesetenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fesetexcept.c28
-rw-r--r--sysdeps/powerpc/nofpu/fesetmode.c34
-rw-r--r--sysdeps/powerpc/nofpu/fesetround.c2
-rw-r--r--sysdeps/powerpc/nofpu/feupdateenv.c2
-rw-r--r--sysdeps/powerpc/nofpu/fgetexcptflg.c2
-rw-r--r--sysdeps/powerpc/nofpu/flt-rounds.c2
-rw-r--r--sysdeps/powerpc/nofpu/fraiseexcpt.c2
-rw-r--r--sysdeps/powerpc/nofpu/fsetexcptflg.c2
-rw-r--r--sysdeps/powerpc/nofpu/ftestexcept.c2
-rw-r--r--sysdeps/powerpc/nofpu/get-rounding-mode.h2
-rw-r--r--sysdeps/powerpc/nofpu/libm-test-ulps343
-rw-r--r--sysdeps/powerpc/nofpu/libm-test-ulps-name1
-rw-r--r--sysdeps/powerpc/nofpu/sfp-machine.h114
-rw-r--r--sysdeps/powerpc/nofpu/sim-full.c2
-rw-r--r--sysdeps/powerpc/nofpu/soft-supp.h2
-rw-r--r--sysdeps/powerpc/nofpu/sqrtdf2.c53
-rw-r--r--sysdeps/powerpc/nofpu/sqrtsf2.c53
31 files changed, 555 insertions, 195 deletions
diff --git a/sysdeps/powerpc/nofpu/Makefile b/sysdeps/powerpc/nofpu/Makefile
index 99761ef7f0..80c762ebdf 100644
--- a/sysdeps/powerpc/nofpu/Makefile
+++ b/sysdeps/powerpc/nofpu/Makefile
@@ -2,6 +2,7 @@
ifeq ($(subdir),soft-fp)
sysdep_routines += $(gcc-single-routines) $(gcc-double-routines) \
+ sqrtsf2 sqrtdf2 \
sim-full atomic-feholdexcept atomic-feclearexcept \
atomic-feupdateenv flt-rounds
endif
@@ -15,18 +16,38 @@ CPPFLAGS += -I../soft-fp/
# gcc-4.1.1 and may be too late for gcc-4.2. So we need these flags
# until the fix in a gcc release and glibc drops support for earlier
# versions of gcc.
+#
+# This bug can cause wrong signs of zero results from fabsl, and
+# spurious "invalid" exceptions from comparisons with NaN in the
+# default code sequence generated. The fpclassify expansion used by
+# __builtin_fpclassify, which is used in the absence of
+# -fsignaling-nans, uses __builtin_fabsl, and is not affected by
+# -fno-builtin-fabsl, so requiring -fsignaling-nans for some affected
+# source files.
CFLAGS-e_atan2l.c += -fno-builtin-fabsl
CFLAGS-e_hypotl.c += -fno-builtin-fabsl
CFLAGS-e_powl.c += -fno-builtin-fabsl
-CFLAGS-s_ccoshl.c += -fno-builtin-fabsl
-CFLAGS-s_csinhl.c += -fno-builtin-fabsl
-CFLAGS-s_clogl.c += -fno-builtin-fabsl
-CFLAGS-s_clog10l.c += -fno-builtin-fabsl
-CFLAGS-s_csinl.c += -fno-builtin-fabsl
-CFLAGS-s_csqrtl.c += -fno-builtin-fabsl
-CFLAGS-w_acosl.c += -fno-builtin-fabsl
-CFLAGS-w_asinl.c += -fno-builtin-fabsl
-CFLAGS-w_atanhl.c += -fno-builtin-fabsl
-CFLAGS-w_j0l.c += -fno-builtin-fabsl
-CFLAGS-w_j1l.c += -fno-builtin-fabsl
+CFLAGS-s_cacosl.c += -fsignaling-nans
+CFLAGS-s_cacoshl.c += -fsignaling-nans
+CFLAGS-s_casinhl.c += -fsignaling-nans
+CFLAGS-s_catanl.c += -fsignaling-nans
+CFLAGS-s_catanhl.c += -fsignaling-nans
+CFLAGS-s_ccoshl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_cexpl.c += -fsignaling-nans
+CFLAGS-s_csinhl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_clogl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_clog10l.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_csinl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-s_csqrtl.c += -fno-builtin-fabsl -fsignaling-nans
+CFLAGS-w_acosl_compat.c += -fno-builtin-fabsl
+CFLAGS-w_asinl_compat.c += -fno-builtin-fabsl
+CFLAGS-w_atanhl_compat.c += -fno-builtin-fabsl
+CFLAGS-w_j0l_compat.c += -fno-builtin-fabsl
+CFLAGS-w_j1l_compat.c += -fno-builtin-fabsl
+CFLAGS-e_lgammal_r.c += -fno-builtin-fabsl
+CFLAGS-e_log10l.c += -fno-builtin-fabsl
+CFLAGS-e_log2l.c += -fno-builtin-fabsl
+CFLAGS-e_remainderl.c += -fno-builtin-fabsl
+CFLAGS-s_fmaxmagl.c += -fno-builtin-fabsl
+CFLAGS-s_fminmagl.c += -fno-builtin-fabsl
endif
diff --git a/sysdeps/powerpc/nofpu/atomic-feclearexcept.c b/sysdeps/powerpc/nofpu/atomic-feclearexcept.c
index cf1ee9b47a..fd19b69878 100644
--- a/sysdeps/powerpc/nofpu/atomic-feclearexcept.c
+++ b/sysdeps/powerpc/nofpu/atomic-feclearexcept.c
@@ -1,5 +1,5 @@
/* Clear floating-point exceptions for atomic compound assignment.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/nofpu/atomic-feholdexcept.c b/sysdeps/powerpc/nofpu/atomic-feholdexcept.c
index ba3d6878ab..563a0ddf92 100644
--- a/sysdeps/powerpc/nofpu/atomic-feholdexcept.c
+++ b/sysdeps/powerpc/nofpu/atomic-feholdexcept.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment and clear exceptions for
atomic compound assignment.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/nofpu/atomic-feupdateenv.c b/sysdeps/powerpc/nofpu/atomic-feupdateenv.c
index 40ddad213d..46a1763671 100644
--- a/sysdeps/powerpc/nofpu/atomic-feupdateenv.c
+++ b/sysdeps/powerpc/nofpu/atomic-feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions for
atomic compound assignment.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/nofpu/fclrexcpt.c b/sysdeps/powerpc/nofpu/fclrexcpt.c
index 716eb0cce7..1a4c712cd8 100644
--- a/sysdeps/powerpc/nofpu/fclrexcpt.c
+++ b/sysdeps/powerpc/nofpu/fclrexcpt.c
@@ -1,5 +1,5 @@
/* Clear floating-point exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fedisblxcpt.c b/sysdeps/powerpc/nofpu/fedisblxcpt.c
index 5e01bc91d8..abf9e3cc90 100644
--- a/sysdeps/powerpc/nofpu/fedisblxcpt.c
+++ b/sysdeps/powerpc/nofpu/fedisblxcpt.c
@@ -1,5 +1,5 @@
/* Disable exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/feenablxcpt.c b/sysdeps/powerpc/nofpu/feenablxcpt.c
index 81665d49ed..084e69d310 100644
--- a/sysdeps/powerpc/nofpu/feenablxcpt.c
+++ b/sysdeps/powerpc/nofpu/feenablxcpt.c
@@ -1,5 +1,5 @@
/* Enable exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fegetenv.c b/sysdeps/powerpc/nofpu/fegetenv.c
index 03b2d95513..fe96f60acf 100644
--- a/sysdeps/powerpc/nofpu/fegetenv.c
+++ b/sysdeps/powerpc/nofpu/fegetenv.c
@@ -1,5 +1,5 @@
/* Store current floating-point environment (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002, 2010.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fegetexcept.c b/sysdeps/powerpc/nofpu/fegetexcept.c
index 3849a11e15..b5468b5e72 100644
--- a/sysdeps/powerpc/nofpu/fegetexcept.c
+++ b/sysdeps/powerpc/nofpu/fegetexcept.c
@@ -1,5 +1,5 @@
/* Get floating-point exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fegetmode.c b/sysdeps/powerpc/nofpu/fegetmode.c
new file mode 100644
index 0000000000..7c896105d9
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/fegetmode.c
@@ -0,0 +1,33 @@
+/* Store current floating-point control modes. PowerPC soft-float version.
+ Copyright (C) 2016-2018 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 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+fegetmode (femode_t *modep)
+{
+ fenv_union_t u;
+
+ u.l[0] = __sim_round_mode_thread;
+ u.l[1] = __sim_disabled_exceptions_thread;
+
+ *modep = u.fenv;
+
+ return 0;
+}
diff --git a/sysdeps/powerpc/nofpu/fegetround.c b/sysdeps/powerpc/nofpu/fegetround.c
index 69b861d2c8..eb329c97a0 100644
--- a/sysdeps/powerpc/nofpu/fegetround.c
+++ b/sysdeps/powerpc/nofpu/fegetround.c
@@ -1,5 +1,5 @@
/* Return current rounding mode (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/feholdexcpt.c b/sysdeps/powerpc/nofpu/feholdexcpt.c
index bcfd7c4040..40345847f2 100644
--- a/sysdeps/powerpc/nofpu/feholdexcpt.c
+++ b/sysdeps/powerpc/nofpu/feholdexcpt.c
@@ -1,6 +1,6 @@
/* Store current floating-point environment and clear exceptions
(soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fenv_const.c b/sysdeps/powerpc/nofpu/fenv_const.c
index ebf5c68fc5..367fc9e6c7 100644
--- a/sysdeps/powerpc/nofpu/fenv_const.c
+++ b/sysdeps/powerpc/nofpu/fenv_const.c
@@ -1,5 +1,5 @@
/* Constants for fenv_bits.h (soft float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
@@ -25,6 +25,10 @@
const unsigned long long __fe_dfl_env __attribute__ ((aligned (8))) =
0x000000003e000000ULL;
+/* The same representation is used for femode_t. */
+extern const unsigned long long __fe_dfl_mode
+ __attribute__ ((aligned (8), alias ("__fe_dfl_env")));
+
/* Floating-point environment where none of the exceptions are masked. */
const unsigned long long __fe_enabled_env __attribute__ ((aligned (8))) =
0x0000000000000000ULL;
diff --git a/sysdeps/powerpc/nofpu/fesetenv.c b/sysdeps/powerpc/nofpu/fesetenv.c
index 6512da095c..fd7c3b4ed3 100644
--- a/sysdeps/powerpc/nofpu/fesetenv.c
+++ b/sysdeps/powerpc/nofpu/fesetenv.c
@@ -1,5 +1,5 @@
/* Set floating point environment (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fesetexcept.c b/sysdeps/powerpc/nofpu/fesetexcept.c
new file mode 100644
index 0000000000..a3309ec435
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/fesetexcept.c
@@ -0,0 +1,28 @@
+/* Set given exception flags. PowerPC soft-float version.
+ Copyright (C) 2016-2018 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 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-supp.h"
+
+int
+fesetexcept (int excepts)
+{
+ __sim_exceptions_thread |= (excepts & FE_ALL_EXCEPT);
+ SIM_SET_GLOBAL (__sim_exceptions_global, __sim_exceptions_thread);
+
+ return 0;
+}
diff --git a/sysdeps/powerpc/nofpu/fesetmode.c b/sysdeps/powerpc/nofpu/fesetmode.c
new file mode 100644
index 0000000000..88655ee15c
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/fesetmode.c
@@ -0,0 +1,34 @@
+/* Install given floating-point control modes. PowerPC soft-float version.
+ Copyright (C) 2016-2018 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 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "soft-supp.h"
+
+int
+fesetmode (const femode_t *modep)
+{
+ fenv_union_t u;
+
+ u.fenv = *modep;
+ __sim_round_mode_thread = u.l[0];
+ SIM_SET_GLOBAL (__sim_round_mode_global, __sim_round_mode_thread);
+ __sim_disabled_exceptions_thread = u.l[1];
+ SIM_SET_GLOBAL (__sim_disabled_exceptions_global,
+ __sim_disabled_exceptions_thread);
+ return 0;
+}
diff --git a/sysdeps/powerpc/nofpu/fesetround.c b/sysdeps/powerpc/nofpu/fesetround.c
index 5995901e39..75b51aafb1 100644
--- a/sysdeps/powerpc/nofpu/fesetround.c
+++ b/sysdeps/powerpc/nofpu/fesetround.c
@@ -1,5 +1,5 @@
/* Set rounding mode (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/feupdateenv.c b/sysdeps/powerpc/nofpu/feupdateenv.c
index 37a2314c5d..f576a4f4c6 100644
--- a/sysdeps/powerpc/nofpu/feupdateenv.c
+++ b/sysdeps/powerpc/nofpu/feupdateenv.c
@@ -1,6 +1,6 @@
/* Install given floating-point environment and raise exceptions
(soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fgetexcptflg.c b/sysdeps/powerpc/nofpu/fgetexcptflg.c
index 6b02690af2..331b81a643 100644
--- a/sysdeps/powerpc/nofpu/fgetexcptflg.c
+++ b/sysdeps/powerpc/nofpu/fgetexcptflg.c
@@ -1,5 +1,5 @@
/* Store current representation for exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/flt-rounds.c b/sysdeps/powerpc/nofpu/flt-rounds.c
index 23e3648f96..55419e1904 100644
--- a/sysdeps/powerpc/nofpu/flt-rounds.c
+++ b/sysdeps/powerpc/nofpu/flt-rounds.c
@@ -1,5 +1,5 @@
/* Return current rounding mode as correct value for FLT_ROUNDS.
- Copyright (C) 2013-2016 Free Software Foundation, Inc.
+ Copyright (C) 2013-2018 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
diff --git a/sysdeps/powerpc/nofpu/fraiseexcpt.c b/sysdeps/powerpc/nofpu/fraiseexcpt.c
index d0a95d2417..c8a4024425 100644
--- a/sysdeps/powerpc/nofpu/fraiseexcpt.c
+++ b/sysdeps/powerpc/nofpu/fraiseexcpt.c
@@ -1,5 +1,5 @@
/* Raise given exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/fsetexcptflg.c b/sysdeps/powerpc/nofpu/fsetexcptflg.c
index 2e180c82d7..467195d778 100644
--- a/sysdeps/powerpc/nofpu/fsetexcptflg.c
+++ b/sysdeps/powerpc/nofpu/fsetexcptflg.c
@@ -1,5 +1,5 @@
/* Set floating-point environment exception handling (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/ftestexcept.c b/sysdeps/powerpc/nofpu/ftestexcept.c
index 75fd27de0c..4b586a7457 100644
--- a/sysdeps/powerpc/nofpu/ftestexcept.c
+++ b/sysdeps/powerpc/nofpu/ftestexcept.c
@@ -1,5 +1,5 @@
/* Test floating-point exceptions (soft-float edition).
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/get-rounding-mode.h b/sysdeps/powerpc/nofpu/get-rounding-mode.h
index a00cfcfd64..4a59577682 100644
--- a/sysdeps/powerpc/nofpu/get-rounding-mode.h
+++ b/sysdeps/powerpc/nofpu/get-rounding-mode.h
@@ -1,6 +1,6 @@
/* Determine floating-point rounding mode within libc. PowerPC
soft-float version.
- Copyright (C) 2012-2016 Free Software Foundation, Inc.
+ Copyright (C) 2012-2018 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
diff --git a/sysdeps/powerpc/nofpu/libm-test-ulps b/sysdeps/powerpc/nofpu/libm-test-ulps
index 41613421de..6c13a1852c 100644
--- a/sysdeps/powerpc/nofpu/libm-test-ulps
+++ b/sysdeps/powerpc/nofpu/libm-test-ulps
@@ -63,6 +63,10 @@ ifloat: 2
ildouble: 3
ldouble: 4
+Function: "add_ldouble":
+double: 1
+float: 1
+
Function: "asin":
float: 1
ifloat: 1
@@ -250,17 +254,17 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "cacos":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
Function: Real part of "cacos_downward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 6
ldouble: 6
@@ -274,12 +278,12 @@ ildouble: 8
ldouble: 8
Function: Real part of "cacos_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "cacos_towardzero":
double: 5
@@ -298,17 +302,17 @@ ildouble: 4
ldouble: 4
Function: Imaginary part of "cacos_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 13
+ldouble: 13
Function: Real part of "cacosh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
@@ -330,10 +334,10 @@ ildouble: 8
ldouble: 8
Function: Imaginary part of "cacosh_downward":
-double: 2
-float: 2
-idouble: 2
-ifloat: 2
+double: 3
+float: 3
+idouble: 3
+ifloat: 3
ildouble: 6
ldouble: 6
@@ -346,28 +350,28 @@ ildouble: 8
ldouble: 8
Function: Imaginary part of "cacosh_towardzero":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Real part of "cacosh_upward":
double: 4
float: 4
idouble: 4
ifloat: 4
-ildouble: 8
-ldouble: 8
+ildouble: 12
+ldouble: 12
Function: Imaginary part of "cacosh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
-ildouble: 4
-ldouble: 4
+ildouble: 5
+ldouble: 5
Function: "carg":
float: 1
@@ -408,18 +412,18 @@ ildouble: 2
ldouble: 2
Function: Imaginary part of "casin":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
Function: Real part of "casin_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -448,25 +452,25 @@ ildouble: 8
ldouble: 8
Function: Real part of "casin_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
+double: 3
+float: 2
+idouble: 3
+ifloat: 2
ildouble: 6
ldouble: 6
Function: Imaginary part of "casin_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 13
+ldouble: 13
Function: Real part of "casinh":
-double: 1
+double: 2
float: 2
-idouble: 1
+idouble: 2
ifloat: 2
ildouble: 1
ldouble: 1
@@ -489,9 +493,9 @@ ldouble: 8
Function: Imaginary part of "casinh_downward":
double: 3
-float: 1
+float: 2
idouble: 3
-ifloat: 1
+ifloat: 2
ildouble: 3
ldouble: 3
@@ -512,72 +516,76 @@ ildouble: 5
ldouble: 5
Function: Real part of "casinh_upward":
-double: 4
-float: 4
-idouble: 4
-ifloat: 4
-ildouble: 8
-ldouble: 8
+double: 5
+float: 7
+idouble: 5
+ifloat: 7
+ildouble: 13
+ldouble: 13
Function: Imaginary part of "casinh_upward":
-double: 2
+double: 3
float: 2
-idouble: 2
+idouble: 3
ifloat: 2
ildouble: 6
ldouble: 6
Function: Real part of "catan":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "catan":
double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Real part of "catan_downward":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
-ildouble: 5
-ldouble: 5
+ifloat: 2
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "catan_downward":
double: 2
float: 2
idouble: 2
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Real part of "catan_towardzero":
double: 1
-float: 1
+float: 2
idouble: 1
-ifloat: 1
-ildouble: 6
-ldouble: 6
+ifloat: 2
+ildouble: 7
+ldouble: 7
Function: Imaginary part of "catan_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
Function: Real part of "catan_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ildouble: 6
+ldouble: 6
Function: Imaginary part of "catan_upward":
double: 3
@@ -592,14 +600,16 @@ double: 1
float: 1
idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 2
+ldouble: 2
Function: Imaginary part of "catanh":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 1
-ldouble: 1
+ildouble: 3
+ldouble: 3
Function: Real part of "catanh_downward":
double: 2
@@ -614,38 +624,40 @@ double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 5
-ldouble: 5
+ildouble: 6
+ldouble: 6
Function: Real part of "catanh_towardzero":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
-ildouble: 2
-ldouble: 2
+ifloat: 2
+ildouble: 3
+ldouble: 3
Function: Imaginary part of "catanh_towardzero":
double: 1
float: 2
idouble: 1
ifloat: 2
-ildouble: 6
-ldouble: 6
+ildouble: 7
+ldouble: 7
Function: Real part of "catanh_upward":
double: 4
-float: 3
+float: 4
idouble: 4
-ifloat: 3
+ifloat: 4
ildouble: 8
ldouble: 8
Function: Imaginary part of "catanh_upward":
+double: 1
float: 1
+idouble: 1
ifloat: 1
-ildouble: 3
-ldouble: 3
+ildouble: 6
+ldouble: 6
Function: "cbrt":
double: 3
@@ -903,9 +915,9 @@ ldouble: 2
Function: Real part of "clog10_downward":
double: 5
-float: 4
+float: 5
idouble: 5
-ifloat: 4
+ifloat: 5
ildouble: 8
ldouble: 8
@@ -998,7 +1010,9 @@ ildouble: 4
ldouble: 4
Function: "cos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 4
ldouble: 4
@@ -1061,9 +1075,9 @@ ldouble: 2
Function: Real part of "cpow":
double: 2
-float: 4
+float: 5
idouble: 2
-ifloat: 4
+ifloat: 5
ildouble: 4
ldouble: 4
@@ -1317,9 +1331,9 @@ ldouble: 3
Function: Imaginary part of "ctan":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -1333,9 +1347,9 @@ ldouble: 6
Function: Imaginary part of "ctan_downward":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 9
ldouble: 9
@@ -1357,9 +1371,9 @@ ldouble: 13
Function: Real part of "ctan_upward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 7
ldouble: 7
@@ -1373,9 +1387,9 @@ ldouble: 10
Function: Real part of "ctanh":
double: 2
-float: 1
+float: 2
idouble: 2
-ifloat: 1
+ifloat: 2
ildouble: 2
ldouble: 2
@@ -1389,9 +1403,9 @@ ldouble: 3
Function: Real part of "ctanh_downward":
double: 4
-float: 1
+float: 2
idouble: 4
-ifloat: 1
+ifloat: 2
ildouble: 9
ldouble: 9
@@ -1435,6 +1449,9 @@ ifloat: 3
ildouble: 10
ldouble: 10
+Function: "div_ldouble":
+float: 1
+
Function: "erf":
double: 1
float: 1
@@ -1569,19 +1586,25 @@ ldouble: 2
Function: "exp_downward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_towardzero":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
Function: "exp_upward":
double: 1
+float: 1
idouble: 1
+ifloat: 1
ildouble: 1
ldouble: 1
@@ -1662,24 +1685,24 @@ double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 15
+ldouble: 15
Function: "gamma_towardzero":
double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 16
+ldouble: 16
Function: "gamma_upward":
double: 5
float: 5
idouble: 5
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "hypot":
double: 1
@@ -1715,9 +1738,9 @@ ldouble: 2
Function: "j0_downward":
double: 2
-float: 3
+float: 4
idouble: 2
-ifloat: 3
+ifloat: 4
ildouble: 11
ldouble: 11
@@ -1747,9 +1770,9 @@ ldouble: 1
Function: "j1_downward":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 6
ldouble: 6
@@ -1822,24 +1845,24 @@ double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 15
+ldouble: 15
Function: "lgamma_towardzero":
double: 5
float: 4
idouble: 5
ifloat: 4
-ildouble: 14
-ldouble: 14
+ildouble: 16
+ldouble: 16
Function: "lgamma_upward":
double: 5
float: 5
idouble: 5
ifloat: 5
-ildouble: 10
-ldouble: 10
+ildouble: 11
+ldouble: 11
Function: "log":
float: 1
@@ -1963,6 +1986,22 @@ ifloat: 2
ildouble: 1
ldouble: 1
+Function: "mul_downward_ldouble":
+double: 1
+float: 1
+
+Function: "mul_ldouble":
+double: 1
+float: 1
+
+Function: "mul_towardzero_ldouble":
+double: 1
+float: 1
+
+Function: "mul_upward_ldouble":
+double: 1
+float: 1
+
Function: "nextafter_downward":
ildouble: 1
ldouble: 1
@@ -1972,41 +2011,13 @@ ildouble: 1
ldouble: 1
Function: "pow":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
-Function: "pow10":
-double: 2
-idouble: 2
-ildouble: 1
-ldouble: 1
-
-Function: "pow10_downward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 9
-ldouble: 9
-
-Function: "pow10_towardzero":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 9
-ldouble: 9
-
-Function: "pow10_upward":
-double: 2
-float: 1
-idouble: 2
-ifloat: 1
-ildouble: 4
-ldouble: 4
-
Function: "pow_downward":
double: 1
float: 1
@@ -2056,7 +2067,9 @@ ildouble: 1
ldouble: 1
Function: "sin":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2086,7 +2099,9 @@ ildouble: 5
ldouble: 5
Function: "sincos":
+double: 1
float: 1
+idouble: 1
ifloat: 1
ildouble: 1
ldouble: 1
@@ -2163,6 +2178,10 @@ Function: "sqrt_upward":
ildouble: 1
ldouble: 1
+Function: "sub_ldouble":
+double: 1
+float: 1
+
Function: "tan":
float: 1
ifloat: 1
@@ -2267,9 +2286,9 @@ ldouble: 1
Function: "y0_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 10
ldouble: 10
@@ -2283,9 +2302,9 @@ ldouble: 8
Function: "y0_upward":
double: 3
-float: 4
+float: 5
idouble: 3
-ifloat: 4
+ifloat: 5
ildouble: 7
ldouble: 7
@@ -2323,17 +2342,17 @@ ldouble: 9
Function: "yn":
double: 3
-float: 2
+float: 3
idouble: 3
-ifloat: 2
+ifloat: 3
ildouble: 2
ldouble: 2
Function: "yn_downward":
double: 3
-float: 2
+float: 4
idouble: 3
-ifloat: 2
+ifloat: 4
ildouble: 10
ldouble: 10
@@ -2347,9 +2366,9 @@ ldouble: 8
Function: "yn_upward":
double: 4
-float: 4
+float: 5
idouble: 4
-ifloat: 4
+ifloat: 5
ildouble: 5
ldouble: 5
diff --git a/sysdeps/powerpc/nofpu/libm-test-ulps-name b/sysdeps/powerpc/nofpu/libm-test-ulps-name
new file mode 100644
index 0000000000..3ed2c6ec8a
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/libm-test-ulps-name
@@ -0,0 +1 @@
+PowerPC soft-float
diff --git a/sysdeps/powerpc/nofpu/sfp-machine.h b/sysdeps/powerpc/nofpu/sfp-machine.h
new file mode 100644
index 0000000000..d92a90e3e2
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/sfp-machine.h
@@ -0,0 +1,114 @@
+#define _FP_W_TYPE_SIZE 32
+#define _FP_W_TYPE unsigned long
+#define _FP_WS_TYPE signed long
+#define _FP_I_TYPE long
+
+#define _FP_MUL_MEAT_S(R,X,Y) \
+ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_D(R,X,Y) \
+ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
+#define _FP_MUL_MEAT_Q(R,X,Y) \
+ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+
+#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_loop(S,R,X,Y)
+#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
+#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
+
+#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
+#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
+#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
+#define _FP_NANSIGN_S 0
+#define _FP_NANSIGN_D 0
+#define _FP_NANSIGN_Q 0
+
+#define _FP_KEEPNANFRACP 1
+#define _FP_QNANNEGATEDP 0
+
+/* Someone please check this. */
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do { \
+ if ((_FP_FRAC_HIGH_RAW_##fs(X) & _FP_QNANBIT_##fs) \
+ && !(_FP_FRAC_HIGH_RAW_##fs(Y) & _FP_QNANBIT_##fs)) \
+ { \
+ R##_s = Y##_s; \
+ _FP_FRAC_COPY_##wc(R,Y); \
+ } \
+ else \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc(R,X); \
+ } \
+ R##_c = FP_CLS_NAN; \
+ } while (0)
+
+#define _FP_TININESS_AFTER_ROUNDING 0
+
+#if defined __NO_FPRS__ && !defined _SOFT_FLOAT
+
+/* Exception flags. We use the bit positions of the appropriate bits
+ in the FPEFSCR. */
+
+# include <fenv_libc.h>
+# include <sysdep.h>
+# include <sys/prctl.h>
+
+int __feraiseexcept_soft (int);
+libc_hidden_proto (__feraiseexcept_soft)
+
+# define FP_EX_INEXACT SPEFSCR_FINXS
+# define FP_EX_INVALID SPEFSCR_FINVS
+# define FP_EX_DIVZERO SPEFSCR_FDBZS
+# define FP_EX_UNDERFLOW SPEFSCR_FUNFS
+# define FP_EX_OVERFLOW SPEFSCR_FOVFS
+
+# define _FP_DECL_EX \
+ int _spefscr __attribute__ ((unused)), _ftrapex __attribute__ ((unused)) = 0
+# define FP_INIT_ROUNDMODE \
+ do \
+ { \
+ int _r; \
+ INTERNAL_SYSCALL_DECL (_err); \
+ \
+ _spefscr = fegetenv_register (); \
+ _r = INTERNAL_SYSCALL (prctl, _err, 2, PR_GET_FPEXC, &_ftrapex); \
+ if (INTERNAL_SYSCALL_ERROR_P (_r, _err)) \
+ _ftrapex = 0; \
+ } \
+ while (0)
+# define FP_INIT_EXCEPTIONS /* Empty. */
+
+# define FP_HANDLE_EXCEPTIONS __feraiseexcept_soft (_fex)
+# define FP_ROUNDMODE (_spefscr & 0x3)
+
+/* Not correct in general, but sufficient for the uses in soft-fp. */
+# define FP_TRAPPING_EXCEPTIONS (_ftrapex & PR_FP_EXC_UND \
+ ? FP_EX_UNDERFLOW \
+ : 0)
+
+#else
+
+/* Exception flags. We use the bit positions of the appropriate bits
+ in the FPSCR, which also correspond to the FE_* bits. This makes
+ everything easier ;-). */
+# define FP_EX_INVALID (1 << (31 - 2))
+# define FP_EX_OVERFLOW (1 << (31 - 3))
+# define FP_EX_UNDERFLOW (1 << (31 - 4))
+# define FP_EX_DIVZERO (1 << (31 - 5))
+# define FP_EX_INEXACT (1 << (31 - 6))
+
+# define FP_HANDLE_EXCEPTIONS __simulate_exceptions (_fex)
+# define FP_ROUNDMODE __sim_round_mode_thread
+# define FP_TRAPPING_EXCEPTIONS \
+ (~__sim_disabled_exceptions_thread & 0x3e000000)
+
+#endif
+
+extern __thread int __sim_exceptions_thread attribute_tls_model_ie;
+libc_hidden_tls_proto (__sim_exceptions_thread, tls_model ("initial-exec"));
+extern __thread int __sim_disabled_exceptions_thread attribute_tls_model_ie;
+libc_hidden_tls_proto (__sim_disabled_exceptions_thread,
+ tls_model ("initial-exec"));
+extern __thread int __sim_round_mode_thread attribute_tls_model_ie;
+libc_hidden_tls_proto (__sim_round_mode_thread, tls_model ("initial-exec"));
+
+extern void __simulate_exceptions (int x) attribute_hidden;
diff --git a/sysdeps/powerpc/nofpu/sim-full.c b/sysdeps/powerpc/nofpu/sim-full.c
index e8b9b32b17..223bf488f2 100644
--- a/sysdeps/powerpc/nofpu/sim-full.c
+++ b/sysdeps/powerpc/nofpu/sim-full.c
@@ -1,5 +1,5 @@
/* Software floating-point exception handling emulation.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/soft-supp.h b/sysdeps/powerpc/nofpu/soft-supp.h
index 24d238f28d..12af14f42c 100644
--- a/sysdeps/powerpc/nofpu/soft-supp.h
+++ b/sysdeps/powerpc/nofpu/soft-supp.h
@@ -1,5 +1,5 @@
/* Internal support stuff for complete soft float.
- Copyright (C) 2002-2016 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
Contributed by Aldy Hernandez <aldyh@redhat.com>, 2002.
This file is part of the GNU C Library.
diff --git a/sysdeps/powerpc/nofpu/sqrtdf2.c b/sysdeps/powerpc/nofpu/sqrtdf2.c
new file mode 100644
index 0000000000..50d1d26ceb
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/sqrtdf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Return sqrt(a)
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "double.h"
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_28)
+DFtype
+__sqrtdf2 (DFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_D (A);
+ FP_DECL_D (R);
+ DFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_D (A, a);
+ FP_SQRT_D (R, A);
+ FP_PACK_D (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+compat_symbol (libc, __sqrtdf2, __sqrtdf2, GLIBC_2_3_2);
+#endif
diff --git a/sysdeps/powerpc/nofpu/sqrtsf2.c b/sysdeps/powerpc/nofpu/sqrtsf2.c
new file mode 100644
index 0000000000..8684f9631b
--- /dev/null
+++ b/sysdeps/powerpc/nofpu/sqrtsf2.c
@@ -0,0 +1,53 @@
+/* Software floating-point emulation.
+ Return sqrt(a)
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Richard Henderson (rth@cygnus.com) and
+ Jakub Jelinek (jj@ultra.linux.cz).
+
+ 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.
+
+ In addition to the permissions in the GNU Lesser General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file into
+ combinations with other programs, and to distribute those
+ combinations without any restriction coming from the use of this
+ file. (The Lesser General Public License restrictions do apply in
+ other respects; for example, they cover modification of the file,
+ and distribution when not linked into a combine executable.)
+
+ 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, see
+ <http://www.gnu.org/licenses/>. */
+
+#include "soft-fp.h"
+#include "single.h"
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_3_2, GLIBC_2_28)
+SFtype
+__sqrtsf2 (SFtype a)
+{
+ FP_DECL_EX;
+ FP_DECL_S (A);
+ FP_DECL_S (R);
+ SFtype r;
+
+ FP_INIT_ROUNDMODE;
+ FP_UNPACK_S (A, a);
+ FP_SQRT_S (R, A);
+ FP_PACK_S (r, R);
+ FP_HANDLE_EXCEPTIONS;
+
+ return r;
+}
+compat_symbol (libc, __sqrtsf2, __sqrtsf2, GLIBC_2_3_2);
+#endif