summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/cpu_model.c
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-11-24 20:14:03 +0000
committerCraig Topper <craig.topper@intel.com>2018-11-24 20:14:03 +0000
commit62e5924dd6c17eb92b368c3cbf35ef6c84eac892 (patch)
tree8d89269f0e0298953996067a8a273d8d1e02e785 /compiler-rt/lib/builtins/cpu_model.c
parent2c779c0e342b310ead9461d5eac0b58886241c75 (diff)
downloadbcm5719-llvm-62e5924dd6c17eb92b368c3cbf35ef6c84eac892.tar.gz
bcm5719-llvm-62e5924dd6c17eb92b368c3cbf35ef6c84eac892.zip
[X86][compiler-rt] Attempt to fix a warning about a shift amount being negative in a macro expansion.
llvm-svn: 347516
Diffstat (limited to 'compiler-rt/lib/builtins/cpu_model.c')
-rw-r--r--compiler-rt/lib/builtins/cpu_model.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler-rt/lib/builtins/cpu_model.c b/compiler-rt/lib/builtins/cpu_model.c
index 54f1add9167..239122ffb60 100644
--- a/compiler-rt/lib/builtins/cpu_model.c
+++ b/compiler-rt/lib/builtins/cpu_model.c
@@ -462,12 +462,12 @@ static void getAvailableFeatures(unsigned ECX, unsigned EDX, unsigned MaxLeaf,
unsigned Features2 = 0;
unsigned EAX, EBX;
-#define setFeature(F) \
- do { \
- if (F < 32) \
- Features |= 1 << F; \
- else if (F < 64) \
- Features2 |= 1 << (F - 32); \
+#define setFeature(F) \
+ do { \
+ if (F < 32) \
+ Features |= 1 << (F & 0x1f) \
+ else if (F < 64) \
+ Features2 |= 1 << (F & 0x1f); \
} while (0)
if ((EDX >> 15) & 1)
OpenPOWER on IntegriCloud