]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc64: Add checks for Altivec and VSX in ifunc selection
authorAnton Blanchard <anton@ozlabs.org>
Tue, 27 Jul 2021 05:47:51 +0000 (15:47 +1000)
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Fri, 6 Aug 2021 19:10:08 +0000 (16:10 -0300)
We'd like to support processors without Altivec or VSX, so check
the relevant hwcap bits before selecting them.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
26 files changed:
sysdeps/powerpc/powerpc64/multiarch/bzero.c
sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
sysdeps/powerpc/powerpc64/multiarch/memchr.c
sysdeps/powerpc/powerpc64/multiarch/memcmp.c
sysdeps/powerpc/powerpc64/multiarch/memcpy.c
sysdeps/powerpc/powerpc64/multiarch/memmove.c
sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
sysdeps/powerpc/powerpc64/multiarch/memrchr.c
sysdeps/powerpc/powerpc64/multiarch/memset.c
sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
sysdeps/powerpc/powerpc64/multiarch/strcat.c
sysdeps/powerpc/powerpc64/multiarch/strchr.c
sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
sysdeps/powerpc/powerpc64/multiarch/strcmp.c
sysdeps/powerpc/powerpc64/multiarch/strcpy.c
sysdeps/powerpc/powerpc64/multiarch/strcspn.c
sysdeps/powerpc/powerpc64/multiarch/strlen.c
sysdeps/powerpc/powerpc64/multiarch/strncase.c
sysdeps/powerpc/powerpc64/multiarch/strncat.c
sysdeps/powerpc/powerpc64/multiarch/strncmp.c
sysdeps/powerpc/powerpc64/multiarch/strnlen.c
sysdeps/powerpc/powerpc64/multiarch/strrchr.c
sysdeps/powerpc/powerpc64/multiarch/strspn.c

index 660d7dc686eccf65946d998710a1fa4f1195fcc5..c8ffbea01cda4814f1a55c52232580e61e610f2c 100644 (file)
@@ -38,11 +38,13 @@ libc_ifunc (__bzero,
             && hwcap & PPC_FEATURE_HAS_VSX)
            ? __bzero_power10 :
 # endif
-            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC)
             ? __bzero_power8 :
              (hwcap & PPC_FEATURE_HAS_VSX)
              ? __bzero_power7 :
-               (hwcap & PPC_FEATURE_ARCH_2_05)
+               (hwcap & PPC_FEATURE_ARCH_2_05
+                && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                ? __bzero_power6 :
                  (hwcap & PPC_FEATURE_POWER4)
                  ? __bzero_power4
index a3fdcd43bd58ac7bcaa171d3ac04a85a54c540cb..c3e25c59814c117d78c765f5abadb016c5ebb257 100644 (file)
@@ -60,9 +60,11 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              && hwcap & PPC_FEATURE_HAS_VSX,
                              __memcpy_power10)
 #endif
-             IFUNC_IMPL_ADD (array, i, memcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+             IFUNC_IMPL_ADD (array, i, memcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __memcpy_power8_cached)
-             IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __memcpy_power7)
              IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06,
                              __memcpy_a2)
@@ -83,7 +85,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              && hwcap & PPC_FEATURE_HAS_VSX,
                              __memmove_power10)
 #endif
-             IFUNC_IMPL_ADD (array, i, memmove, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, memmove, hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __memmove_power7)
              IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ppc))
 
@@ -98,6 +101,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              __memset_power10)
 #endif
              IFUNC_IMPL_ADD (array, i, memset, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC
                              && cacheline_size == 128,
                              __memset_power8)
              IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_06
@@ -114,12 +118,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcpy.c.  */
   IFUNC_IMPL (i, name, strcpy,
 #ifdef __LITTLE_ENDIAN__
-             IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+             IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strcpy_power9)
 #endif
-             IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+             IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strcpy_power8)
-             IFUNC_IMPL_ADD (array, i, strcpy, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, strcpy, hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strcpy_power7)
              IFUNC_IMPL_ADD (array, i, strcpy, 1,
                              __strcpy_ppc))
@@ -127,12 +134,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/stpcpy.c.  */
   IFUNC_IMPL (i, name, stpcpy,
 #ifdef __LITTLE_ENDIAN__
-             IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+             IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_3_00
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __stpcpy_power9)
 #endif
