[compiler-rt] r356242 - [msan] Fix BMI2 detection in msan tests, take 2.
Jonas Hahnfeld via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 15 03:15:14 PDT 2019
Author: hahnfeld
Date: Fri Mar 15 03:15:13 2019
New Revision: 356242
URL: http://llvm.org/viewvc/llvm-project?rev=356242&view=rev
Log:
[msan] Fix BMI2 detection in msan tests, take 2.
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.
Modified:
compiler-rt/trunk/lib/msan/tests/msan_test.cc
Modified: compiler-rt/trunk/lib/msan/tests/msan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/msan/tests/msan_test.cc?rev=356242&r1=356241&r2=356242&view=diff
==============================================================================
--- compiler-rt/trunk/lib/msan/tests/msan_test.cc (original)
+++ compiler-rt/trunk/lib/msan/tests/msan_test.cc Fri Mar 15 03:15:13 2019
@@ -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")))
More information about the llvm-commits
mailing list