]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: trunc/truncf refactor
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 15 Mar 2019 20:37:23 +0000 (20:37 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 9 May 2019 12:39:28 +0000 (09:39 -0300)
This patches consolidates all the powerpc trunc{f} implementations on
the generic sysdeps/powerpc/fpu/s_trunc{f}.  The generic implementation
uses either the compiler builts for ISA 2.03+ (which generates the
frim instruction) or a generic implementation which uses FP only
operations.

The IFUNC organization for powerpc64 is also change to be enabled only
for powerpc64 and not for powerpc64le (since minium ISA of 2.08 does not
require the fallback generic implementation).

Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).

* sysdeps/powerpc/fpu/trunc_to_integer.h (set_fenv_mode): Add
 TRUNC handling.
(round_mode): Add definition for TRUNC.
* sysdeps/powerpc/fpu/s_trunc.c: New file.
* sysdeps/powerpc/fpu/s_truncf.c: New file.
* sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Remove file.
* sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-power5+.S:
Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-ppc32.S:
Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-power5+.S:
Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-ppc32.S:
Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-power5+.c: New
file.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-ppc32.c:
Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-power5+.c:
Likewise.
* sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-ppc32.c:
Likewise.
* sysdep/powerpc/powerpc32/power5+/fpu/s_trunc.S: Remove file.
* sysdep/powerpc/powerpc32/power5+/fpu/s_truncf.S: Likewise.
* sysdep/powerpc/powerpc64/be/fpu/multiarch/Makefile
(libm-sysdep_routines): Add s_trunc-power5+, s_trunc-ppc64,
s_truncf-power5+, and s_truncf-ppc64.
(CFLAGS-s_trunc-power5+.c, CFLAGS-s_truncf-power5+.c): New rule.
* sysdep/powerpc/powercp64/be/fpu/multiarch/s_trunc-power5+.c: New
file.
* sysdep/powerpc/powercp64/be/fpu/multiarch/s_trunc-ppc64.c: Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c: Move to ...
* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc.c: ... here.
* sysdep/powerpc/powercp64/be/fpu/multiarch/s_truncf-power5+.c: New
file.
* sysdep/powerpc/powercp64/be/fpu/multiarch/s_truncf-ppc64.c:
Likewise.
* sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Move to ...
* sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf.c: ... here.
* sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
(libm-sysdep_routines): Remove s_trunc-power5+, s_trunc-ppc64,
s_truncf-power5+, and s_truncf-ppc64.
* sysdep/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S: Remove
file.
* sysdep/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S: Likewise.
* sysdep/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S:
Likewise.
* sysdep/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Likewise.
* sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.
* sysdep/powerpc/powerpc64/power5+/fpu/s_trunc.S: Likewise.
* sysdep/powerpc/powerpc64/power5+/fpu/s_truncf.S: Likewise.

Reviewed-by: Gabriel F. T. Gomes <gabriel@inconstante.eti.br>
33 files changed:
ChangeLog
sysdeps/powerpc/fpu/round_to_integer.h
sysdeps/powerpc/fpu/s_trunc.c [new file with mode: 0644]
sysdeps/powerpc/fpu/s_truncf.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/s_trunc.S [deleted file]
sysdeps/powerpc/powerpc32/fpu/s_truncf.S [deleted file]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S [deleted file]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S [deleted file]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S [deleted file]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S [deleted file]
sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S [deleted file]
sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S [deleted file]
sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf.c
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc-power5+.c [new file with mode: 0644]
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc-ppc64.c [new file with mode: 0644]
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc.c [moved from sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c with 100% similarity]
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf-power5+.c [new file with mode: 0644]
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf-ppc64.c [new file with mode: 0644]
sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf.c [moved from sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c with 95% similarity]
sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S [deleted file]
sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S [deleted file]
sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S [deleted file]
sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S [deleted file]
sysdeps/powerpc/powerpc64/fpu/s_trunc.S [deleted file]
sysdeps/powerpc/powerpc64/fpu/s_truncf.S [deleted file]
sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S [deleted file]
sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S [deleted file]

