summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Host.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-11-24 20:26:11 +0000
committerCraig Topper <craig.topper@intel.com>2018-11-24 20:26:11 +0000
commit28659f5dcb0475b6c34d63515f7fd360e2604782 (patch)
tree008786ed2d1004651e482b6ae90abff06f0da528 /llvm/lib/Support/Host.cpp
parent428caa398c8be2ffb6c4da6d0153faa669fbc142 (diff)
downloadbcm5719-llvm-28659f5dcb0475b6c34d63515f7fd360e2604782.tar.gz
bcm5719-llvm-28659f5dcb0475b6c34d63515f7fd360e2604782.zip
[X86] Synchronize a macro in getAvailableFeatures in Host.cpp with the same macro in compiler-rt to fix a negative shift amount warning.
llvm-svn: 347518
Diffstat (limited to 'llvm/lib/Support/Host.cpp')
-rw-r--r--llvm/lib/Support/Host.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 5a74a6bc402..9f5bf1ffa12 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -903,11 +903,11 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
auto setFeature = [&](unsigned F) {
if (F < 32)
- Features |= 1 << F;
+ Features |= 1U << (F & 0x1f);
else if (F < 64)
- Features2 |= 1 << (F - 32);
+ Features2 |= 1U << ((F - 32) & 0x1f);
else if (F < 96)
- Features3 |= 1 << (F - 64);
+ Features3 |= 1U << ((F - 64) & 0x1f);
else
llvm_unreachable("Unexpected FeatureBit");
};
OpenPOWER on IntegriCloud