about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2020-10-02 10:18:48 -0300
committerTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>2021-02-17 13:38:29 -0300
commit569f620ecdc051d55d08a53494258a95cd345d91 (patch)
treed75f0a2756a90fcfe7da0f2badacda35b93613c6
parentb50bbee77534c25c341c38702866b2cdf35f3494 (diff)
downloadglibc-tuliom/microwatt.tar.gz
glibc-tuliom/microwatt.tar.xz
glibc-tuliom/microwatt.zip
powerpc64: Stop assuming new processors have VSX tuliom/microwatt
VSX has been available on IBM POWER since POWER7.  All IBM processors
compliant with POWER ISAs 2.07, 3.0 and 3.1 also support VSX.
This patch aims to remove a barrier for new processors as they start to
support Linux on powerpc64 while not having support for all the altivec
and vsx instructions.
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/bzero.c1
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c102
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memchr.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcmp.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memcpy.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memrchr.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/memset.c1
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/stpcpy.c6
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcasestr.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcat.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strchr.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcmp.c8
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcpy.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strcspn.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strlen.c4
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncase.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncat.c2
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strncmp.c6
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strnlen.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strrchr.c3
-rw-r--r--sysdeps/powerpc/powerpc64/multiarch/strspn.c2
23 files changed, 113 insertions, 55 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/bzero.c b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
index 305b01537f..b5f66531de 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/bzero.c
@@ -30,6 +30,7 @@ extern __typeof (bzero) __bzero_power8 attribute_hidden;
 
 libc_ifunc (__bzero,
 	    (hwcap2 & PPC_FEATURE2_ARCH_2_07
+	     && hwcap & PPC_FEATURE_HAS_VSX
 	     && __GLRO(dl_cache_line_size) == 0x80)
 	    ? __bzero_power8 :
 	    (hwcap & PPC_FEATURE_HAS_VSX
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 72f7f83e7e..3b4d6a00f2 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -51,7 +51,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 #ifdef SHARED
   /* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c.  */
   IFUNC_IMPL (i, name, memcpy,
-	      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_VSX,
 			      __memcpy_power8_cached)
 	      IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
 			      __memcpy_power7)
@@ -73,7 +75,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/memset.c.  */
   IFUNC_IMPL (i, name, memset,
-	      IFUNC_IMPL_ADD (array, i, memset, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+	      IFUNC_IMPL_ADD (array, i, memset,
+			      hwcap2 & PPC_FEATURE2_ARCH_2_07
+			      && hwcap & PPC_FEATURE_HAS_VSX,
 			      __memset_power8)
 	      IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
 			      __memset_power7)
@@ -86,10 +90,14 @@ __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_VSX,
 			      __strcpy_power8)
 	      IFUNC_IMPL_ADD (array, i, strcpy, hwcap & PPC_FEATURE_HAS_VSX,
 			      __strcpy_power7)
@@ -99,10 +107,14 @@ __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_VSX,
 			      __stpcpy_power8)
 	      IFUNC_IMPL_ADD (array, i, stpcpy, hwcap & PPC_FEATURE_HAS_VSX,
 			      __stpcpy_power7)
@@ -112,10 +124,14 @@ __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_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_VSX,
 			      __strlen_power8)
 	      IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
 			      __strlen_power7)
@@ -125,10 +141,14 @@ __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_VSX,
 			      __strncmp_power9)
 #endif
-	      IFUNC_IMPL_ADD (array, i, strncmp, hwcap2 & PPC_FEATURE2_ARCH_2_07,
+	      IFUNC_IMPL_ADD (array, i, strncmp,
+			      hwcap2 & PPC_FEATURE2_ARCH_2_07
+			      && hwcap & PPC_FEATURE_HAS_VSX,
 			      __strncmp_power8)
 	      IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
 			      __strncmp_power7)
@@ -140,7 +160,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_VSX,
 			      __strchr_power8)
 	      IFUNC_IMPL_ADD (array, i, strchr,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -151,7 +172,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_VSX,
 			      __strchrnul_power8)
 	      IFUNC_IMPL_ADD (array, i, strchrnul,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -162,7 +184,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c.  */
   IFUNC_IMPL (i, name, memcmp,
-	      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_VSX,
 			      __memcmp_power8)
 	      IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
 			      __memcmp_power7)
@@ -172,7 +196,9 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c.  */
   IFUNC_IMPL (i, name, bzero,
-	      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_VSX,
 			      __bzero_power8)
 	      IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
 			      __bzero_power7)
