olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1240351-7.patch

00db10
    Backport of the addition of
00db10
      sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
00db10
    from the following:
00db10
    
00db10
    commit 9f2f36e5a91c2ce6edba5415e176155eb1008ae1
00db10
    Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
00db10
    Date:   Tue Dec 23 13:39:23 2014 -0500
00db10
    
00db10
        powerpc: Optimized strncat for POWER7/PPC64
00db10
    
00db10
        With 3eb38795dbbbd816 (Simplify strncat) the generic algorithms uses
00db10
        strlen, strnlen, and memcpy.  This is faster than POWER7 current
00db10
        implementation, especially for unaligned strings (where POWER7 code
00db10
        uses byte-byte operations).
00db10
    
00db10
        This patch removes the assembly implementation and uses a multiarch
00db10
        specialization based on default algorithm calling optimized POWER7
00db10
        symbols.
00db10
    
00db10
        ChangeLog:
00db10
            2015-01-13  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
00db10
    
00db10
            * sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c: New file.
00db10
            * sysdeps/powerpc/powerpc64/multiarch/strncat-power7.S: Remove file.
00db10
            * sysdeps/powerpc/powerpc64/power7/strncat.S: Likewise.
00db10
    
00db10
    plus the addition of strncat-power7 to
00db10
      sysdeps/powerpc/powerpc64/multiarch/Makefile
00db10
00db10
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
00db10
index 7ebfc7e..74ae710 100644
00db10
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
00db10
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
00db10
@@ -8,6 +8,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
00db10
                   stpcpy-power8 stpcpy-power7 stpcpy-ppc64 \
00db10
                   strcat-power8 strcat-power7 strcat-ppc64 \
00db10
                   strcpy-power8 strcpy-power7 strcpy-ppc64 \
00db10
+                  strncat-power7 \
00db10
                   rawmemchr-ppc64 strlen-power7 strlen-ppc64 strnlen-power7 \
00db10
                   strnlen-ppc64 strcasecmp-power7 strcasecmp_l-power7 \
00db10
                   strncase-power7 strncase_l-power7 strncmp-power7 \
00db10
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
00db10
new file mode 100644
00db10
index 0000000..39b1aeb
00db10
--- /dev/null
00db10
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power7.c
00db10
@@ -0,0 +1,31 @@
00db10
+/* Copyright (C) 2015 Free Software Foundation, Inc.
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library; if not, see
00db10
+   <http://www.gnu.org/licenses/ >.  */
00db10
+
00db10
+#include <string.h>
00db10
+
00db10
+#define STRNCAT __strncat_power7
00db10
+
00db10
+extern __typeof (strncat) __strncat_power7 attribute_hidden;
00db10
+extern __typeof (strlen) __strlen_power7 attribute_hidden;
00db10
+extern __typeof (strnlen) __strnlen_power7 attribute_hidden;
00db10
+extern __typeof (memcpy) __memcpy_power7 attribute_hidden;
00db10
+
00db10
+#define strlen    __strlen_power7
00db10
+#define __strnlen __strnlen_power7
00db10
+#define memcpy    __memcpy_power7
00db10
+
00db10
+#include <string/strncat.c>