|
|
147e83 |
From fda2d6aca32ad6a4d546ab3a7dd708de78e18c3a Mon Sep 17 00:00:00 2001
|
|
|
147e83 |
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
|
|
|
147e83 |
Date: Wed, 30 Jul 2014 05:49:36 -0500
|
|
|
147e83 |
Subject: [PATCH] PowerPC: multiarch strncmp for PowerPC64
|
|
|
147e83 |
|
|
|
147e83 |
commit 24c2c3b99699b7cb7cc3c251d9bd504b2cde6a45
|
|
|
147e83 |
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
|
|
147e83 |
Date: Fri Dec 13 14:48:48 2013 -0500
|
|
|
147e83 |
---
|
|
|
147e83 |
sysdeps/powerpc/powerpc64/multiarch/Makefile | 3 +-
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/ifunc-impl-list.c | 9 +++++
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/strncmp-power4.S | 38 ++++++++++++++++++++
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/strncmp-power7.S | 39 ++++++++++++++++++++
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/strncmp-ppc64.S | 41 ++++++++++++++++++++++
|
|
|
147e83 |
sysdeps/powerpc/powerpc64/multiarch/strncmp.c | 37 +++++++++++++++++++
|
|
|
147e83 |
6 files changed, 166 insertions(+), 1 deletion(-)
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncmp.c
|
|
|
147e83 |
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
|
|
147e83 |
index 4dca756..22baf1c 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
|
|
147e83 |
@@ -7,7 +7,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
|
|
|
147e83 |
memrchr-power7 memrchr-ppc64 rawmemchr-power7 \
|
|
|
147e83 |
rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \
|
|
|
147e83 |
strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7 \
|
|
|
147e83 |
- strncase-power7 strncase_l-power7
|
|
|
147e83 |
+ strncase-power7 strncase_l-power7 strncmp-power7 \
|
|
|
147e83 |
+ strncmp-power4 strncmp-ppc64
|
|
|
147e83 |
|
|
|
147e83 |
CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
|
|
|
147e83 |
CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
|
|
147e83 |
index 4b8fb22..67f75a5 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
|
|
147e83 |
@@ -77,6 +77,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
|
|
147e83 |
__strlen_power7)
|
|
|
147e83 |
IFUNC_IMPL_ADD (array, i, strlen, 1,
|
|
|
147e83 |
__strlen_ppc))
|
|
|
147e83 |
+
|
|
|
147e83 |
+ /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
|
|
|
147e83 |
+ IFUNC_IMPL (i, name, strncmp,
|
|
|
147e83 |
+ IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
|
|
|
147e83 |
+ __strncmp_power7)
|
|
|
147e83 |
+ IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_POWER4,
|
|
|
147e83 |
+ __strncmp_power4)
|
|
|
147e83 |
+ IFUNC_IMPL_ADD (array, i, strncmp, 1,
|
|
|
147e83 |
+ __strncmp_ppc))
|
|
|
147e83 |
#endif
|
|
|
147e83 |
|
|
|
147e83 |
/* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..62cebbc
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power4.S
|
|
|
147e83 |
@@ -0,0 +1,38 @@
|
|
|
147e83 |
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdep.h>
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef EALIGN
|
|
|
147e83 |
+#define EALIGN(name,alignt,words) \
|
|
|
147e83 |
+ .section ".text"; \
|
|
|
147e83 |
+ ENTRY_2(__strncmp_power4) \
|
|
|
147e83 |
+ .align ALIGNARG(alignt); \
|
|
|
147e83 |
+ EALIGN_W_##words; \
|
|
|
147e83 |
+ BODY_LABEL(__strncmp_power4): \
|
|
|
147e83 |
+ cfi_startproc;
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef END
|
|
|
147e83 |
+#define END(name) \
|
|
|
147e83 |
+ cfi_endproc; \
|
|
|
147e83 |
+ TRACEBACK(__strncmp_power4) \
|
|
|
147e83 |
+ END_2(__strncmp_power4)
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef libc_hidden_builtin_def
|
|
|
147e83 |
+#define libc_hidden_builtin_def(name)
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdeps/powerpc/powerpc64/power4/strncmp.S>
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..b0d607a
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-power7.S
|
|
|
147e83 |
@@ -0,0 +1,39 @@
|
|
|
147e83 |
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdep.h>
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef EALIGN
|
|
|
147e83 |
+#define EALIGN(name,alignt,words) \
|
|
|
147e83 |
+ .section ".text"; \
|
|
|
147e83 |
+ ENTRY_2(__strncmp_power7) \
|
|
|
147e83 |
+ .align ALIGNARG(alignt); \
|
|
|
147e83 |
+ EALIGN_W_##words; \
|
|
|
147e83 |
+ BODY_LABEL(__strncmp_power7): \
|
|
|
147e83 |
+ cfi_startproc;
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef END
|
|
|
147e83 |
+#define END(name) \
|
|
|
147e83 |
+ cfi_endproc; \
|
|
|
147e83 |
+ TRACEBACK(__strncmp_power7) \
|
|
|
147e83 |
+ END_2(__strncmp_power7)
|
|
|
147e83 |
+
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef libc_hidden_builtin_def
|
|
|
147e83 |
+#define libc_hidden_builtin_def(name)
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdeps/powerpc/powerpc64/power7/strncmp.S>
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..25b7f26
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp-ppc64.S
|
|
|
147e83 |
@@ -0,0 +1,41 @@
|
|
|
147e83 |
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdep.h>
|
|
|
147e83 |
+
|
|
|
147e83 |
+#if defined SHARED && !defined NOT_IN_libc
|
|
|
147e83 |
+#undef EALIGN
|
|
|
147e83 |
+#define EALIGN(name,alignt,words) \
|
|
|
147e83 |
+ .section ".text"; \
|
|
|
147e83 |
+ ENTRY_2(__strncmp_ppc) \
|
|
|
147e83 |
+ .align ALIGNARG(alignt); \
|
|
|
147e83 |
+ EALIGN_W_##words; \
|
|
|
147e83 |
+ BODY_LABEL(__strncmp_ppc): \
|
|
|
147e83 |
+ cfi_startproc;
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef END
|
|
|
147e83 |
+#define END(name) \
|
|
|
147e83 |
+ cfi_endproc; \
|
|
|
147e83 |
+ TRACEBACK(__strncmp_ppc) \
|
|
|
147e83 |
+ END_2(__strncmp_ppc)
|
|
|
147e83 |
+
|
|
|
147e83 |
+# undef libc_hidden_builtin_def
|
|
|
147e83 |
+# define libc_hidden_builtin_def(name) \
|
|
|
147e83 |
+ .globl __GI_strncmp; __GI_strncmp = __strncmp_ppc
|
|
|
147e83 |
+#endif
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdeps/powerpc/powerpc64/strncmp.S>
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..9829d69
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
|
|
|
147e83 |
@@ -0,0 +1,37 @@
|
|
|
147e83 |
+/* Multiple versions of strncmp.
|
|
|
147e83 |
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+/* Define multiple versions only for definition in libc. */
|
|
|
147e83 |
+#if defined SHARED && !defined NOT_IN_libc
|
|
|
147e83 |
+# include <string.h>
|
|
|
147e83 |
+# include <shlib-compat.h>
|
|
|
147e83 |
+# include "init-arch.h"
|
|
|
147e83 |
+
|
|
|
147e83 |
+extern __typeof (strncmp) __strncmp_ppc attribute_hidden;
|
|
|
147e83 |
+extern __typeof (strncmp) __strncmp_power4 attribute_hidden;
|
|
|
147e83 |
+extern __typeof (strncmp) __strncmp_power7 attribute_hidden;
|
|
|
147e83 |
+
|
|
|
147e83 |
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
|
|
147e83 |
+ ifunc symbol properly. */
|
|
|
147e83 |
+libc_ifunc (strncmp,
|
|
|
147e83 |
+ (hwcap & PPC_FEATURE_HAS_VSX)
|
|
|
147e83 |
+ ? __strncmp_power7 :
|
|
|
147e83 |
+ (hwcap & PPC_FEATURE_POWER4)
|
|
|
147e83 |
+ ? __strncmp_power4
|
|
|
147e83 |
+ : __strncmp_ppc);
|
|
|
147e83 |
+#endif
|
|
|
147e83 |
--
|
|
|
147e83 |
1.8.3.1
|
|
|
147e83 |
|