Skip to content

Commit

Permalink
[msan] Fix BMI2 detection in msan tests, take 2.
Browse files Browse the repository at this point in the history
It's not enough if only one bit is present, we need to check that
both are set. This finally fixes the test failures for me.

llvm-svn: 356242
  • Loading branch information
hahnjo committed Mar 15, 2019
1 parent 4ac6d7e commit 77eccf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler-rt/lib/msan/tests/msan_test.cc
Expand Up @@ -4650,7 +4650,7 @@ static bool HaveBmi() {
U4 a = 0, b = 0, c = 0, d = 0;
asm("cpuid\n\t" : "=a"(a), "=D"(b), "=c"(c), "=d"(d) : "a"(7));
const U4 kBmi12Mask = (1U<<3) | (1U<<8);
return b & kBmi12Mask;
return (b & kBmi12Mask) == kBmi12Mask;
}

__attribute__((target("bmi,bmi2")))
Expand Down

0 comments on commit 77eccf2

Please sign in to comment.