index e4221474dea8835634b737b14a406edf74215ed9..9a89a443ccb7273352e8d3ddde9f5e7ec7bb6d4c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,59 @@
 2019-05-09  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
+       * sysdeps/powerpc/fpu/trunc_to_integer.h (set_fenv_mode): Add
+        TRUNC handling.
+       (round_mode): Add definition for TRUNC.
+       * sysdeps/powerpc/fpu/s_trunc.c: New file.
+       * sysdeps/powerpc/fpu/s_truncf.c: New file.
+       * sysdeps/powerpc/powerpc32/fpu/s_trunc.S: Remove file.
+       * sysdeps/powerpc/powerpc32/fpu/s_truncf.S: Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-power5+.S:
+       Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-ppc32.S:
+       Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-power5+.S:
+       Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-ppc32.S:
+       Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-power5+.c: New
+       file.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_trunc-ppc32.c:
+       Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-power5+.c:
+       Likewise.
+       * sysdep/powerpc/powepc32/power4/fpu/multiarch/s_truncf-ppc32.c:
+       Likewise.
+       * sysdep/powerpc/powerpc32/power5+/fpu/s_trunc.S: Remove file.
+       * sysdep/powerpc/powerpc32/power5+/fpu/s_truncf.S: Likewise.
+       * sysdep/powerpc/powerpc64/be/fpu/multiarch/Makefile
+       (libm-sysdep_routines): Add s_trunc-power5+, s_trunc-ppc64,
+       s_truncf-power5+, and s_truncf-ppc64.
+       (CFLAGS-s_trunc-power5+.c, CFLAGS-s_truncf-power5+.c): New rule.
+       * sysdep/powerpc/powercp64/be/fpu/multiarch/s_trunc-power5+.c: New
+       file.
+       * sysdep/powerpc/powercp64/be/fpu/multiarch/s_trunc-ppc64.c: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc.c: Move to ...
+       * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc.c: ... here.
+       * sysdep/powerpc/powercp64/be/fpu/multiarch/s_truncf-power5+.c: New
+       file.
+       * sysdep/powerpc/powercp64/be/fpu/multiarch/s_truncf-ppc64.c:
+       Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c: Move to ...
+       * sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf.c: ... here.
+       * sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+       (libm-sysdep_routines): Remove s_trunc-power5+, s_trunc-ppc64,
+       s_truncf-power5+, and s_truncf-ppc64.
+       * sysdep/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S: Remove
+       file.
+       * sysdep/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S: Likewise.
+       * sysdep/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S:
+       Likewise.
+       * sysdep/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_trunc.S: Likewise.
+       * sysdeps/powerpc/powerpc64/fpu/s_truncf.S: Likewise.
+       * sysdep/powerpc/powerpc64/power5+/fpu/s_trunc.S: Likewise.
+       * sysdep/powerpc/powerpc64/power5+/fpu/s_truncf.S: Likewise.
+
        * sysdeps/powerpc/fpu/round_to_integer.h (set_fenv_mode): Add
        ROUND handling.
        (round_mode): Add definition for ROUND.
index b318e371903ace4e80e8d698cd088acc1e9e101b..b29d030e2de0900147eb7b6080c2e7557a495ba5 100644 (file)
@@ -25,7 +25,8 @@ enum round_mode
 {
   CEIL,
   FLOOR,
-  ROUND
+  ROUND,
+  TRUNC
 };
 
 static inline void
@@ -36,6 +37,7 @@ set_fenv_mode (enum round_mode mode)
   {
   case CEIL:  rmode = FE_UPWARD; break;
   case FLOOR: rmode = FE_DOWNWARD; break;
+  case TRUNC:
   case ROUND: rmode = FE_TOWARDZERO; break;
   default:    rmode = FE_TONEAREST; break;
   }
