]> granicus.if.org Git - llvm/commitdiff
BMI2 support is indicated in bit eight of EBX, not nine.
authorEric Christopher <echristo@gmail.com>
Mon, 5 Aug 2019 21:25:59 +0000 (21:25 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 5 Aug 2019 21:25:59 +0000 (21:25 +0000)
See Intel SDM, Vol 2A, Table 3-8:
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf#page=296

Differential Revision: https://reviews.llvm.org/D65766

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367929 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Host.cpp

index d491912bdc0cfbf811d8dcc3ec4227834c05b8c8..3ad1495957bfe297df2de681e03ce465bedb63cd 100644 (file)
@@ -1034,7 +1034,7 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
     setFeature(X86::FEATURE_BMI);
   if (HasLeaf7 && ((EBX >> 5) & 1) && HasAVX)
     setFeature(X86::FEATURE_AVX2);
-  if (HasLeaf7 && ((EBX >> 9) & 1))
+  if (HasLeaf7 && ((EBX >> 8) & 1))
     setFeature(X86::FEATURE_BMI2);
   if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save)
     setFeature(X86::FEATURE_AVX512F);