@@ -199,7 +225,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_VSX,
 			      __memchr_power8)
 	      IFUNC_IMPL_ADD (array, i, memchr,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -210,7 +237,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_VSX,
 			      __memrchr_power8)
 	      IFUNC_IMPL_ADD (array, i, memrchr,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -222,7 +250,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
   IFUNC_IMPL (i, name, rawmemchr,
 #ifdef __LITTLE_ENDIAN__
 	      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,
@@ -234,7 +263,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_VSX,
 			      __strnlen_power8)
 	      IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
 			      __strnlen_power7)
@@ -244,7 +274,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_VSX,
 			      __strcasecmp_power8)
 	      IFUNC_IMPL_ADD (array, i, strcasecmp,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -262,7 +293,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_VSX,
 			      __strncasecmp_power8)
 	      IFUNC_IMPL_ADD (array, i, strncasecmp,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -280,7 +312,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_VSX,
 			      __strrchr_power8)
 	      IFUNC_IMPL_ADD (array, i, strrchr,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -291,7 +324,8 @@ __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,
@@ -308,7 +342,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strncpy_power9)
 #endif
 	      IFUNC_IMPL_ADD (array, i, strncpy,
-			      hwcap2 & PPC_FEATURE2_ARCH_2_07,
+			      hwcap2 & PPC_FEATURE2_ARCH_2_07
+			      && hwcap & PPC_FEATURE_HAS_VSX,
 			      __strncpy_power8)
 	      IFUNC_IMPL_ADD (array, i, strncpy,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -325,7 +360,8 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __stpncpy_power9)
 #endif
 	      IFUNC_IMPL_ADD (array, i, stpncpy,
-			      hwcap2 & PPC_FEATURE2_ARCH_2_07,
+			      hwcap2 & PPC_FEATURE2_ARCH_2_07
+			      && hwcap & PPC_FEATURE_HAS_VSX,
 			      __stpncpy_power8)
 	      IFUNC_IMPL_ADD (array, i, stpncpy,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -337,11 +373,13 @@ __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_VSX,
 			      __strcmp_power9)
 #endif
 	      IFUNC_IMPL_ADD (array, i, strcmp,
-			      hwcap2 & PPC_FEATURE2_ARCH_2_07,
+			      hwcap2 & PPC_FEATURE2_ARCH_2_07
+			      && hwcap & PPC_FEATURE_HAS_VSX,
 			      __strcmp_power8)
 	      IFUNC_IMPL_ADD (array, i, strcmp,
 			      hwcap & PPC_FEATURE_HAS_VSX,
@@ -352,7 +390,8 @@ __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,
@@ -363,7 +402,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))
@@ -371,7 +411,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))
@@ -388,7 +429,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_VSX,
 			      __strcasestr_power8)
              IFUNC_IMPL_ADD (array, i, strcasestr, 1,
                              __strcasestr_ppc))
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memchr.c b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
index 0c718d4f15..44f88febd4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memchr.c
@@ -28,7 +28,7 @@ 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_VSX)
 	    ? __memchr_power8 :
 	    (hwcap & PPC_FEATURE_HAS_VSX)
             ? __memchr_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
