#include <string.h>
-#undef mempcpy
#undef __mempcpy
+#ifdef MEMPCPY
+# define __mempcpy MEMPCPY
+#endif
void *
__mempcpy (void *dest, const void *src, size_t len)
{
return memcpy (dest, src, len) + len;
}
-libc_hidden_def (__mempcpy)
+#ifndef MEMPCPY
weak_alias (__mempcpy, mempcpy)
+libc_hidden_def (__mempcpy)
+#endif
libc_hidden_builtin_def (mempcpy)
bzero-power4 bzero-power6 bzero-power7 \
strncmp-power7 strncmp-power4 strlen-power7 \
strcasecmp-power7 strcasecmp_l-power7 \
- strnlen-power7 strnlen-c
+ strnlen-power7 strnlen-c \
+ mempcpy-power7 mempcpy-c
endif
__memcpy_cell)
IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc32))
+ IFUNC_IMPL (i, name, mempcpy,
+ IFUNC_IMPL_ADD (array, i, mempcpy,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __mempcpy_power7)
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1,
+ __mempcpy_ppc32))
+
IFUNC_IMPL (i, name, strlen,
IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
__strlen_power7)
--- /dev/null
+#define MEMPCPY __mempcpy_ppc32
+#ifdef SHARED
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+ __hidden_ver1 (__mempcpy_ppc32, __GI_mempcpy, __mempcpy_ppc32);
+#endif
+
+#include "string/mempcpy.c"
Returns 'dst' + 'len'. */
.machine power7
-EALIGN (__mempcpy, 5, 0)
+EALIGN (__mempcpy_power7, 5, 0)
CALL_MCOUNT
stwu 1,-32(1)
addi 1,1,32
blr
-END (__mempcpy)
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
+END (__mempcpy_power7)
--- /dev/null
+/* Multiple versions of mempcpy.
+ 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/>. */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (__mempcpy) __mempcpy_ppc32 attribute_hidden;
+extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__mempcpy,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __mempcpy_power7
+ : __mempcpy_ppc32);
+
+weak_alias (__mempcpy, mempcpy)
+libc_hidden_def (mempcpy)
+#endif
--- /dev/null
+#include <string/memcpy.c>
+#include <string/mempcpy.c>