-             IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+             IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __stpcpy_power8)
-             IFUNC_IMPL_ADD (array, i, stpcpy, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, stpcpy, hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __stpcpy_power7)
              IFUNC_IMPL_ADD (array, i, stpcpy, 1,
                              __stpcpy_ppc))
@@ -140,12 +150,15 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c.  */
   IFUNC_IMPL (i, name, strlen,
 #ifdef __LITTLE_ENDIAN__
-             IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_1,
+             IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_1
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strlen_power10)
-             IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+             IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_3_00
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strlen_power9)
 #endif
-             IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+             IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strlen_power8)
              IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_ARCH_2_06,
                              __strlen_power7)
@@ -155,7 +168,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c.  */
   IFUNC_IMPL (i, name, strncmp,
 #ifdef __LITTLE_ENDIAN__
-             IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00,
+             IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_3_00
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strncmp_power9)
 #endif
              IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
@@ -170,7 +184,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c.  */
   IFUNC_IMPL (i, name, strchr,
              IFUNC_IMPL_ADD (array, i, strchr,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strchr_power8)
              IFUNC_IMPL_ADD (array, i, strchr,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -181,7 +196,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c.  */
   IFUNC_IMPL (i, name, strchrnul,
              IFUNC_IMPL_ADD (array, i, strchrnul,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strchrnul_power8)
              IFUNC_IMPL_ADD (array, i, strchrnul,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -198,7 +214,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
             && hwcap & PPC_FEATURE_HAS_VSX,
                              __memcmp_power10)
 #endif
-             IFUNC_IMPL_ADD (array, i, memcmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+             IFUNC_IMPL_ADD (array, i, memcmp, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __memcmp_power8)
              IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_ARCH_2_06,
                              __memcmp_power7)
@@ -215,11 +232,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              && hwcap & PPC_FEATURE_HAS_VSX,
                              __bzero_power10)
 #endif
-             IFUNC_IMPL_ADD (array, i, bzero, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+             IFUNC_IMPL_ADD (array, i, bzero, hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __bzero_power8)
              IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
                              __bzero_power7)
-             IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05,
+             IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __bzero_power6)
              IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4,
                              __bzero_power4)
@@ -241,7 +260,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c.  */
   IFUNC_IMPL (i, name, mempcpy,
              IFUNC_IMPL_ADD (array, i, mempcpy,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __mempcpy_power7)
              IFUNC_IMPL_ADD (array, i, mempcpy, 1,
                              __mempcpy_ppc))
