From ec52922daefbcbe93377b8a98ec3aafa697367bc Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Thu, 5 Nov 2020 17:51:29 -0800 Subject: [PATCH] emit_x64_vector: Use explicit 64-bit mask constant Exchange `~0ull` with `0xFFFFFFFFFFFFFFFF` when generating the `zero_extend` constant. --- src/backend/x64/emit_x64_vector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/x64/emit_x64_vector.cpp b/src/backend/x64/emit_x64_vector.cpp index f5fc6ee0..e71d2a7d 100644 --- a/src/backend/x64/emit_x64_vector.cpp +++ b/src/backend/x64/emit_x64_vector.cpp @@ -442,7 +442,7 @@ static void ArithmeticShiftRightByte(EmitContext& ctx, BlockOfCode& code, const if (code.HasAVX512_Icelake()) { // Do a logical shift right upon the 8x8 bit-matrix, but shift in // `0x80` bytes into the matrix to repeat the most significant bit. - const u64 zero_extend = ~(~0ull << (shift_amount)) & 0x8080808080808080; + const u64 zero_extend = ~(0xFFFFFFFFFFFFFFFF << shift_amount) & 0x8080808080808080; const u64 shift_matrix = (0x0102040810204080 >> (shift_amount * 8)) | zero_extend; code.vgf2p8affineqb(result, result, code.MConst(xword_b, shift_matrix), 0); return;