powerpc64: Replace some PPC_FEATURE_HAS_VSX with PPC_FEATURE_ARCH_2_06
authorAnton Blanchard <anton@ozlabs.org>
Tue, 27 Jul 2021 05:47:49 +0000 (15:47 +1000)
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Fri, 6 Aug 2021 19:09:52 +0000 (16:09 -0300)
We use PPC_FEATURE_HAS_VSX to select a number of POWER7 optimised
functions. These functions don't use any VSX instructions, so
PPC_FEATURE_ARCH_2_06 seems like a better fit.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
20 files changed:
sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
sysdeps/powerpc/powerpc64/multiarch/memchr.c
sysdeps/powerpc/powerpc64/multiarch/memcmp.c
sysdeps/powerpc/powerpc64/multiarch/memrchr.c
sysdeps/powerpc/powerpc64/multiarch/memset.c
sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
sysdeps/powerpc/powerpc64/multiarch/stpncpy.c
sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c
sysdeps/powerpc/powerpc64/multiarch/strchr.c
sysdeps/powerpc/powerpc64/multiarch/strchrnul.c
sysdeps/powerpc/powerpc64/multiarch/strcmp.c
sysdeps/powerpc/powerpc64/multiarch/strlen.c
sysdeps/powerpc/powerpc64/multiarch/strncase.c
sysdeps/powerpc/powerpc64/multiarch/strncase_l.c
sysdeps/powerpc/powerpc64/multiarch/strncmp.c
sysdeps/powerpc/powerpc64/multiarch/strncpy.c
sysdeps/powerpc/powerpc64/multiarch/strnlen.c
sysdeps/powerpc/powerpc64/multiarch/strrchr.c
sysdeps/powerpc/powerpc64/multiarch/strstr.c

index 0acdf22..32564c8 100644 (file)
@@ -95,7 +95,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 #endif
              IFUNC_IMPL_ADD (array, i, memset, hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __memset_power8)
-             IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_06,
                              __memset_power7)
              IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05,
                              __memset_power6)
@@ -139,7 +139,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 #endif
              IFUNC_IMPL_ADD (array, i, strlen, hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strlen_power8)
-             IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_ARCH_2_06,
                              __strlen_power7)
              IFUNC_IMPL_ADD (array, i, strlen, 1,
                              __strlen_ppc))
@@ -152,7 +152,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 #endif
              IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strncmp_power8)
-             IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_ARCH_2_06,
                              __strncmp_power7)
              IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_POWER4,
                              __strncmp_power4)
@@ -165,7 +165,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strchr_power8)
              IFUNC_IMPL_ADD (array, i, strchr,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strchr_power7)
              IFUNC_IMPL_ADD (array, i, strchr, 1,
                              __strchr_ppc))
@@ -176,7 +176,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strchrnul_power8)
              IFUNC_IMPL_ADD (array, i, strchrnul,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strchrnul_power7)
              IFUNC_IMPL_ADD (array, i, strchrnul, 1,
                              __strchrnul_ppc))
@@ -192,7 +192,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 #endif
              IFUNC_IMPL_ADD (array, i, memcmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __memcmp_power8)
-             IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_ARCH_2_06,
                              __memcmp_power7)
              IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
                              __memcmp_power4)
@@ -244,7 +244,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __memchr_power8)
              IFUNC_IMPL_ADD (array, i, memchr,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __memchr_power7)
              IFUNC_IMPL_ADD (array, i, memchr, 1,
                              __memchr_ppc))
@@ -255,7 +255,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __memrchr_power8)
              IFUNC_IMPL_ADD (array, i, memrchr,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __memrchr_power7)
              IFUNC_IMPL_ADD (array, i, memrchr, 1,
                              __memrchr_ppc))
@@ -272,7 +272,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              __rawmemchr_power9)
 #endif
              IFUNC_IMPL_ADD (array, i, rawmemchr,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __rawmemchr_power7)
              IFUNC_IMPL_ADD (array, i, rawmemchr, 1,
                              __rawmemchr_ppc))
@@ -282,7 +282,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
              IFUNC_IMPL_ADD (array, i, strnlen,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strnlen_power8)
-             IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
+             IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_ARCH_2_06,
                              __strnlen_power7)
              IFUNC_IMPL_ADD (array, i, strnlen, 1,
                              __strnlen_ppc))
@@ -293,14 +293,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strcasecmp_power8)
              IFUNC_IMPL_ADD (array, i, strcasecmp,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strcasecmp_power7)
              IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc))
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c.  */
   IFUNC_IMPL (i, name, strcasecmp_l,
              IFUNC_IMPL_ADD (array, i, strcasecmp_l,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strcasecmp_l_power7)
              IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
                              __strcasecmp_l_ppc))