@@ -249,7 +269,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c.  */
   IFUNC_IMPL (i, name, memchr,
              IFUNC_IMPL_ADD (array, i, memchr,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __memchr_power8)
              IFUNC_IMPL_ADD (array, i, memchr,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -260,7 +281,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c.  */
   IFUNC_IMPL (i, name, memrchr,
              IFUNC_IMPL_ADD (array, i, memrchr,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __memrchr_power8)
              IFUNC_IMPL_ADD (array, i, memrchr,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -276,7 +298,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                               && (hwcap & PPC_FEATURE_HAS_VSX),
                               __rawmemchr_power10)
              IFUNC_IMPL_ADD (array, i, rawmemchr,
-                             hwcap2 & PPC_FEATURE2_ARCH_3_00,
+                             hwcap2 & PPC_FEATURE2_ARCH_3_00
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __rawmemchr_power9)
 #endif
              IFUNC_IMPL_ADD (array, i, rawmemchr,
@@ -288,7 +311,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c.  */
   IFUNC_IMPL (i, name, strnlen,
              IFUNC_IMPL_ADD (array, i, strnlen,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strnlen_power8)
              IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_ARCH_2_06,
                              __strnlen_power7)
@@ -298,7 +322,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c.  */
   IFUNC_IMPL (i, name, strcasecmp,
              IFUNC_IMPL_ADD (array, i, strcasecmp,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strcasecmp_power8)
              IFUNC_IMPL_ADD (array, i, strcasecmp,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -316,7 +341,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c.  */
   IFUNC_IMPL (i, name, strncasecmp,
              IFUNC_IMPL_ADD (array, i, strncasecmp,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                              && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strncasecmp_power8)
              IFUNC_IMPL_ADD (array, i, strncasecmp,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -334,7 +360,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c.  */
   IFUNC_IMPL (i, name, strrchr,
              IFUNC_IMPL_ADD (array, i, strrchr,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strrchr_power8)
              IFUNC_IMPL_ADD (array, i, strrchr,
                              hwcap & PPC_FEATURE_ARCH_2_06,
@@ -345,10 +372,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c.  */
   IFUNC_IMPL (i, name, strncat,
              IFUNC_IMPL_ADD (array, i, strncat,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strncat_power8)
              IFUNC_IMPL_ADD (array, i, strncat,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strncat_power7)
              IFUNC_IMPL_ADD (array, i, strncat, 1,
                              __strncat_ppc))
@@ -391,7 +420,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   IFUNC_IMPL (i, name, strcmp,
 #ifdef __LITTLE_ENDIAN__
              IFUNC_IMPL_ADD (array, i, strcmp,
-                             hwcap2 & PPC_FEATURE2_ARCH_3_00,
+                             hwcap2 & PPC_FEATURE2_ARCH_3_00
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strcmp_power9)
 #endif
              IFUNC_IMPL_ADD (array, i, strcmp,
@@ -406,10 +436,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c.  */
   IFUNC_IMPL (i, name, strcat,
              IFUNC_IMPL_ADD (array, i, strcat,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strcat_power8)
              IFUNC_IMPL_ADD (array, i, strcat,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strcat_power7)
              IFUNC_IMPL_ADD (array, i, strcat, 1,
                             __strcat_ppc))
@@ -417,7 +449,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c.  */
   IFUNC_IMPL (i, name, strspn,
              IFUNC_IMPL_ADD (array, i, strspn,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strspn_power8)
              IFUNC_IMPL_ADD (array, i, strspn, 1,
                              __strspn_ppc))
@@ -425,7 +458,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c.  */
   IFUNC_IMPL (i, name, strcspn,
              IFUNC_IMPL_ADD (array, i, strcspn,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_VSX,
                              __strcspn_power8)
              IFUNC_IMPL_ADD (array, i, strcspn, 1,
                              __strcspn_ppc))
@@ -442,7 +476,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcasestr.c.  */
   IFUNC_IMPL (i, name, strcasestr,
              IFUNC_IMPL_ADD (array, i, strcasestr,
-                             hwcap2 & PPC_FEATURE2_ARCH_2_07,
+                             hwcap2 & PPC_FEATURE2_ARCH_2_07
+                             && hwcap & PPC_FEATURE_HAS_ALTIVEC,
                              __strcasestr_power8)
              IFUNC_IMPL_ADD (array, i, strcasestr, 1,
                              __strcasestr_ppc))
index c24186689e59b35c86975ec0948bae561f5d2d04..f40013e06113096fe564916b1a7302e742b9d870 100644 (file)
@@ -28,7 +28,8 @@ extern __typeof (__memchr) __memchr_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc (__memchr,
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC)
            ? __memchr_power8 :
            (hwcap & PPC_FEATURE_ARCH_2_06)
             ? __memchr_power7
index 99559bce26f9f8c3803e937698a734c123241721..89b56c103bbf937dfe928849203843f7c7c41426 100644 (file)
@@ -38,7 +38,8 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp,
                                 && hwcap & PPC_FEATURE_HAS_VSX)
                                 ? __memcmp_power10 :
 #endif
-                      (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                      (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                       && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                       ? __memcmp_power8 :
                       (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __memcmp_power7
index 53ab32ef26c7a9db393daa6ed22a81848cf5f01c..684ee064f23f44e85ea12a9d061ee4f367e87067 100644 (file)
@@ -45,9 +45,12 @@ libc_ifunc (__libc_memcpy,
            (hwcap2 & PPC_FEATURE2_ARCH_3_1 && hwcap & PPC_FEATURE_HAS_VSX)
            ? __memcpy_power10 :
 # endif
-           ((hwcap2 & PPC_FEATURE2_ARCH_2_07) && use_cached_memopt)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC
+            && use_cached_memopt)
            ? __memcpy_power8_cached :
-             (hwcap & PPC_FEATURE_HAS_VSX)
+             (hwcap & PPC_FEATURE_ARCH_2_06
+              && hwcap & PPC_FEATURE_HAS_ALTIVEC)
              ? __memcpy_power7 :
                (hwcap & PPC_FEATURE_ARCH_2_06)
                ? __memcpy_a2 :
index 637b2cbf7f3527a392255bb071a2a4e992795d44..50253b4554f96eaadcaa280f87b4bcad0c7013d7 100644 (file)
@@ -41,7 +41,8 @@ libc_ifunc (__libc_memmove,
             && hwcap & PPC_FEATURE_HAS_VSX)
            ? __memmove_power10 :
 #endif
-                    (hwcap & PPC_FEATURE_HAS_VSX)
+                    (hwcap & PPC_FEATURE_ARCH_2_06
+                     && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                     ? __memmove_power7
                     : __memmove_ppc);
 
index b37e0f35b504b677a27e368e657083095fcebddc..563095a5ec98758000350ecada0c04350720a159 100644 (file)
@@ -33,7 +33,8 @@ extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect___mempcpy, __mempcpy,
-                      (hwcap & PPC_FEATURE_HAS_VSX)
+                      (hwcap & PPC_FEATURE_ARCH_2_06
+                       && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                       ? __mempcpy_power7
                       : __mempcpy_ppc);
 
index 16bb6f004214efcd55513a91a85070c6b3ad0991..a8b985b06a89767bedde4c4ee84e1e5232fe3e9f 100644 (file)
@@ -28,7 +28,8 @@ extern __typeof (__memrchr) __memrchr_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc (__memrchr,
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC)
            ? __memrchr_power8 :
              (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __memrchr_power7
index 056e911699b2f3746beef039945cb7344f44f89a..a2bc223bcc919fcb342c237ffb6926c9a91396d9 100644 (file)
@@ -48,6 +48,7 @@ libc_ifunc (__libc_memset,
            ? __memset_power10 :
 # endif
             (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC
             && GLRO(dl_cache_line_size) == 128)
             ? __memset_power8 :
              (hwcap & PPC_FEATURE_ARCH_2_06
index b5d2d3a63542b447d4e0957d4c3efec286d56779..43eb459e025d51f3ed926e39ed1ab64dc551a887 100644 (file)
@@ -38,7 +38,8 @@ libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
                     (hwcap2 & PPC_FEATURE2_ARCH_3_1)
                     && (hwcap & PPC_FEATURE_HAS_VSX)
                     ? __rawmemchr_power10 :
-                      (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+                      (hwcap2 & PPC_FEATURE2_ARCH_3_00
+                       && hwcap & PPC_FEATURE_HAS_VSX)
                       ? __rawmemchr_power9 :
 # endif
                         (hwcap & PPC_FEATURE_ARCH_2_06)
index d4eb4285fc3f61a6af9492b276bd7d9fd4c57baf..5be413405ee8b58b55e2721f213f5cc0b47b2035 100644 (file)
@@ -32,12 +32,15 @@ extern __typeof (__stpcpy) __stpcpy_power9 attribute_hidden;
 
 libc_ifunc_hidden (__stpcpy, __stpcpy,
 # ifdef __LITTLE_ENDIAN__
-                  (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+                  (hwcap2 & PPC_FEATURE2_ARCH_3_00
+                   && hwcap & PPC_FEATURE_HAS_VSX)
                   ? __stpcpy_power9 :
 # endif
-                    (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                    (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                     && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                     ? __stpcpy_power8
-                    : (hwcap & PPC_FEATURE_HAS_VSX)
+                    : (hwcap & PPC_FEATURE_ARCH_2_06
+                       && hwcap & PPC_FEATURE_HAS_VSX)
                       ? __stpcpy_power7
                       : __stpcpy_ppc);
 
index 55ca6c85c41619fdf96e9a848945df3a74531762..21ce2d279b993f2183d622e1ea67afb9e23881c1 100644 (file)
@@ -27,7 +27,8 @@ extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
 extern __typeof (__strcasecmp) __strcasecmp_power8 attribute_hidden;
 
 libc_ifunc (__libc_strcasecmp,
-            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+            (hwcap2 & PPC_FEATURE2_ARCH_2_07
+             && hwcap & PPC_FEATURE_HAS_ALTIVEC)
              ? __strcasecmp_power8:
             (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strcasecmp_power7
index 7e4bd3b5ac9835d2a5b258e089e3601c0969a0f2..5bb3016022883549a6b913152fbc0ed45309e99c 100644 (file)
@@ -27,7 +27,8 @@ extern __typeof (__strcasestr) __strcasestr_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc (__strcasestr,
-               (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+               (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                ? __strcasestr_power8
                : __strcasestr_ppc);
 
index 6d342324c4de4db7d7fd325388aedc981ad8372d..d8d98708249f1be0e6eea4dcbce921bda93600e1 100644 (file)
@@ -28,9 +28,11 @@ extern __typeof (strcat) __strcat_power8 attribute_hidden;
 # undef strcat
 
 libc_ifunc_redirected (__redirect_strcat, strcat,
-                      (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                      (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                       && hwcap & PPC_FEATURE_HAS_VSX)
                       ? __strcat_power8
-                      : (hwcap & PPC_FEATURE_HAS_VSX)
+                      : (hwcap & PPC_FEATURE_ARCH_2_06
+                         && hwcap & PPC_FEATURE_HAS_VSX)
                         ? __strcat_power7
                         : __strcat_ppc);
 #endif
index 27c794c6b73585f42a44c2e59c2e515b492f3236..62b202baf90836f80fd32f7929ad900c165108d7 100644 (file)
@@ -33,7 +33,8 @@ extern __typeof (strchr) __strchr_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_strchr, strchr,
-                      (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                      (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                       && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                       ? __strchr_power8 :
                       (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __strchr_power7
index 4a07b4a2420ef8b23d8a12fdfb61b62e8f2ef63d..40e529b9d984f0ebaf623317e600fa558317bf53 100644 (file)
@@ -28,7 +28,8 @@ extern __typeof (__strchrnul) __strchrnul_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc (__strchrnul,
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC)
            ? __strchrnul_power8 :
            (hwcap & PPC_FEATURE_ARCH_2_06)
             ? __strchrnul_power7
index 4b0b25fff6ea180f38b1e6f988df1d6e0ff70377..8132682a992edb7ab6656b9a29dc078c614d4b9f 100644 (file)
@@ -35,7 +35,8 @@ extern __typeof (strcmp) __strcmp_power9 attribute_hidden;
 
 libc_ifunc_redirected (__redirect_strcmp, strcmp,
 # ifdef __LITTLE_ENDIAN__
-                       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+                       (hwcap2 & PPC_FEATURE2_ARCH_3_00
+                        && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                        ? __strcmp_power9 :
 # endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
index b733fa5a239c054f05a8fee42808364e5b8192d3..5af1d45cc17b33a54e8090ecf5ebe20bfbcd2aca 100644 (file)
@@ -32,12 +32,15 @@ extern __typeof (strcpy) __strcpy_power9 attribute_hidden;
 
 libc_ifunc_redirected (__redirect_strcpy, strcpy,
 # ifdef __LITTLE_ENDIAN__
-                       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+                       (hwcap2 & PPC_FEATURE2_ARCH_3_00
+                        && hwcap & PPC_FEATURE_HAS_VSX)
                        ? __strcpy_power9 :
 # endif
-                      (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                      (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                       && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                       ? __strcpy_power8
-                      : (hwcap & PPC_FEATURE_HAS_VSX)
+                      : (hwcap & PPC_FEATURE_ARCH_2_06
+                         && hwcap & PPC_FEATURE_HAS_VSX)
                         ? __strcpy_power7
                         : __strcpy_ppc);
 #endif
index 683aa104d7099ec23fa3210958d12869b82b7ea6..8ba01c13b1795938d75007c440e47634d7405baf 100644 (file)
@@ -27,7 +27,8 @@ extern __typeof (strcspn) __strcspn_ppc attribute_hidden;
 extern __typeof (strcspn) __strcspn_power8 attribute_hidden;
 
 libc_ifunc (__libc_strcspn,
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_VSX)
            ? __strcspn_power8
            : __strcspn_ppc);
 
index 0cd1c6faff14e262ed2d10f00d6127773112e752..f1e28414e0e5f42c5176781744d2e01c7cc33c0b 100644 (file)
@@ -35,12 +35,15 @@ extern __typeof (__redirect_strlen) __strlen_power10 attribute_hidden;
 
 libc_ifunc (__libc_strlen,
 # ifdef __LITTLE_ENDIAN__
-       (hwcap2 & PPC_FEATURE2_ARCH_3_1)
+       (hwcap2 & PPC_FEATURE2_ARCH_3_1
+        && hwcap & PPC_FEATURE_HAS_VSX)
        ? __strlen_power10 :
-         (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+         (hwcap2 & PPC_FEATURE2_ARCH_3_00
+          && hwcap & PPC_FEATURE_HAS_VSX)
          ? __strlen_power9 :
 # endif
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_ALTIVEC)
            ? __strlen_power8 :
              (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strlen_power7
index 644046bd742b2155b5f33ea9f7815cbecedd6581..2802cf2c3f38a91dc02edf58ff8e3226c2c896ca 100644 (file)
@@ -27,7 +27,8 @@ extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
 extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden;
 
 libc_ifunc (__libc_strncasecmp,
-            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+            (hwcap2 & PPC_FEATURE2_ARCH_2_07
+             && hwcap & PPC_FEATURE_HAS_ALTIVEC)
              ? __strncasecmp_power8:
             (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strncasecmp_power7
index 0036fca91a1b5c529cb726fb11c1cb7c051fbb71..9ea294a72db2596cb8d71c835e66b381301cd888 100644 (file)
@@ -26,9 +26,11 @@ extern __typeof (strncat) __strncat_power7 attribute_hidden;
 extern __typeof (strncat) __strncat_power8 attribute_hidden;
 
 libc_ifunc (strncat,
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_VSX)
            ? __strncat_power8
-           : (hwcap & PPC_FEATURE_HAS_VSX)
+           : (hwcap & PPC_FEATURE_ARCH_2_06
+              && hwcap & PPC_FEATURE_HAS_VSX)
             ? __strncat_power7
             : __strncat_ppc);
 #endif
index 1f689e5c05c5b4b6487ba49dea8063b3f08cd1c5..2d2112285445a450a25b0083cebafe0bd2220944 100644 (file)
@@ -38,7 +38,8 @@ extern __typeof (strncmp) __strncmp_power9 attribute_hidden;
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_strncmp, strncmp,
 # ifdef __LITTLE_ENDIAN__
-                       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+                       (hwcap2 & PPC_FEATURE2_ARCH_3_00
+                        && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                        ? __strncmp_power9 :
 # endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
index baf375a75a1c33a94917637667175a2128a380db..e68e9d9f8818f834073c12368d8826b0f7668a11 100644 (file)
@@ -29,7 +29,8 @@ extern __typeof (__strnlen) __strnlen_power8 attribute_hidden;
 # undef strnlen
 # undef __strnlen
 libc_ifunc_redirected (__redirect___strnlen, __strnlen,
-                      (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                      (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                       && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                       ? __strnlen_power8 :
                         (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __strnlen_power7
index 1c9eea1817f513ddfd2d9c4947086bb6f3e69e09..7f0cf2a1b7542b6dafeef6b3754f5894a82c2746 100644 (file)
@@ -31,7 +31,8 @@ extern __typeof (strrchr) __strrchr_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_strrchr, strrchr,
-                      (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+                      (hwcap2 & PPC_FEATURE2_ARCH_2_07
+                       && hwcap & PPC_FEATURE_HAS_ALTIVEC)
                       ? __strrchr_power8 :
                       (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __strrchr_power7
index 70167a176bc2f330ff4e63632b4135f7428d4287..7613ab3d55dfc7a837290c525ff5c99f6aae2f99 100644 (file)
@@ -27,7 +27,8 @@ extern __typeof (strspn) __strspn_ppc attribute_hidden;
 extern __typeof (strspn) __strspn_power8 attribute_hidden;
 
 libc_ifunc (__libc_strspn,
-           (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+           (hwcap2 & PPC_FEATURE2_ARCH_2_07
+            && hwcap & PPC_FEATURE_HAS_VSX)
            ? __strspn_power8
            : __strspn_ppc);