index 6fd53267b6..a4080f66a6 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcmp.c
@@ -32,7 +32,8 @@ extern __typeof (memcmp) __memcmp_power8 attribute_hidden;
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect_memcmp, memcmp,
-		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       (hwcap2 & PPC_FEATURE2_ARCH_2_07
+			&& hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __memcmp_power8 :
 		       (hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __memcmp_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
index 5733192932..a67be8c00a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memcpy.c
@@ -38,7 +38,8 @@ extern __typeof (__redirect_memcpy) __memcpy_power7 attribute_hidden;
 extern __typeof (__redirect_memcpy) __memcpy_power8_cached attribute_hidden;
 
 libc_ifunc (__libc_memcpy,
-	    ((hwcap2 & PPC_FEATURE2_ARCH_2_07) && use_cached_memopt)
+	    ((hwcap2 & PPC_FEATURE2_ARCH_2_07 && hwcap & PPC_FEATURE_HAS_VSX)
+	     && use_cached_memopt)
 	    ? __memcpy_power8_cached :
 	      (hwcap & PPC_FEATURE_HAS_VSX)
 	      ? __memcpy_power7 :
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
index e06d6468b8..d10b712e0d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memrchr.c
@@ -28,7 +28,7 @@ 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_VSX)
 	    ? __memrchr_power8 :
 	      (hwcap & PPC_FEATURE_HAS_VSX)
 	      ? __memrchr_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset.c b/sysdeps/powerpc/powerpc64/multiarch/memset.c
index dbc737b5d5..f99ae07189 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset.c
@@ -38,6 +38,7 @@ extern __typeof (__redirect_memset) __memset_power8 attribute_hidden;
    ifunc symbol properly.  */
 libc_ifunc (__libc_memset,
 	    (hwcap2 & PPC_FEATURE2_ARCH_2_07
+	     && hwcap & PPC_FEATURE_HAS_VSX
 	     && __GLRO(dl_cache_line_size) == 0x80)
 	    ? __memset_power8 :
 	    (hwcap & PPC_FEATURE_HAS_VSX
diff --git a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
index d906a4ea50..5cdfe02896 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c
@@ -34,7 +34,8 @@ extern __typeof (__rawmemchr) __rawmemchr_power9 attribute_hidden;
    ifunc symbol properly.  */
 libc_ifunc_redirected (__redirect___rawmemchr, __rawmemchr,
 # ifdef __LITTLE_ENDIAN__
-		       (hwcap2 & PPC_FEATURE2_ARCH_3_00)
+		       (hwcap2 & PPC_FEATURE2_ARCH_3_00
+			&& hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __rawmemchr_power9 :
 # endif
 		         (hwcap & PPC_FEATURE_HAS_VSX)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
index d4eb4285fc..8a5a46961d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/stpcpy.c
@@ -32,10 +32,12 @@ 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_VSX)
 		     ? __stpcpy_power8
 		     : (hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __stpcpy_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
index dcd7774403..b4fc924ca9 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c
@@ -27,7 +27,7 @@ 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_VSX)
              ? __strcasecmp_power8:
 	     (hwcap & PPC_FEATURE_HAS_VSX)
              ? __strcasecmp_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
index 7e4bd3b5ac..502200b116 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcasestr.c
@@ -27,7 +27,7 @@ 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_VSX)
 		? __strcasestr_power8
 		: __strcasestr_ppc);
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcat.c b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
index 6d342324c4..f45f58618d 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcat.c
@@ -28,7 +28,8 @@ 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)
 			 ? __strcat_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strchr.c b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
index ea9ac1134f..04e92716e4 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strchr.c
@@ -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_VSX)
 		       ? __strchr_power8 :
 		       (hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __strchr_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
index 72f9a639bf..dfb6a8836b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcmp.c
@@ -35,10 +35,12 @@ extern __typeof (strcmp) __strcmp_power9 attribute_hidden;
 
 libc_ifunc_redirected (__redirect_strcmp, strcmp,
 # ifdef __LITTLE_ENDIAN__
-			(hwcap2 & PPC_FEATURE2_ARCH_3_00)
-			? __strcmp_power9 :
+		       (hwcap2 & PPC_FEATURE2_ARCH_3_00
+		        && hwcap & PPC_FEATURE_HAS_VSX)
+		       ? __strcmp_power9 :
 # endif
-		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       (hwcap2 & PPC_FEATURE2_ARCH_2_07
+			&& hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __strcmp_power8
 		       : (hwcap & PPC_FEATURE_HAS_VSX)
 			 ? __strcmp_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
index b733fa5a23..fbb4c113be 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcpy.c
@@ -32,7 +32,8 @@ 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)
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
index 683aa104d7..316f8ae38e 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strcspn.c
@@ -27,7 +27,7 @@ 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);
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strlen.c b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
index c3bbc78df8..5c05bc7237 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strlen.c
@@ -34,10 +34,10 @@ extern __typeof (__redirect_strlen) __strlen_power9 attribute_hidden;
 
 libc_ifunc (__libc_strlen,
 # ifdef __LITTLE_ENDIAN__
-	  (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_VSX)
 	    ? __strlen_power8 :
 	      (hwcap & PPC_FEATURE_HAS_VSX)
 	      ? __strlen_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
index 2013a5d75a..030b212439 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncase.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c
@@ -27,7 +27,7 @@ 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_VSX)
              ? __strncasecmp_power8:
 	     (hwcap & PPC_FEATURE_HAS_VSX)
              ? __strncasecmp_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat.c b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
index 0036fca91a..27a1fa035a 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncat.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncat.c
@@ -26,7 +26,7 @@ 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)
             ? __strncat_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
index eef524ddfb..64531a9fab 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strncmp.c
@@ -38,10 +38,12 @@ 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_VSX)
 			? __strncmp_power9 :
 # endif
-		       (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+		       (hwcap2 & PPC_FEATURE2_ARCH_2_07
+			&& hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __strncmp_power8
 		       : (hwcap & PPC_FEATURE_HAS_VSX)
 			 ? __strncmp_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
index 264b7a752d..0536bbe50f 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strnlen.c
@@ -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_VSX)
 		       ? __strnlen_power8 :
 			 (hwcap & PPC_FEATURE_HAS_VSX)
 			 ? __strnlen_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
index bb06b93d19..9c433a7310 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strrchr.c
@@ -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_VSX)
 		       ? __strrchr_power8 :
 		       (hwcap & PPC_FEATURE_HAS_VSX)
 		       ? __strrchr_power7
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
index 70167a176b..dd140ad83b 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -27,7 +27,7 @@ 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);