diff --git a/sysdeps/powerpc/fpu/s_trunc.c b/sysdeps/powerpc/fpu/s_trunc.c
new file mode 100644 (file)
index 0000000..83caf6b
--- /dev/null
@@ -0,0 +1,35 @@
+/* Largest integral value not greater than argument.  PowerPC version.
+   Copyright (C) 2019 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, see <http://www.gnu.org/licenses/>.  */
+
+#define NO_MATH_REDIRECT
+#include <math.h>
+#include <libm-alias-double.h>
+#include <round_to_integer.h>
+
+double
+__trunc (double x)
+{
+#ifdef _ARCH_PWR5X
+  return __builtin_trunc (x);
+#else
+  return round_to_integer_double (TRUNC, x);
+#endif
+}
+#ifndef __trunc
+libm_alias_double (__trunc, trunc)
+#endif
diff --git a/sysdeps/powerpc/fpu/s_truncf.c b/sysdeps/powerpc/fpu/s_truncf.c
new file mode 100644 (file)
index 0000000..c9f091c
--- /dev/null
@@ -0,0 +1,35 @@
+/* Smallest integral value not less than argument.  PowerPC version.
+   Copyright (C) 2019 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, see <http://www.gnu.org/licenses/>.  */
+
+#define NO_MATH_REDIRECT
+#include <math.h>
+#include <libm-alias-float.h>
+#include <round_to_integer.h>
+
+float
+__truncf (float x)
+{
+#ifdef _ARCH_PWR5X
+  return __builtin_truncf (x);
+#else
+  return round_to_integer_float (TRUNC, x);
+#endif
+}
+#ifndef __truncf
+libm_alias_float (__trunc, trunc)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/fpu/s_trunc.S
deleted file mode 100644 (file)
index 31daff1..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* trunc function.  PowerPC32 version.
-   Copyright (C) 2004-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-#include <libm-alias-double.h>
-
-       .section        .rodata.cst4,"aM",@progbits,4
-       .align  2
-.LC0:  /* 2**52 */
-       .long 0x59800000
-
-/* double [fp1] trunc (double x [fp1])
-   IEEE 1003.1 trunc function.  IEEE specifies "trunc to the integer
-   value, in floating format, nearest to but no larger in magnitude
-   then the argument."
-   We set "round toward Zero" mode and trunc by adding +-2**52 then
-   subtracting +-2**52.  */
-
-       .section        ".text"
-ENTRY (__trunc)
-#ifdef SHARED
-       mflr    r11
-       cfi_register(lr,r11)
-       SETUP_GOT_ACCESS(r9,got_label)
-       addis   r9,r9,.LC0-got_label@ha
-       lfs     fp13,.LC0-got_label@l(r9)
-       mtlr    r11
-       cfi_same_value (lr)
-#else
-       lis     r9,.LC0@ha
-       lfs     fp13,.LC0@l(r9)
-#endif
-       fabs    fp0,fp1
-       fsub    fp12,fp13,fp13  /* generate 0.0  */
-       fcmpu   cr7,fp0,fp13    /* if (fabs(x) > TWO52)  */
-       mffs    fp11            /* Save current FPU rounding mode and
-                                  "inexact" state.  */
-       fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
-       bnl-    cr7,.L10
-       mtfsfi  7,1             /* Set rounding toward 0 mode.  */
-       ble-    cr6,.L4
-       fadd    fp1,fp1,fp13    /* x+= TWO52;  */
-       fsub    fp1,fp1,fp13    /* x-= TWO52;  */
-       fabs    fp1,fp1         /* if (x == 0.0)  */
-                               /* x = 0.0; */
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L4:
-       bge-    cr6,.L9         /* if (x < 0.0)  */
-       fsub    fp1,fp1,fp13    /* x-= TWO52;  */
-       fadd    fp1,fp1,fp13    /* x+= TWO52;  */
-       fnabs   fp1,fp1         /* if (x == 0.0)  */
-                               /* x = -0.0; */
-.L9:
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L10:
-       /* Ensure sNaN input is converted to qNaN.  */
-       fcmpu   cr7,fp1,fp1
-       beqlr   cr7
-       fadd    fp1,fp1,fp1
-       blr
-       END (__trunc)
-
-libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/fpu/s_truncf.S
deleted file mode 100644 (file)
index 630300c..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/* truncf function.  PowerPC32 version.
-   Copyright (C) 2004-2019 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 <sysdep.h>
-#include <libm-alias-float.h>
-
-       .section        .rodata.cst4,"aM",@progbits,4
-       .align  2
-.LC0:  /* 2**23 */
-       .long 0x4b000000
-
-/* float [fp1] truncf (float x [fp1])
-   IEEE 1003.1 trunc function.  IEEE specifies "trunc to the integer
-   value, in floating format, nearest to but no larger in magnitude
-   then the argument."
-   We set "round toward Zero" mode and trunc by adding +-2**23 then
-   subtracting +-2**23.  */
-
-       .section        ".text"
-ENTRY (__truncf)
-#ifdef SHARED
-       mflr    r11
-       cfi_register(lr,r11)
-       SETUP_GOT_ACCESS(r9,got_label)
-       addis   r9,r9,.LC0-got_label@ha
-       lfs     fp13,.LC0-got_label@l(r9)
-       mtlr    r11
-       cfi_same_value (lr)
-#else
-       lis     r9,.LC0@ha
-       lfs     fp13,.LC0@l(r9)
-#endif
-       fabs    fp0,fp1
-       fsubs   fp12,fp13,fp13  /* generate 0.0  */
-       fcmpu   cr7,fp0,fp13    /* if (fabs(x) > TWO23)  */
-       mffs    fp11            /* Save current FPU rounding mode and
-                                  "inexact" state.  */
-       fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
-       bnl-    cr7,.L10
-       mtfsfi  7,1             /* Set rounding toward 0 mode.  */
-       ble-    cr6,.L4
-       fadds   fp1,fp1,fp13    /* x+= TWO23;  */
-       fsubs   fp1,fp1,fp13    /* x-= TWO23;  */
-       fabs    fp1,fp1         /* if (x == 0.0)  */
-                               /* x = 0.0; */
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L4:
-       bge-    cr6,.L9         /* if (x < 0.0)  */
-       fsubs   fp1,fp1,fp13    /* x-= TWO23;  */
-       fadds   fp1,fp1,fp13    /* x+= TWO23;  */
-       fnabs   fp1,fp1         /* if (x == 0.0)  */
-                               /* x = -0.0; */
-.L9:
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L10:
-       /* Ensure sNaN input is converted to qNaN.  */
-       fcmpu   cr7,fp1,fp1
-       beqlr   cr7
-       fadds   fp1,fp1,fp1
-       blr
-       END (__truncf)
-
-libm_alias_float (__trunc, trunc)
-
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.S
deleted file mode 100644 (file)
index 3ed99c3..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* trunc function.  PowerPC32/power5+ version.
-   Copyright (C) 2013-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef hidden_def
-#define hidden_def(name)
-#undef weak_alias
-#define weak_alias(name, alias)
-#undef strong_alias
-#define strong_alias(name, alias)
-#undef compat_symbol
-#define compat_symbol(lib, name, alias, ver)
-
-#define __trunc __trunc_power5plus
-
-#include <sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-power5+.c
new file mode 100644 (file)
index 0000000..47abda6
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __trunc __trunc_power5plus
+#include <sysdeps/powerpc/fpu/s_trunc.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.S
deleted file mode 100644 (file)
index 67b87c5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* trunc function.  PowerPC32 default version.
-   Copyright (C) 2013-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
-
-#define __trunc __trunc_ppc32
-
-#include <sysdeps/powerpc/powerpc32/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_trunc-ppc32.c
new file mode 100644 (file)
index 0000000..5b91642
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __trunc __trunc_ppc32
+#include <sysdeps/powerpc/fpu/s_trunc.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.S
deleted file mode 100644 (file)
index a18af56..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* truncf function.  PowerPC32/power5+ version.
-   Copyright (C) 2013-2019 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 <sysdep.h>
-
-#undef weak_alias
-#define weak_alias(name, alias)
-
-#define __truncf __truncf_power5plus
-
-#include <sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-power5+.c
new file mode 100644 (file)
index 0000000..b8e75d4
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __truncf __truncf_power5plus
+#include <sysdeps/powerpc/fpu/s_truncf.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.S
deleted file mode 100644 (file)
index a7bf394..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* truncf function.  PowerPC32 default version.
-   Copyright (C) 2013-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-
-#define __truncf __truncf_ppc32
-
-#include <sysdeps/powerpc/powerpc32/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.c b/sysdeps/powerpc/powerpc32/power4/fpu/multiarch/s_truncf-ppc32.c
new file mode 100644 (file)
index 0000000..f20c825
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __truncf __truncf_ppc32
+#include <sysdeps/powerpc/fpu/s_truncf.c>
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_trunc.S
deleted file mode 100644 (file)
index 37a2410..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/* trunc function.  PowerPC32/power5+ version.
-   Copyright (C) 2006-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-#include <libm-alias-double.h>
-
-       .machine        "power5"
-EALIGN (__trunc, 4, 0)
-       friz    fp1, fp1
-       blr
-       END (__trunc)
-
-libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc32/power5+/fpu/s_truncf.S
deleted file mode 100644 (file)
index f24c1f6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* truncf function.  PowerPC32/power5+ version.
-   Copyright (C) 2006-2019 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 <sysdep.h>
-#include <libm-alias-float.h>
-
-       .machine        "power5"
-EALIGN (__truncf, 4, 0)
-       friz    fp1, fp1        /* The rounding instructions are double.  */
-       frsp    fp1, fp1        /* But we need to set ooverflow for float.  */
-       blr
-       END (__truncf)
-
-libm_alias_float (__trunc, trunc)
-
index 722f974cfb1074d9f1db7834cf83c85499ec2665..53e600f5f68a5a2411ea5946c59527b8df32f1e8 100644 (file)
@@ -10,7 +10,11 @@ libm-sysdep_routines += s_ceil-power5+ \
                        s_round-power5+ \
                        s_round-ppc64 \
                        s_roundf-power5+ \
