Skip to content

Commit

Permalink
Merging r367929:
Browse files Browse the repository at this point in the history
------------------------------------------------------------------------
r367929 | echristo | 2019-08-05 23:25:59 +0200 (Mon, 05 Aug 2019) | 5 lines

BMI2 support is indicated in bit eight of EBX, not nine.
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
------------------------------------------------------------------------

llvm-svn: 367996
  • Loading branch information
zmodem committed Aug 6, 2019
1 parent c3007c6 commit a935710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/builtins/cpu_model.c
Expand Up @@ -543,7 +543,7 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
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);
Expand Down

0 comments on commit a935710

Please sign in to comment.