[compiler-rt] r347516 - [X86][compiler-rt] Attempt to fix a warning about a shift amount being negative in a macro expansion.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 24 12:14:03 PST 2018
Author: ctopper
Date: Sat Nov 24 12:14:03 2018
New Revision: 347516
URL: http://llvm.org/viewvc/llvm-project?rev=347516&view=rev
Log:
[X86][compiler-rt] Attempt to fix a warning about a shift amount being negative in a macro expansion.
Modified:
compiler-rt/trunk/lib/builtins/cpu_model.c
Modified: compiler-rt/trunk/lib/builtins/cpu_model.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/cpu_model.c?rev=347516&r1=347515&r2=347516&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/cpu_model.c (original)
+++ compiler-rt/trunk/lib/builtins/cpu_model.c Sat Nov 24 12:14:03 2018
@@ -462,12 +462,12 @@ static void getAvailableFeatures(unsigne
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)
More information about the llvm-commits
mailing list