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