This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50740

             Bug #: 50740
           Summary: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not
                    qualified with max_level and doesn't use subleaf
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: craig.topper@gmail.com


The cpuid code for detecting BMI, BMI2, and AVX2 support needs to be qualified
with max_level >= 7. Additionally, it should use __cpuid_count instead of
__cpuid because leaf 7 uses subleafs just like leaf 4.

Relevant code from i386-driver.c

      __cpuid (0x7, eax, ebx, ecx, edx);

      has_bmi = ebx & bit_BMI;
      has_avx2 = ebx & bit_AVX2;
      has_bmi2 = ebx & bit_BMI2;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]