[PATCH] D65766: [X86] Test the right bit to detect BMI2

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 5 14:25:49 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL367929: BMI2 support is indicated in bit eight of EBX, not nine. (authored by echristo, committed by ).
Herald added subscribers: kristina, delcypher.

Changed prior to commit:
  https://reviews.llvm.org/D65766?vs=213430&id=213464#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65766/new/

https://reviews.llvm.org/D65766

Files:
  compiler-rt/trunk/lib/builtins/cpu_model.c
  llvm/trunk/lib/Support/Host.cpp


Index: llvm/trunk/lib/Support/Host.cpp
===================================================================
--- llvm/trunk/lib/Support/Host.cpp
+++ llvm/trunk/lib/Support/Host.cpp
@@ -1034,7 +1034,7 @@
     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);
Index: compiler-rt/trunk/lib/builtins/cpu_model.c
===================================================================
--- compiler-rt/trunk/lib/builtins/cpu_model.c
+++ compiler-rt/trunk/lib/builtins/cpu_model.c
@@ -543,7 +543,7 @@
     setFeature(FEATURE_BMI);
   if (HasLeaf7 && ((EBX >> 5) & 1) && HasAVX)
     setFeature(FEATURE_AVX2);
-  if (HasLeaf7 && ((EBX >> 9) & 1))
+  if (HasLeaf7 && ((EBX >> 8) & 1))
     setFeature(FEATURE_BMI2);
   if (HasLeaf7 && ((EBX >> 16) & 1) && HasAVX512Save)
     setFeature(FEATURE_AVX512F);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65766.213464.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190805/1548a4ee/attachment.bin>


More information about the llvm-commits mailing list