Avoid MSVC narrowing conversion warning in liftoff-assembler-ia32.h.

The line being modified currently causes a 32-bit build with MSVC to
give out this warning:

C2397: conversion from 'int32_t' to 'v8::internal::byte' requires a
narrowing conversion.

Avoid the warning by declaring `shift` as type byte to start with.

Change-Id: Ib11c8e24811bfc6fe076b845be140e86b7ca38c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2877949
Reviewed-by: Zhi An Ng <zhin@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74451}
This commit is contained in:
Lei Zhang 2021-05-07 14:29:24 -07:00 committed by V8 LUCI CQ
parent 4a19c62fc6
commit 1e7fcea8de

View File

@ -3890,13 +3890,13 @@ void LiftoffAssembler::emit_i64x2_shr_s(LiftoffRegister dst,
void LiftoffAssembler::emit_i64x2_shri_s(LiftoffRegister dst,
LiftoffRegister lhs, int32_t rhs) {
XMMRegister tmp = liftoff::kScratchDoubleReg;
int32_t shift = rhs & 63;
byte shift = rhs & 63;
// Set up a mask [0x80000000,0,0x80000000,0].
Pcmpeqb(tmp, tmp);
Psllq(tmp, tmp, byte{63});
Psrlq(tmp, tmp, byte{shift});
Psrlq(tmp, tmp, shift);
liftoff::EmitSimdShiftOpImm<&Assembler::vpsrlq, &Assembler::psrlq, 6>(
this, dst, lhs, rhs);
Pxor(dst.fp(), tmp);