arrfab / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh731837-10.patch

147e83
From 4a6eeaf792815ff197f683e424d64cc3a9e16a66 Mon Sep 17 00:00:00 2001
147e83
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
147e83
Date: Wed, 30 Jul 2014 05:47:00 -0500
147e83
Subject: [PATCH] PowerPC: multiarch strcasecmp for PowerPC64
147e83
147e83
commit 17de3ee3c109a13ecec60b8bc9514f33c5b42178
147e83
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
147e83
Date:   Fri Dec 13 14:39:51 2013 -0500
147e83
---
147e83
 sysdeps/powerpc/powerpc64/multiarch/Makefile       |  2 +-
147e83
 .../powerpc/powerpc64/multiarch/ifunc-impl-list.c  | 15 ++++++++
147e83
 .../powerpc64/multiarch/strcasecmp-power7.S        | 41 +++++++++++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c   | 40 ++++++++++++++++++++
147e83
 .../powerpc64/multiarch/strcasecmp_l-power7.S      | 43 ++++++++++++++++++++++
147e83
 sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c | 40 ++++++++++++++++++++
147e83
 6 files changed, 180 insertions(+), 1 deletion(-)
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
147e83
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.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 3285fd7..5e172da 100644
147e83
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
147e83
@@ -6,5 +6,5 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
147e83
                   mempcpy-power7 mempcpy-ppc64 memchr-power7 memchr-ppc64 \
147e83
                   memrchr-power7 memrchr-ppc64 rawmemchr-power7 \
147e83
                   rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \
147e83
-                  strnlen-ppc64
147e83
+                  strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7
147e83
 endif
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 c9125b8..ba78d97 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
@@ -136,5 +136,20 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
147e83
              IFUNC_IMPL_ADD (array, i, strnlen, 1,
147e83
                              __strnlen_ppc))
147e83
 
147e83
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c.  */
147e83
+  IFUNC_IMPL (i, name, strcasecmp,
147e83
+             IFUNC_IMPL_ADD (array, i, strcasecmp,
147e83
+                             hwcap & PPC_FEATURE_HAS_VSX,
147e83
+                             __strcasecmp_power7)
147e83
+             IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc))
147e83
+
147e83
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c.  */
147e83
+  IFUNC_IMPL (i, name, strcasecmp_l,
147e83
+             IFUNC_IMPL_ADD (array, i, strcasecmp_l,
147e83
+                             hwcap & PPC_FEATURE_HAS_VSX,
147e83
+                             __strcasecmp_l_power7)
147e83
+             IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
147e83
+                             __strcasecmp_l_ppc))
147e83
+
147e83
   return i;
147e83
 }
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
147e83
new file mode 100644
147e83
index 0000000..9714f88
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp-power7.S
147e83
@@ -0,0 +1,41 @@
147e83
+/* Optimized strcasecmp implementation foOWER7.
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 ENTRY
147e83
+#define ENTRY(name)						\
147e83
+  .section ".text";						\
147e83
+  ENTRY_2(__strcasecmp_power7)					\
147e83
+  .align ALIGNARG(2);						\
147e83
+  BODY_LABEL(__strcasecmp_power7):				\
147e83
+  cfi_startproc;
147e83
+
147e83
+#undef END
147e83
+#define END(name)						\
147e83
+  cfi_endproc;							\
147e83
+  TRACEBACK(__strcasecmp_power7)				\
147e83
+  END_2(__strcasecmp_power7)
147e83
+
147e83
+#undef weak_alias
147e83
+#define weak_alias(name, alias)
147e83
+
147e83
+#undef libc_hidden_builtin_def
147e83
+#define libc_hidden_builtin_def(name)
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/power7/strcasecmp.S>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
147e83
new file mode 100644
147e83
index 0000000..7f02a25
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
147e83
@@ -0,0 +1,40 @@
147e83
+/* Multiple versions of strcasecmp.
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
+#ifndef NOT_IN_libc
147e83
+# include <string.h>
147e83
+# define strcasecmp __strcasecmp_ppc
147e83
+extern __typeof (__strcasecmp) __strcasecmp_ppc attribute_hidden;
147e83
+extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
147e83
+#endif
147e83
+
147e83
+#include <string/strcasecmp.c>
147e83
+#undef strcasecmp
147e83
+
147e83
+#ifndef NOT_IN_libc
147e83
+# include <shlib-compat.h>
147e83
+# include "init-arch.h"
147e83
+
147e83
+extern __typeof (__strcasecmp) __libc_strcasecmp;
147e83
+libc_ifunc (__libc_strcasecmp,
147e83
+	    (hwcap & PPC_FEATURE_HAS_VSX)
147e83
+            ? __strcasecmp_power7
147e83
+            : __strcasecmp_ppc);
147e83
+
147e83
+weak_alias (__libc_strcasecmp, strcasecmp)
147e83
+#endif
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
147e83
new file mode 100644
147e83
index 0000000..117e464
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l-power7.S
147e83
@@ -0,0 +1,43 @@
147e83
+/* Optimized strcasecmp_l implementation for POWER7.
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 ENTRY
147e83
+#define ENTRY(name)						\
147e83
+  .section ".text";						\
147e83
+  ENTRY_2(__strcasecmp_l_power7)				\
147e83
+  .align ALIGNARG(2);						\
147e83
+  BODY_LABEL(__strcasecmp_l_power7):				\
147e83
+  cfi_startproc;
147e83
+
147e83
+#undef END
147e83
+#define END(name)						\
147e83
+  cfi_endproc;							\
147e83
+  TRACEBACK(__strcasecmp_l_power7)				\
147e83
+  END_2(__strcasecmp_l_power7)
147e83
+
147e83
+#undef weak_alias
147e83
+#define weak_alias(name, alias)
147e83
+
147e83
+#undef libc_hidden_builtin_def
147e83
+#define libc_hidden_builtin_def(name)
147e83
+
147e83
+#define USE_IN_EXTENDED_LOCALE_MODEL
147e83
+
147e83
+#include <sysdeps/powerpc/powerpc64/power7/strcasecmp.S>
147e83
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
147e83
new file mode 100644
147e83
index 0000000..a3374c3
147e83
--- /dev/null
147e83
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
147e83
@@ -0,0 +1,40 @@
147e83
+/* Multiple versions of strcasecmp_l.
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
+#ifndef NOT_IN_libc
147e83
+# include <string.h>
147e83
+# define strcasecmp_l __strcasecmp_l_ppc
147e83
+extern __typeof (__strcasecmp_l) __strcasecmp_l_ppc attribute_hidden;
147e83
+extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
147e83
+#endif
147e83
+
147e83
+#include <string/strcasecmp_l.c>
147e83
+#undef strcasecmp_l
147e83
+
147e83
+#ifndef NOT_IN_libc
147e83
+# include <shlib-compat.h>
147e83
+# include "init-arch.h"
147e83
+
147e83
+extern __typeof (__strcasecmp_l) __libc_strcasecmp_l;
147e83
+libc_ifunc (__libc_strcasecmp_l,
147e83
+	    (hwcap & PPC_FEATURE_HAS_VSX)
147e83
+            ? __strcasecmp_l_power7
147e83
+            : __strcasecmp_l_ppc);
147e83
+
147e83
+weak_alias (__libc_strcasecmp_l, strcasecmp_l)
147e83
+#endif
147e83
-- 
147e83
1.8.3.1
147e83