aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-04-14 15:34:36 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2013-04-14 18:21:18 -0500
commit5974755e7efda38f05d7f3ae855873aa8184eab4 (patch)
tree21c45be9d8657117088353015f2587bf8b18e03b
parent0fc435974c65787a0b1b2dfc149c1433b5a86d2d (diff)
downloadglibc-5974755e7efda38f05d7f3ae855873aa8184eab4.tar
glibc-5974755e7efda38f05d7f3ae855873aa8184eab4.tar.gz
glibc-5974755e7efda38f05d7f3ae855873aa8184eab4.tar.bz2
glibc-5974755e7efda38f05d7f3ae855873aa8184eab4.zip
PowerPC: round/roundf multilib for PowerPC32
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile4
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S (renamed from sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S)14
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S13
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c40
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S (renamed from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S)9
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S9
-rw-r--r--sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c32
7 files changed, 102 insertions, 19 deletions
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
index 4251936e4b..8c7868e9d1 100644
--- a/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
@@ -19,7 +19,9 @@ libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \
s_ceil-power5+ s_ceil-ppc32 \
s_ceilf-power5+ s_ceilf-ppc32 \
s_floor-power5+ s_floor-ppc32 \
- s_floorf-power5+ s_floorf-ppc32
+ s_floorf-power5+ s_floorf-ppc32 \
+ s_round-power5+ s_round-ppc32 \
+ s_roundf-power5+ s_roundf-ppc32
CFLAGS-s_llround.c = -fno-builtin-llroundf
endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S
index 3cc72d39cf..276ba45002 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S
@@ -20,17 +20,7 @@
#include <math_ldbl_opt.h>
.machine "power5"
-EALIGN (__round, 4, 0)
+EALIGN (__round_power5plus, 4, 0)
frin fp1, fp1
blr
- END (__round)
-
-weak_alias (__round, round)
-
-#ifdef NO_LONG_DOUBLE
-weak_alias (__round, roundl)
-strong_alias (__round, __roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1)
-#endif
+END (__round_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S
new file mode 100644
index 0000000000..16401c60bc
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S
@@ -0,0 +1,13 @@
+#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 __round __round_ppc32
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_round.S>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c
new file mode 100644
index 0000000000..6bd762a03d
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c
@@ -0,0 +1,40 @@
+/* Multiple versions of s_round.
+ Copyright (C) 2013 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 <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__round) __round_ppc32 attribute_hidden;
+extern __typeof (__round) __round_power5plus attribute_hidden;
+
+libc_ifunc (__round,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __round_power5plus
+ : __round_ppc32);
+
+weak_alias (__round, round)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__round, __roundl)
+weak_alias (__round, roundl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __round, roundl, GLIBC_2_1);
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S
index 8bd2d0a501..644d976b64 100644
--- a/sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S
@@ -19,11 +19,8 @@
#include <sysdep.h>
.machine "power5"
-EALIGN (__roundf, 4, 0)
+EALIGN (__roundf_power5plus, 4, 0)
frin fp1, fp1 /* The rounding instructions are double. */
- frsp fp1, fp1 /* But we need to set ooverflow for float. */
+ frsp fp1, fp1 /* But we need to set overflow for float. */
blr
- END (__roundf)
-
-weak_alias (__roundf, roundf)
-
+END (__roundf_power5plus)
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S
new file mode 100644
index 0000000000..96ea5e5439
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S
@@ -0,0 +1,9 @@
+#include <sysdep.h>
+#include <math_ldbl_opt.h>
+
+#undef weak_alias
+#define weak_alias(a,b)
+
+#define __roundf __roundf_ppc32
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_roundf.S>
diff --git a/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c
new file mode 100644
index 0000000000..da1196beb1
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c
@@ -0,0 +1,32 @@
+/* Multiple versions of s_roundf.
+ Copyright (C) 2013 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 <math.h>
+#include <math_ldbl_opt.h>
+#include <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__roundf) __roundf_ppc32 attribute_hidden;
+extern __typeof (__roundf) __roundf_power5plus attribute_hidden;
+
+libc_ifunc (__roundf,
+ (hwcap & PPC_FEATURE_POWER5_PLUS)
+ ? __roundf_power5plus
+ : __roundf_ppc32);
+
+weak_alias (__roundf, roundf)