emit_x64_vector: Use explicit 64-bit mask constant

Exchange `~0ull` with `0xFFFFFFFFFFFFFFFF` when generating
the `zero_extend` constant.
This commit is contained in:
Wunkolo 2020-11-05 17:51:29 -08:00 committed by merry
parent 490160ef43
commit ec52922dae

View file

@ -442,7 +442,7 @@ static void ArithmeticShiftRightByte(EmitContext& ctx, BlockOfCode& code, const
if (code.HasAVX512_Icelake()) { if (code.HasAVX512_Icelake()) {
// Do a logical shift right upon the 8x8 bit-matrix, but shift in // Do a logical shift right upon the 8x8 bit-matrix, but shift in
// `0x80` bytes into the matrix to repeat the most significant bit. // `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; const u64 shift_matrix = (0x0102040810204080 >> (shift_amount * 8)) | zero_extend;
code.vgf2p8affineqb(result, result, code.MConst(xword_b, shift_matrix), 0); code.vgf2p8affineqb(result, result, code.MConst(xword_b, shift_matrix), 0);
return; return;