Hello,

To get the prefetchw cpuid flag, cpuid
function 0x80000001 needs to be called.
Previous to patch, function 0x7 is called.

Bootstrapping and "make -k check" passes without failures.
Ok for trunk?

Regards
Ganesh

2012-08-13 Ganesh Gopalasubramanian  <ganesh.gopalasubraman...@amd.com>
        
        PR driver/54210
        * config/i386/driver-i386.c (host_detect_local_cpu): Call
        cpuid function 0x80000001 to get the prfchw cpuid flag. 

Index: gcc/config/i386/driver-i386.c
===================================================================
--- gcc/config/i386/driver-i386.c       (revision 189996)
+++ gcc/config/i386/driver-i386.c       (working copy)
@@ -467,7 +467,6 @@
       has_bmi2 = ebx & bit_BMI2;
       has_fsgsbase = ebx & bit_FSGSBASE;
       has_rdseed = ebx & bit_RDSEED;
-      has_prfchw = ecx & bit_PRFCHW;
     }

   /* Check cpuid level of extended features.  */ @@ -491,6 +490,7 @@
       has_longmode = edx & bit_LM;
       has_3dnowp = edx & bit_3DNOWP;
       has_3dnow = edx & bit_3DNOW;
+      has_prfchw = ecx & bit_PRFCHW;
     }

   if (!arch

Reply via email to