Patchwork [i386] cpuid function for prefetchw

login
register
mail settings
Submitter Gopalasubramanian, Ganesh
Date Aug. 13, 2012, 9:29 a.m.
Message ID <EB4625145972F94C9680D8CADD6516152A0715D8@sausexdag04.amd.com>
Download mbox | patch
Permalink /patch/176889/
State New
Headers show

Comments

Gopalasubramanian, Ganesh - Aug. 13, 2012, 9:29 a.m.
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.Gopalasubramanian@amd.com>
        
        PR driver/54210
        * config/i386/driver-i386.c (host_detect_local_cpu): Call
        cpuid function 0x80000001 to get the prfchw cpuid flag. 

       has_longmode = edx & bit_LM;
       has_3dnowp = edx & bit_3DNOWP;
       has_3dnow = edx & bit_3DNOW;
+      has_prfchw = ecx & bit_PRFCHW;
     }

   if (!arch

Patch

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 @@