e354a5
commit 9016b6f3893789ddfbd978aa572b46b3d3ce762f
e354a5
Author: H.J. Lu <hjl.tools@gmail.com>
e354a5
Date:   Sat Jul 11 09:04:34 2020 -0700
e354a5
e354a5
    x86: Remove the unused __x86_prefetchw
e354a5
    
e354a5
    Since
e354a5
    
e354a5
    commit c867597bff2562180a18da4b8dba89d24e8b65c4
e354a5
    Author: H.J. Lu <hjl.tools@gmail.com>
e354a5
    Date:   Wed Jun 8 13:57:50 2016 -0700
e354a5
    
e354a5
        X86-64: Remove previous default/SSE2/AVX2 memcpy/memmove
e354a5
    
e354a5
    removed the only usage of __x86_prefetchw, we can remove the unused
e354a5
    __x86_prefetchw.
e354a5
e354a5
Conflicts:
e354a5
	sysdeps/x86/cacheinfo.c
e354a5
	  (Different backport order downstream, related to cache
e354a5
	  comptuation.  Also had to remove the now-unused eax variable.)
e354a5
e354a5
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
e354a5
index c0a4fe15d47bff1c..41b345c6c6274c01 100644
e354a5
--- a/sysdeps/i386/Makefile
e354a5
+++ b/sysdeps/i386/Makefile
e354a5
@@ -13,10 +13,6 @@ ifeq ($(subdir),math)
e354a5
 CFLAGS-e_gamma_r.c += -DMATH_SET_BOTH_ROUNDING_MODES
e354a5
 endif
e354a5
 
e354a5
-ifeq ($(subdir),string)
e354a5
-sysdep_routines += cacheinfo
e354a5
-endif
e354a5
-
e354a5
 ifeq ($(subdir),gmon)
e354a5
 sysdep_routines += i386-mcount
e354a5
 endif
e354a5
diff --git a/sysdeps/i386/cacheinfo.c b/sysdeps/i386/cacheinfo.c
e354a5
deleted file mode 100644
e354a5
index f15fe0779afebb8f..0000000000000000
e354a5
--- a/sysdeps/i386/cacheinfo.c
e354a5
+++ /dev/null
e354a5
@@ -1,3 +0,0 @@
e354a5
-#define DISABLE_PREFETCHW
e354a5
-
e354a5
-#include <sysdeps/x86/cacheinfo.c>
e354a5
diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
e354a5
index a936134a577e42a5..962bbcb07eba1259 100644
e354a5
--- a/sysdeps/x86/Makefile
e354a5
+++ b/sysdeps/x86/Makefile
e354a5
@@ -14,6 +14,10 @@ gen-as-const-headers += jmp_buf-ssp.sym
e354a5
 sysdep_routines += __longjmp_cancel
e354a5
 endif
e354a5
 
e354a5
+ifeq ($(subdir),string)
e354a5
+sysdep_routines += cacheinfo
e354a5
+endif
e354a5
+
e354a5
 ifneq ($(enable-cet),no)
e354a5
 ifeq ($(subdir),elf)
e354a5
 sysdep-dl-routines += dl-cet
e354a5
diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c
e354a5
index c741a69fb19a1e95..f4edbc0103beb435 100644
e354a5
--- a/sysdeps/x86/cacheinfo.c
e354a5
+++ b/sysdeps/x86/cacheinfo.c
e354a5
@@ -536,11 +536,6 @@ long int __x86_rep_movsb_threshold attribute_hidden = 2048;
e354a5
 /* Threshold to use Enhanced REP STOSB.  */
e354a5
 long int __x86_rep_stosb_threshold attribute_hidden = 2048;
e354a5
 
e354a5
-#ifndef DISABLE_PREFETCHW
e354a5
-/* PREFETCHW support flag for use in memory and string routines.  */
e354a5
-int __x86_prefetchw attribute_hidden;
e354a5
-#endif
e354a5
-
e354a5
 
e354a5
 static void
e354a5
 get_common_cache_info (long int *shared_ptr, unsigned int *threads_ptr,
e354a5
@@ -765,7 +760,6 @@ __attribute__((constructor))
e354a5
 init_cacheinfo (void)
e354a5
 {
e354a5
   /* Find out what brand of processor.  */
e354a5
-  unsigned int eax;
e354a5
   unsigned int ebx;
e354a5
   unsigned int ecx;
e354a5
   unsigned int edx;
e354a5
@@ -846,16 +840,6 @@ init_cacheinfo (void)
e354a5
 	      shared += core;
e354a5
             }
e354a5
 	}
e354a5
-
e354a5
-#ifndef DISABLE_PREFETCHW
e354a5
-      if (max_cpuid_ex >= 0x80000001)
e354a5
-	{
e354a5
-	  __cpuid (0x80000001, eax, ebx, ecx, edx);
e354a5
-	  /*  PREFETCHW     || 3DNow!  */
e354a5
-	  if ((ecx & 0x100) || (edx & 0x80000000))
e354a5
-	    __x86_prefetchw = -1;
e354a5
-	}
e354a5
-#endif
e354a5
     }
e354a5
 
e354a5
   if (cpu_features->data_cache_size != 0)
e354a5
diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile
e354a5
index d51cf03ac92ebcc2..e3bb45d78811d70f 100644
e354a5
--- a/sysdeps/x86_64/Makefile
e354a5
+++ b/sysdeps/x86_64/Makefile
e354a5
@@ -18,7 +18,7 @@ tests += tst-mallocalign1
e354a5
 endif
e354a5
 
e354a5
 ifeq ($(subdir),string)
e354a5
-sysdep_routines += cacheinfo strcasecmp_l-nonascii strncase_l-nonascii
e354a5
+sysdep_routines += strcasecmp_l-nonascii strncase_l-nonascii
e354a5
 gen-as-const-headers += locale-defines.sym
e354a5
 endif
e354a5