Skip to content

Commit ebcf1c9

Browse files
stefanatworkCopilot
andcommitted
Fix shift-overflow warning for CPU_FEATURE_BIT_AVX512VL
Use (int)(1u << 31) instead of 1 << 31 to avoid -Werror=shift-overflow= when shifting into the sign bit of a signed int. Keeps the constant type consistent with all other CPU_FEATURE_BIT_* constants. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7376304 commit ebcf1c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

common/sys/sysinfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ namespace embree
248248
static const int CPU_FEATURE_BIT_AVX512ER = 1 << 27; // AVX512ER (exponential and reciprocal instructions)
249249
static const int CPU_FEATURE_BIT_AVX512CD = 1 << 28; // AVX512CD (conflict detection instructions)
250250
static const int CPU_FEATURE_BIT_AVX512BW = 1 << 30; // AVX512BW (byte and word instructions)
251-
static const int CPU_FEATURE_BIT_AVX512VL = 1 << 31; // AVX512VL (vector length extensions)
251+
static const int CPU_FEATURE_BIT_AVX512VL = (int)(1u << 31); // AVX512VL (vector length extensions)
252252
static const int CPU_FEATURE_BIT_AVX512IFMA = 1 << 21; // AVX512IFMA (integer fused multiple-add instructions)
253253

254254
/* cpuid[eax=7,ecx=0].ecx */

0 commit comments

Comments
 (0)