-                       s_roundf-ppc64
+                       s_roundf-ppc64 \
+                       s_trunc-power5+ \
+                       s_trunc-ppc64 \
+                       s_truncf-power5+ \
+                       s_truncf-ppc64
 
 CFLAGS-s_ceil-power5+.c = -mcpu=power5+
 CFLAGS-s_ceilf-power5+.c = -mcpu=power5+
@@ -18,4 +22,6 @@ CFLAGS-s_floor-power5+.c = -mcpu=power5+
 CFLAGS-s_floorf-power5+.c = -mcpu=power5+
 CFLAGS-s_round-power5+.c = -mcpu=power5+
 CFLAGS-s_roundf-power5+.c = -mcpu=power5+
+CFLAGS-s_trunc-power5+.c = -mcpu=power5+
+CFLAGS-s_truncf-power5+.c = -mcpu=power5+
 endif
index 640bca5a7abc929bdb3f86debf1c636da58e0cbb..db6a17c5b2029500bc38698f7fd7f4d37fa7b558 100644 (file)
@@ -18,8 +18,6 @@
 
 #define NO_MATH_REDIRECT
 #include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
 #include "init-arch.h"
 #include <libm-alias-float.h>
 
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc-power5+.c
new file mode 100644 (file)
index 0000000..47abda6
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __trunc __trunc_power5plus
+#include <sysdeps/powerpc/fpu/s_trunc.c>
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_trunc-ppc64.c
new file mode 100644 (file)
index 0000000..21c4730
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __trunc __trunc_ppc64
+#include <sysdeps/powerpc/fpu/s_trunc.c>
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf-power5+.c
new file mode 100644 (file)
index 0000000..b8e75d4
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __truncf __truncf_power5plus
+#include <sysdeps/powerpc/fpu/s_truncf.c>
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf-ppc64.c
new file mode 100644 (file)
index 0000000..aa6c6c1
--- /dev/null
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __truncf __truncf_ppc64
+#include <sysdeps/powerpc/fpu/s_truncf.c>
similarity index 95%
rename from sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf.c
rename to sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_truncf.c
index be124b2023e6f3d4ff59ea28c512c7c8d084567c..b6c8260b69b295ed9e5964fc9b87b10458c7ff1d 100644 (file)
@@ -18,8 +18,6 @@
 
 #define NO_MATH_REDIRECT
 #include <math.h>