@@ -311,14 +311,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strncasecmp_power8)
              IFUNC_IMPL_ADD (array, i, strncasecmp,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strncasecmp_power7)
              IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc))
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c.  */
   IFUNC_IMPL (i, name, strncasecmp_l,
              IFUNC_IMPL_ADD (array, i, strncasecmp_l,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strncasecmp_l_power7)
              IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
                              __strncasecmp_l_ppc))
@@ -329,7 +329,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strrchr_power8)
              IFUNC_IMPL_ADD (array, i, strrchr,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strrchr_power7)
              IFUNC_IMPL_ADD (array, i, strrchr, 1,
                              __strrchr_ppc))
@@ -357,7 +357,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strncpy_power8)
              IFUNC_IMPL_ADD (array, i, strncpy,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strncpy_power7)
              IFUNC_IMPL_ADD (array, i, strncpy, 1,
                             __strncpy_ppc))
@@ -374,7 +374,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __stpncpy_power8)
              IFUNC_IMPL_ADD (array, i, stpncpy,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __stpncpy_power7)
              IFUNC_IMPL_ADD (array, i, stpncpy, 1,
                             __stpncpy_ppc))
@@ -390,7 +390,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
                              hwcap2 & PPC_FEATURE2_ARCH_2_07,
                              __strcmp_power8)
              IFUNC_IMPL_ADD (array, i, strcmp,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strcmp_power7)
              IFUNC_IMPL_ADD (array, i, strcmp, 1,
                             __strcmp_ppc))
@@ -425,7 +425,7 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   /* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c.  */
   IFUNC_IMPL (i, name, strstr,
              IFUNC_IMPL_ADD (array, i, strstr,
-                             hwcap & PPC_FEATURE_HAS_VSX,
+                             hwcap & PPC_FEATURE_ARCH_2_06,
                              __strstr_power7)
              IFUNC_IMPL_ADD (array, i, strstr, 1,
                              __strstr_ppc))
index 0c718d4..c241866 100644 (file)
@@ -30,7 +30,7 @@ extern __typeof (__memchr) __memchr_power8 attribute_hidden;
 libc_ifunc (__memchr,
            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
            ? __memchr_power8 :
-           (hwcap & PPC_FEATURE_HAS_VSX)
+           (hwcap & PPC_FEATURE_ARCH_2_06)
             ? __memchr_power7
             : __memchr_ppc);
 
index 4fd089a..99559bc 100644 (file)
@@ -40,7 +40,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp,
 #endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __memcmp_power8 :
