#undef __strchrnul
#undef strchrnul
+#ifdef STRCHRNUL
+# define __strchrnul STRCHRNUL
+#endif
/* Find the first occurrence of C in S or the final NUL byte. */
char *
/* This should never happen. */
return NULL;
}
-
+#ifndef STRCHRNUL
weak_alias (__strchrnul, strchrnul)
+#endif
mempcpy-power7 mempcpy-c \
memchr-power7 memchr-c \
memrchr-power7 memrchr-c \
- rawmemchr-power7 rawmemchr-c
+ rawmemchr-power7 rawmemchr-c \
+ strchrnul-power7 strchrnul-c
endif
__strnlen_power7)
IFUNC_IMPL_ADD (array, i, strnlen, 1,
__strnlen_ppc32))
+
+ IFUNC_IMPL (i, name, strchrnul,
+ IFUNC_IMPL_ADD (array, i, strchrnul,
+ hwcap & PPC_FEATURE_HAS_VSX,
+ __strchrnul_power7)
+ IFUNC_IMPL_ADD (array, i, strchrnul, 1,
+ __strchrnul_ppc32))
#endif
return i;
--- /dev/null
+#define STRCHRNUL __strchrnul_ppc32
+#include "string/strchrnul.c"
/* int [r3] strchrnul (char *s [r3], int c [r4]) */
.machine power7
-ENTRY (__strchrnul)
+ENTRY (__strchrnul_power7)
CALL_MCOUNT
dcbt 0,r3
clrrwi r8,r3,2 /* Align the address to word boundary. */
srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */
blr
-END (__strchrnul)
-weak_alias (__strchrnul,strchrnul)
-libc_hidden_builtin_def (__strchrnul)
+END (__strchrnul_power7)
--- /dev/null
+/* Multiple versions of strchrnul.
+ 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 (__strchrnul) __strchrnul_ppc32 attribute_hidden;
+extern __typeof (__strchrnul) __strchrnul_power7 attribute_hidden;
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+ ifunc symbol properly. */
+libc_ifunc (__strchrnul,
+ (hwcap & PPC_FEATURE_HAS_VSX)
+ ? __strchrnul_power7
+ : __strchrnul_ppc32);
+
+weak_alias (__strchrnul, strchrnul)
+#else
+#include "string/strchrnul.c"
+#endif