This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf
- From: "craig.topper at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Oct 2011 00:06:18 +0000
- Subject: [Bug driver/50740] New: CPUID leaf 7 for BMI/BMI2/AVX2 feature detection not qualified with max_level and doesn't use subleaf
- Auto-submitted: auto-generated
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;