-                      (hwcap & PPC_FEATURE_HAS_VSX)
+                      (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __memcmp_power7
                       : (hwcap & PPC_FEATURE_POWER4)
                         ? __memcmp_power4
index e06d646..16bb6f0 100644 (file)
@@ -30,7 +30,7 @@ extern __typeof (__memrchr) __memrchr_power8 attribute_hidden;
 libc_ifunc (__memrchr,
            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
            ? __memrchr_power8 :
-             (hwcap & PPC_FEATURE_HAS_VSX)
+             (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __memrchr_power7
            : __memrchr_ppc);
 
index 5994bf0..c1aa143 100644 (file)
@@ -48,7 +48,7 @@ libc_ifunc (__libc_memset,
 # endif
             (hwcap2 & PPC_FEATURE2_ARCH_2_07)
             ? __memset_power8 :
-             (hwcap & PPC_FEATURE_HAS_VSX)
+             (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __memset_power7 :
                (hwcap & PPC_FEATURE_ARCH_2_05)
                ? __memset_power6 :
index c0ffea2..b5d2d3a 100644 (file)
@@ -41,7 +41,7 @@ libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
                       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
                       ? __rawmemchr_power9 :
 # endif
-                        (hwcap & PPC_FEATURE_HAS_VSX)
+                        (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __rawmemchr_power7
                       : __rawmemchr_ppc);
 
index bebd377..e703576 100644 (file)
@@ -40,7 +40,7 @@ libc_ifunc_redirected (__redirect___stpncpy, __stpncpy,
 # endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __stpncpy_power8
-                      : (hwcap & PPC_FEATURE_HAS_VSX)
+                      : (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __stpncpy_power7
                         : __stpncpy_ppc);
 weak_alias (__stpncpy, stpncpy)
index dcd7774..55ca6c8 100644 (file)
@@ -29,7 +29,7 @@ extern __typeof (__strcasecmp) __strcasecmp_power8 attribute_hidden;
 libc_ifunc (__libc_strcasecmp,
             (hwcap2 & PPC_FEATURE2_ARCH_2_07)
              ? __strcasecmp_power8:
-            (hwcap & PPC_FEATURE_HAS_VSX)
+            (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strcasecmp_power7
              : __strcasecmp_ppc);
 
index 96a70b8..1afee5d 100644 (file)
@@ -32,7 +32,7 @@ extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
 
 extern __typeof (__strcasecmp_l) __libc_strcasecmp_l;
 libc_ifunc (__libc_strcasecmp_l,
-           (hwcap & PPC_FEATURE_HAS_VSX)
+           (hwcap & PPC_FEATURE_ARCH_2_06)
             ? __strcasecmp_l_power7
             : __strcasecmp_l_ppc);
 
index ea9ac11..27c794c 100644 (file)
@@ -35,7 +35,7 @@ extern __typeof (strchr) __strchr_power8 attribute_hidden;
 libc_ifunc_redirected (__redirect_strchr, strchr,
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __strchr_power8 :
-                      (hwcap & PPC_FEATURE_HAS_VSX)
+                      (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __strchr_power7
                       : __strchr_ppc);
 weak_alias (strchr, index)
index 4688e7c..4a07b4a 100644 (file)
@@ -30,7 +30,7 @@ extern __typeof (__strchrnul) __strchrnul_power8 attribute_hidden;
 libc_ifunc (__strchrnul,
            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
            ? __strchrnul_power8 :
-           (hwcap & PPC_FEATURE_HAS_VSX)
+           (hwcap & PPC_FEATURE_ARCH_2_06)
             ? __strchrnul_power7
             : __strchrnul_ppc);
 
index 72f9a63..4b0b25f 100644 (file)
@@ -40,7 +40,7 @@ libc_ifunc_redirected (__redirect_strcmp, strcmp,
 # endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __strcmp_power8
-                      : (hwcap & PPC_FEATURE_HAS_VSX)
+                      : (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __strcmp_power7
                         : __strcmp_ppc);
 #endif
index 109c8a9..0cd1c6f 100644 (file)
@@ -42,7 +42,7 @@ libc_ifunc (__libc_strlen,
 # endif
            (hwcap2 & PPC_FEATURE2_ARCH_2_07)
            ? __strlen_power8 :
-             (hwcap & PPC_FEATURE_HAS_VSX)
+             (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strlen_power7
              : __strlen_ppc);
 
index 2013a5d..644046b 100644 (file)
@@ -29,7 +29,7 @@ extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden;
 libc_ifunc (__libc_strncasecmp,
             (hwcap2 & PPC_FEATURE2_ARCH_2_07)
              ? __strncasecmp_power8:
-            (hwcap & PPC_FEATURE_HAS_VSX)
+            (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strncasecmp_power7
              : __strncasecmp_ppc);
 
index cad6da3..d2d761a 100644 (file)
@@ -34,7 +34,7 @@ extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
    ifunc symbol properly.  */
 extern __typeof (__strncasecmp_l) __libc_strncasecmp_l;
 libc_ifunc (__libc_strncasecmp_l,
-            (hwcap & PPC_FEATURE_HAS_VSX)
+            (hwcap & PPC_FEATURE_ARCH_2_06)
              ? __strncasecmp_l_power7
              : __strncasecmp_l_ppc);
 
index eef524d..1f689e5 100644 (file)
@@ -43,7 +43,7 @@ libc_ifunc_redirected (__redirect_strncmp, strncmp,
 # endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __strncmp_power8
-                      : (hwcap & PPC_FEATURE_HAS_VSX)
+                      : (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __strncmp_power7
                         : (hwcap & PPC_FEATURE_POWER4)
                           ? __strncmp_power4
index 7da9def..d4d3463 100644 (file)
@@ -43,7 +43,7 @@ libc_ifunc_redirected (__redirect_strncpy, strncpy,
 # endif
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __strncpy_power8
-                      : (hwcap & PPC_FEATURE_HAS_VSX)
+                      : (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __strncpy_power7
                         : __strncpy_ppc);
 
index 264b7a7..baf375a 100644 (file)
@@ -31,7 +31,7 @@ extern __typeof (__strnlen) __strnlen_power8 attribute_hidden;
 libc_ifunc_redirected (__redirect___strnlen, __strnlen,
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __strnlen_power8 :
-                        (hwcap & PPC_FEATURE_HAS_VSX)
+                        (hwcap & PPC_FEATURE_ARCH_2_06)
                         ? __strnlen_power7
                         : __strnlen_ppc);
 weak_alias (__strnlen, strnlen)
index bb06b93..1c9eea1 100644 (file)
@@ -33,7 +33,7 @@ extern __typeof (strrchr) __strrchr_power8 attribute_hidden;
 libc_ifunc_redirected (__redirect_strrchr, strrchr,
                       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
                       ? __strrchr_power8 :
-                      (hwcap & PPC_FEATURE_HAS_VSX)
+                      (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __strrchr_power7
                       : __strrchr_ppc);
 weak_alias (strrchr, rindex)
index bb05888..6582798 100644 (file)
@@ -30,7 +30,7 @@ extern __typeof (strstr) __strstr_power7 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_strstr, strstr,
-                      (hwcap & PPC_FEATURE_HAS_VSX)
+                      (hwcap & PPC_FEATURE_ARCH_2_06)
                       ? __strstr_power7
                       : __strstr_ppc);
 #endif