--- /dev/null
+ifeq ($(subdir),math)
+libm-sysdep_routines += s_llrintf-power6 s_llrintf-power4 s_llrintf-c \
+ s_llrint-power6 s_llrint-power4 s_llrint-c
+endif
--- /dev/null
+#include <math_ldbl_opt.h>
+
+#undef __llrint
+#define __llrint __llrint_ppc32
+
+#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)
+
+#include <sysdeps/powerpc/powerpc32/fpu/s_llrint.c>
#include <math_ldbl_opt.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ .machine power4
+ENTRY (__llrint_power4)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
nop
lwz r3,8(r1)
lwz r4,12(r1)
- addi r1,r1,16
+ addi r1,r1,16
blr
- END (__llrint)
-
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+END (__llrint_power4)
#include <math_ldbl_opt.h>
/* long long int[r3, r4] __llrint (double x[fp1]) */
-ENTRY (__llrint)
+ .machine power6
+ENTRY (__llrint_power6)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
ori r1,r1,0
lwz r3,8(r1)
lwz r4,12(r1)
- addi r1,r1,16
+ addi r1,r1,16
blr
- END (__llrint)
-
-weak_alias (__llrint, llrint)
-
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llrint, __llrintl)
-weak_alias (__llrint, llrintl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __llrint, llrintl, GLIBC_2_1)
-#endif
+END (__llrint_power6)
--- /dev/null
+/* Multiple versions of s_llrint.
+ 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 (__llrint) __llrint_ppc32 attribute_hidden;
+extern __typeof (__llrint) __llrint_power4 attribute_hidden;
+extern __typeof (__llrint) __llrint_power6 attribute_hidden;
+
+libc_ifunc (__llrint,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __llrint_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __llrint_power4
+ : __llrint_ppc32);
+
+weak_alias (__llrint, llrint)
+
+#ifdef NO_LONG_DOUBLE
+strong_alias (__llrint, __llrintl)
+weak_alias (__llrint, llrintl)
+#endif
+#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
+compat_symbol (libm, __llrint, llrintl, GLIBC_2_1);
+#endif
--- /dev/null
+#undef __llrintf
+#define __llrintf __llrintf_ppc32
+#include <sysdeps/powerpc/powerpc32/fpu/s_llrintf.c>
#include <sysdep.h>
/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
+ .machine power4
+ENTRY (__llrintf_power4)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
nop
lwz r3,8(r1)
lwz r4,12(r1)
- addi r1,r1,16
+ addi r1,r1,16
blr
- END (__llrintf)
-
-weak_alias (__llrintf, llrintf)
-
+END (__llrintf_power4)
#include <sysdep.h>
/* long long int[r3, r4] __llrintf (float x[fp1]) */
-ENTRY (__llrintf)
+ .machine power6
+ENTRY (__llrintf_power6)
CALL_MCOUNT
stwu r1,-16(r1)
cfi_adjust_cfa_offset (16)
ori r1,r1,0
lwz r3,8(r1)
lwz r4,12(r1)
- addi r1,r1,16
+ addi r1,r1,16
blr
- END (__llrintf)
-
-weak_alias (__llrintf, llrintf)
-
+END (__llrintf_power6)
--- /dev/null
+/* Multiple versions of s_llrintf.
+ 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 <shlib-compat.h>
+#include "init-arch.h"
+
+extern __typeof (__llrintf) __llrintf_ppc32 attribute_hidden;
+extern __typeof (__llrintf) __llrintf_power4 attribute_hidden;
+extern __typeof (__llrintf) __llrintf_power6 attribute_hidden;
+
+libc_ifunc (__llrintf,
+ (hwcap & PPC_FEATURE_ARCH_2_05)
+ ? __llrintf_power6 :
+ (hwcap & PPC_FEATURE_POWER4)
+ ? __llrintf_power4
+ : __llrintf_ppc32);
+
+weak_alias (__llrintf, llrintf)