-#include <math_ldbl_opt.h>
-#include <shlib-compat.h>
 #include "init-arch.h"
 #include <libm-alias-float.h>
 
index 11c39f4b352da4f9e5f7a0b84fb672087af93f6f..7d469d79afb7aea53908d6383e984b81fc2634a1 100644 (file)
@@ -15,8 +15,6 @@ sysdep_calls := s_copysign-power6 s_copysign-ppc64 \
 sysdep_routines += $(sysdep_calls)
 libm-sysdep_routines += s_llround-power6x \
                        s_llround-power5+ s_llround-ppc64 \
-                       s_trunc-power5+ \
-                       s_trunc-ppc64 s_truncf-power5+ s_truncf-ppc64 \
                        s_llrint-power6x s_llrint-ppc64 \
                        s_logb-power7 s_logbf-power7 \
                        s_logbl-power7 s_logb-ppc64 s_logbf-ppc64 \
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-power5+.S
deleted file mode 100644 (file)
index 9ce3db4..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* trunc function.  PowerPC64/power5+ version.
-   Copyright (C) 2013-2019 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 <shlib-compat.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
-
-#define __trunc __trunc_power5plus
-
-#include <sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_trunc-ppc64.S
deleted file mode 100644 (file)
index ca9d831..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* trunc function.  PowerPC64 default version.
-   Copyright (C) 2013-2019 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 <shlib-compat.h>
-
-#undef weak_alias
-#define weak_alias(a,b)
-#undef strong_alias
-#define strong_alias(a,b)
-#undef compat_symbol
-#define compat_symbol(a,b,c,d)
-
-#define __trunc __trunc_ppc64
-
-#include <sysdeps/powerpc/powerpc64/fpu/s_trunc.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-power5+.S
deleted file mode 100644 (file)
index 4e65117..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* truncf function.  PowerPC64/power5+ version.
-   Copyright (C) 2013-2019 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/>.  */
-
-#undef weak_alias
-#define weak_alias(a,b)
-
-#define __truncf __truncf_power5plus
-
-#include <sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_truncf-ppc64.S
deleted file mode 100644 (file)
index 5420eb2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* truncf function.  PowerPC64 default version.
-   Copyright (C) 2013-2019 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/>.  */
-
-#undef weak_alias
-#define weak_alias(a,b)
-
-#define __truncf __truncf_ppc64
-
-#include <sysdeps/powerpc/powerpc64/fpu/s_truncf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/fpu/s_trunc.S
deleted file mode 100644 (file)
index 628960d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/* trunc function.  PowerPC64 version.
-   Copyright (C) 2004-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-#include <libm-alias-double.h>
-
-       .section        ".toc","aw"
-.LC0:  /* 2**52 */
-       .tc FD_43300000_0[TC],0x4330000000000000
-       .section        ".text"
-
-/* double [fp1] trunc (double x [fp1])
-   IEEE 1003.1 trunc function.  IEEE specifies "trunc to the integer
-   value, in floating format, nearest to but no larger in magnitude
-   then the argument."
-   We set "round toward Zero" mode and trunc by adding +-2**52 then
-   subtracting +-2**52.  */
-
-ENTRY (__trunc, 4)
-       CALL_MCOUNT 0
-       lfd     fp13,.LC0@toc(2)
-       fabs    fp0,fp1
-       fsub    fp12,fp13,fp13  /* generate 0.0  */
-       fcmpu   cr7,fp0,fp13    /* if (fabs(x) > TWO52)  */
-       mffs    fp11            /* Save current FPU rounding mode and
-                                  "inexact" state.  */
-       fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
-       bnl-    cr7,.L10
-       mtfsfi  7,1             /* Set rounding toward 0 mode.  */
-       ble-    cr6,.L4
-       fadd    fp1,fp1,fp13    /* x+= TWO52;  */
-       fsub    fp1,fp1,fp13    /* x-= TWO52;  */
-       fabs    fp1,fp1         /* if (x == 0.0)  */
-                               /* x = 0.0; */
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L4:
-       bge-    cr6,.L9         /* if (x < 0.0)  */
-       fsub    fp1,fp1,fp13    /* x-= TWO52;  */
-       fadd    fp1,fp1,fp13    /* x+= TWO52;  */
-       fnabs   fp1,fp1         /* if (x == 0.0)  */
-                               /* x = -0.0; */
-.L9:
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L10:
-       /* Ensure sNaN input is converted to qNaN.  */
-       fcmpu   cr7,fp1,fp1
-       beqlr   cr7
-       fadd    fp1,fp1,fp1
-       blr
-       END (__trunc)
-
-libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
deleted file mode 100644 (file)
index 7b92945..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* truncf function.  PowerPC64 version.
-   Copyright (C) 2004-2019 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 <sysdep.h>
-#include <libm-alias-float.h>
-
-       .section        ".toc","aw"
-       .p2align 3
-.LC0:  /* 2**23 */
-       .long 0x4b000000
-       .long 0x0
-       .section        ".text"
-
-/* float [fp1] truncf (float x [fp1])
-   IEEE 1003.1 trunc function.  IEEE specifies "trunc to the integer
-   value, in floating format, nearest to but no larger in magnitude
-   then the argument."
-   We set "round toward Zero" mode and trunc by adding +-2**23 then
-   subtracting +-2**23.  */
-
-ENTRY (__truncf, 4)
-       CALL_MCOUNT 0
-       lfs     fp13,.LC0@toc(2)
-       fabs    fp0,fp1
-       fsubs   fp12,fp13,fp13  /* generate 0.0  */
-       fcmpu   cr7,fp0,fp13    /* if (fabs(x) > TWO23)  */
-       mffs    fp11            /* Save current FPU rounding mode and
-                                  "inexact" state.  */
-       fcmpu   cr6,fp1,fp12    /* if (x > 0.0)  */
-       bnl-    cr7,.L10
-       mtfsfi  7,1             /* Set rounding toward 0 mode.  */
-       ble-    cr6,.L4
-       fadds   fp1,fp1,fp13    /* x+= TWO23;  */
-       fsubs   fp1,fp1,fp13    /* x-= TWO23;  */
-       fabs    fp1,fp1         /* if (x == 0.0)  */
-                               /* x = 0.0; */
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L4:
-       bge-    cr6,.L9         /* if (x < 0.0)  */
-       fsubs   fp1,fp1,fp13    /* x-= TWO23;  */
-       fadds   fp1,fp1,fp13    /* x+= TWO23;  */
-       fnabs   fp1,fp1         /* if (x == 0.0)  */
-                               /* x = -0.0; */
-.L9:
-       mtfsf   0xff,fp11       /* Restore previous rounding mode and
-                                  "inexact" state.  */
-       blr
-.L10:
-       /* Ensure sNaN input is converted to qNaN.  */
-       fcmpu   cr7,fp1,fp1
-       beqlr   cr7
-       fadds   fp1,fp1,fp1
-       blr
-       END (__truncf)
-
-libm_alias_float (__trunc, trunc)
-
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_trunc.S
deleted file mode 100644 (file)
index fbd0c31..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/* trunc function.  PowerPC64/power5+ version.
-   Copyright (C) 2006-2019 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 <sysdep.h>
-#include <math_ldbl_opt.h>
-#include <libm-alias-double.h>
-
-       .machine        "power5"
-ENTRY_TOCLESS (__trunc, 4)
-       CALL_MCOUNT 0
-       friz    fp1, fp1
-       blr
-       END (__trunc)
-
-libm_alias_double (__trunc, trunc)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_truncf.S
deleted file mode 100644 (file)
index 91612aa..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/* truncf function.  PowerPC64/power5+ version.
-   Copyright (C) 2006-2019 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 <sysdep.h>
-#include <libm-alias-float.h>
-
-       .machine        "power5"
-ENTRY_TOCLESS (__truncf, 4)
-       CALL_MCOUNT 0
-       friz    fp1, fp1        /* The rounding instructions are double.  */
-       frsp    fp1, fp1        /* But we need to set ooverflow for float.  */
-       blr
-       END (__truncf)
-
-libm_alias_float (__trunc, trunc)
-