about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/powerpc/powerpc64')
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile8
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-power5+.c3
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-ppc64.c3
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round.c (renamed from sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c)0
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-power5+.c3
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-ppc64.c3
-rw-r--r--sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf.c (renamed from sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c)0
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile3
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S30
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S30
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S24
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_round.S80
-rw-r--r--sysdeps/powerpc/powerpc64/fpu/s_roundf.S82
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S30
-rw-r--r--sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S31
16 files changed, 20 insertions, 334 deletions
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile
index 8bb06e5cc0..722f974cfb 100644
--- a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/Makefile
@@ -6,10 +6,16 @@ libm-sysdep_routines += s_ceil-power5+ \
 			s_floor-power5+ \
 			s_floor-ppc64 \
 			s_floorf-power5+ \
-			s_floorf-ppc64
+			s_floorf-ppc64 \
+			s_round-power5+ \
+			s_round-ppc64 \
+			s_roundf-power5+ \
+			s_roundf-ppc64
 
 CFLAGS-s_ceil-power5+.c = -mcpu=power5+
 CFLAGS-s_ceilf-power5+.c = -mcpu=power5+
 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+
 endif
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-power5+.c
new file mode 100644
index 0000000000..3f6f87b4e2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-power5+.c
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __round __round_power5plus
+#include <sysdeps/powerpc/fpu/s_round.c>
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-ppc64.c
new file mode 100644
index 0000000000..cb122e6afc
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round-ppc64.c
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __round __round_ppc64
+#include <sysdeps/powerpc/fpu/s_round.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round.c
index eb66a8d528..eb66a8d528 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round.c
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_round.c
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-power5+.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-power5+.c
new file mode 100644
index 0000000000..b0cb5c5190
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-power5+.c
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __roundf __roundf_power5plus
+#include <sysdeps/powerpc/fpu/s_roundf.c>
diff --git a/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-ppc64.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-ppc64.c
new file mode 100644
index 0000000000..3e1de69147
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf-ppc64.c
@@ -0,0 +1,3 @@
+#include <math.h>
+#define __roundf __roundf_ppc64
+#include <sysdeps/powerpc/fpu/s_roundf.c>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf.c
index 640bca5a7a..640bca5a7a 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf.c
+++ b/sysdeps/powerpc/powerpc64/be/fpu/multiarch/s_roundf.c
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
index 8a73108e4c..11c39f4b35 100644
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/fpu/multiarch/Makefile
@@ -15,8 +15,7 @@ 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_round-power5+ s_round-ppc64 \
-			s_roundf-power5+ s_roundf-ppc64 s_trunc-power5+ \
+			s_trunc-power5+ \
 			s_trunc-ppc64 s_truncf-power5+ s_truncf-ppc64 \
 			s_llrint-power6x s_llrint-ppc64 \
 			s_logb-power7 s_logbf-power7 \
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
deleted file mode 100644
index 8c38759d3f..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-power5+.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* round 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 __round __round_power5plus
-
-#include <sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
deleted file mode 100644
index 5ea616d429..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_round-ppc64.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* round 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 __round __round_ppc64
-
-#include <sysdeps/powerpc/powerpc64/fpu/s_round.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
deleted file mode 100644
index c29c31785e..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-power5+.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* roundf 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 __roundf __roundf_power5plus
-
-#include <sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S b/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
deleted file mode 100644
index ced4241b2b..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/multiarch/s_roundf-ppc64.S
+++ /dev/null
@@ -1,24 +0,0 @@
-/* roundf 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 __roundf __roundf_ppc64
-
-#include <sysdeps/powerpc/powerpc64/fpu/s_roundf.S>
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_round.S b/sysdeps/powerpc/powerpc64/fpu/s_round.S
deleted file mode 100644
index 0b06a52d09..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_round.S
+++ /dev/null
@@ -1,80 +0,0 @@
-/* round 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
-.LC1:	/* 0.5 */
-	.tc FD_3fe00000_0[TC],0x3fe0000000000000
-	.section	".text"
-
-/* double [fp1] round (double x [fp1])
-   IEEE 1003.1 round function.  IEEE specifies "round to the nearest
-   integer value, rounding halfway cases away from zero, regardless of
-   the current rounding mode."  However PowerPC Architecture defines
-   "Round to Nearest" as "Choose the best approximation. In case of a
-   tie, choose the one that is even (least significant bit o).".
-   So we can't use the PowerPC "Round to Nearest" mode. Instead we set
-   "Round toward Zero" mode and round by adding +-0.5 before rounding
-   to the integer value.  */
-
-ENTRY (__round, 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 mode toward 0.  */
-	lfd	fp10,.LC1@toc(2)
-	ble-	cr6,.L4
-	fadd	fp1,fp1,fp10	/* x+= 0.5;  */
-	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:
-	fsub	fp9,fp1,fp10	/* x+= 0.5;  */
-	bge-	cr6,.L9		/* if (x < 0.0)  */
-	fsub	fp1,fp9,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 (__round)
-
-libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
deleted file mode 100644
index a9c32c5774..0000000000
--- a/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
+++ /dev/null
@@ -1,82 +0,0 @@
-/* roundf  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
-.LC1:	/* 0.5 */
-	.long 0x3f000000
-
-	.section	".text"
-
-/* float [fp1] roundf  (float x [fp1])
-   IEEE 1003.1 round function.  IEEE specifies "round to the nearest
-   integer value, rounding halfway cases away from zero, regardless of
-   the current rounding mode."  However PowerPC Architecture defines
-   "Round to Nearest" as "Choose the best approximation. In case of a
-   tie, choose the one that is even (least significant bit o).".
-   So we can't use the PowerPC "Round to Nearest" mode. Instead we set
-   "Round toward Zero" mode and round by adding +-0.5 before rounding
-   to the integer value.  */
-
-ENTRY (__roundf, 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 mode toward 0.  */
-	lfs	fp10,.LC1@toc(2)
-	ble-	cr6,.L4
-	fadds	fp1,fp1,fp10	/* x+= 0.5;  */
-	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:
-	fsubs	fp9,fp1,fp10	/* x+= 0.5;  */
-	bge-	cr6,.L9		/* if (x < 0.0)  */
-	fsubs	fp1,fp9,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 (__roundf)
-
-libm_alias_float (__round, round)
-
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
deleted file mode 100644
index 45d010a919..0000000000
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_round.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* round 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 (__round, 4)
-	CALL_MCOUNT 0
-	frin	fp1, fp1
-	blr
-	END (__round)
-
-libm_alias_double (__round, round)
diff --git a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
deleted file mode 100644
index 69fad1069f..0000000000
--- a/sysdeps/powerpc/powerpc64/power5+/fpu/s_roundf.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* roundf 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 (__roundf, 4)
-	CALL_MCOUNT 0
-	frin	fp1, fp1	/* The rounding instructions are double.  */
-	frsp	fp1, fp1	/* But we need to set ooverflow for float.  */
-	blr
-	END (__roundf)
-
-libm_alias_float (__round, round)
-