]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: round/roundf multilib for PowerPC32
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Sun, 14 Apr 2013 20:34:36 +0000 (15:34 -0500)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Sun, 14 Apr 2013 23:21:18 +0000 (18:21 -0500)
sysdeps/powerpc/powerpc32/fpu/multiarch/Makefile
sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S [moved from sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S with 78% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-ppc32.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_round.c [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S [moved from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S with 87% similarity]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-ppc32.S [new file with mode: 0644]
sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf.c [new file with mode: 0644]

index 4251936e4bfddbc2a31de336f2602b3d937e6ca5..8c7868e9d1009c02eef52e57b8cd26def7f87286 100644 (file)
@@ -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
similarity index 78%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_round.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_round-power5+.S
index 3cc72d39cfc6e69dd06748380449d9021feed9db..276ba4500286574150579d441fedd43e8892938d 100644 (file)
 #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 (file)
index 0000000..16401c6
--- /dev/null
@@ -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 (file)
index 0000000..6bd762a
--- /dev/null
@@ -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
similarity index 87%
rename from sysdeps/powerpc/powerpc32/power5+/fpu/s_roundf.S
rename to sysdeps/powerpc/powerpc32/fpu/multiarch/s_roundf-power5+.S
index 8bd2d0a5013ff8da8f43d83a6328fd637f4df191..644d976b6472308df25fc6b23dba5d0a79f8bb73 100644 (file)
 #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 (file)
index 0000000..96ea5e5
--- /dev/null
@@ -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 (file)
index 0000000..da1196b
--- /dev/null
@@ -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)