Commit 3bc8d2a8 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm][cleanup] Add and use helper to refer to temp Simd128 register

Bug: v8:9396
Change-Id: Ic183418c83367efe430396bd39a02fa900c193d2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1764488Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63382}
parent 9284d8d8
......@@ -1903,14 +1903,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI32x4Shl: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon32, tmp, i.InputRegister(1));
__ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
tmp);
break;
}
case kArmI32x4ShrS: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon32, tmp, i.InputRegister(1));
__ vneg(Neon32, tmp, tmp);
__ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
......@@ -1982,7 +1982,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI32x4ShrU: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon32, tmp, i.InputRegister(1));
__ vneg(Neon32, tmp, tmp);
__ vshl(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
......@@ -2038,14 +2038,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI16x8Shl: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon16, tmp, i.InputRegister(1));
__ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
tmp);
break;
}
case kArmI16x8ShrS: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon16, tmp, i.InputRegister(1));
__ vneg(Neon16, tmp, tmp);
__ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
......@@ -2126,7 +2126,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI16x8ShrU: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon16, tmp, i.InputRegister(1));
__ vneg(Neon16, tmp, tmp);
__ vshl(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
......@@ -2185,14 +2185,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI8x16Shl: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon8, tmp, i.InputRegister(1));
__ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
tmp);
break;
}
case kArmI8x16ShrS: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon8, tmp, i.InputRegister(1));
__ vneg(Neon8, tmp, tmp);
__ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
......@@ -2259,7 +2259,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI8x16ShrU: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0));
QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon8, tmp, i.InputRegister(1));
__ vneg(Neon8, tmp, tmp);
__ vshl(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
......
......@@ -1868,14 +1868,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
SIMD_UNOP_CASE(kArm64I64x2Neg, Neg, 2D);
case kArm64I64x2Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V2D(), i.InputRegister64(1));
__ Sshl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(),
tmp.V2D());
break;
}
case kArm64I64x2ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V2D(), i.InputRegister64(1));
__ Neg(tmp.V2D(), tmp.V2D());
__ Sshl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(),
......@@ -1895,7 +1895,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_BINOP_CASE(kArm64I64x2GtS, Cmgt, 2D);
SIMD_BINOP_CASE(kArm64I64x2GeS, Cmge, 2D);
case kArm64I64x2ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V2D(), i.InputRegister64(1));
__ Neg(tmp.V2D(), tmp.V2D());
__ Ushl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(),
......@@ -1927,14 +1927,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_WIDENING_UNOP_CASE(kArm64I32x4SConvertI16x8High, Sxtl2, 4S, 8H);
SIMD_UNOP_CASE(kArm64I32x4Neg, Neg, 4S);
case kArm64I32x4Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V4S(), i.InputRegister32(1));
__ Sshl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
tmp.V4S());
break;
}
case kArm64I32x4ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V4S(), i.InputRegister32(1));
__ Neg(tmp.V4S(), tmp.V4S());
__ Sshl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
......@@ -1961,7 +1961,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8Low, Uxtl, 4S, 4H);
SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8High, Uxtl2, 4S, 8H);
case kArm64I32x4ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V4S(), i.InputRegister32(1));
__ Neg(tmp.V4S(), tmp.V4S());
__ Ushl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
......@@ -1994,14 +1994,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_WIDENING_UNOP_CASE(kArm64I16x8SConvertI8x16High, Sxtl2, 8H, 16B);
SIMD_UNOP_CASE(kArm64I16x8Neg, Neg, 8H);
case kArm64I16x8Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V8H(), i.InputRegister32(1));
__ Sshl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
tmp.V8H());
break;
}
case kArm64I16x8ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V8H(), i.InputRegister32(1));
__ Neg(tmp.V8H(), tmp.V8H());
__ Sshl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
......@@ -2050,7 +2050,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArm64I16x8ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V8H(), i.InputRegister32(1));
__ Neg(tmp.V8H(), tmp.V8H());
__ Ushl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
......@@ -2097,14 +2097,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
SIMD_UNOP_CASE(kArm64I8x16Neg, Neg, 16B);
case kArm64I8x16Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V16B(), i.InputRegister32(1));
__ Sshl(i.OutputSimd128Register().V16B(),
i.InputSimd128Register(0).V16B(), tmp.V16B());
break;
}
case kArm64I8x16ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V16B(), i.InputRegister32(1));
__ Neg(tmp.V16B(), tmp.V16B());
__ Sshl(i.OutputSimd128Register().V16B(),
......@@ -2143,7 +2143,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_BINOP_CASE(kArm64I8x16GtS, Cmgt, 16B);
SIMD_BINOP_CASE(kArm64I8x16GeS, Cmge, 16B);
case kArm64I8x16ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0));
VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V16B(), i.InputRegister32(1));
__ Neg(tmp.V16B(), tmp.V16B());
__ Ushl(i.OutputSimd128Register().V16B(),
......
......@@ -116,6 +116,10 @@ class InstructionOperandConverter {
return ToSimd128Register(instr_->Output());
}
Simd128Register TempSimd128Register(size_t index) {
return ToSimd128Register(instr_->TempAt(index));
}
// -- Conversions for operands -----------------------------------------------
Label* ToLabel(InstructionOperand* op) {
......
......@@ -2195,28 +2195,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
case kSSEI32x4Shl: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ pslld(i.OutputSimd128Register(), tmp);
break;
}
case kAVXI32x4Shl: {
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ vpslld(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break;
}
case kSSEI32x4ShrS: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ psrad(i.OutputSimd128Register(), tmp);
break;
}
case kAVXI32x4ShrS: {
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ vpsrad(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break;
......@@ -2350,7 +2350,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
// NAN->0, negative->0
__ pxor(kScratchDoubleReg, kScratchDoubleReg);
__ maxps(dst, kScratchDoubleReg);
......@@ -2378,7 +2378,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
// NAN->0, negative->0
__ vpxor(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
__ vmaxps(dst, dst, kScratchDoubleReg);
......@@ -2413,14 +2413,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
case kSSEI32x4ShrU: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ psrld(i.OutputSimd128Register(), tmp);
break;
}
case kAVXI32x4ShrU: {
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ vpsrld(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break;
......@@ -2536,28 +2536,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
case kSSEI16x8Shl: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ psllw(i.OutputSimd128Register(), tmp);
break;
}
case kAVXI16x8Shl: {
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ vpsllw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break;
}
case kSSEI16x8ShrS: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ psraw(i.OutputSimd128Register(), tmp);
break;
}
case kAVXI16x8ShrS: {
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ vpsraw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break;
......@@ -2728,14 +2728,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
}
case kSSEI16x8ShrU: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ psrlw(i.OutputSimd128Register(), tmp);
break;
}
case kAVXI16x8ShrU: {
CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1));
__ vpsrlw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break;
......@@ -2902,7 +2902,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0));
Register shift = i.InputRegister(1);
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
// Mask off the unwanted bits before word-shifting.
__ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
__ mov(tmp, shift);
......@@ -2921,7 +2921,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister src = i.InputSimd128Register(0);
Register shift = i.InputRegister(1);
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
// Mask off the unwanted bits before word-shifting.
__ vpcmpeqw(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
__ mov(tmp, shift);
......@@ -2938,7 +2938,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register();
DCHECK_EQ(dst, i.InputSimd128Register(0));
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
// Unpack the bytes into words, do arithmetic shifts, and repack.
__ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst);
......@@ -2998,7 +2998,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register();
DCHECK_EQ(dst, i.InputSimd128Register(0));
XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
// I16x8 view of I8x16
// left = AAaa AAaa ... AAaa AAaa
......@@ -3038,7 +3038,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register();
XMMRegister left = i.InputSimd128Register(0);
XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
// I16x8 view of I8x16
// left = AAaa AAaa ... AAaa AAaa
......@@ -3202,7 +3202,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister dst = i.OutputSimd128Register();
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
// Unpack the bytes into words, do logical shifts, and repack.
__ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst);
......
......@@ -588,18 +588,18 @@ void EmitWordLoadPoisoningIfNeeded(
__ opcode(i.OutputSimd128Register(), i.InputSimd128Register(1), imm); \
} while (false)
#define ASSEMBLE_SIMD_ALL_TRUE(opcode) \
do { \
CpuFeatureScope sse_scope(tasm(), SSE4_1); \
Register dst = i.OutputRegister(); \
Register tmp1 = i.TempRegister(0); \
XMMRegister tmp2 = i.ToSimd128Register(instr->TempAt(1)); \
__ movq(tmp1, Immediate(1)); \
__ xorq(dst, dst); \
__ pxor(tmp2, tmp2); \
__ opcode(tmp2, i.InputSimd128Register(0)); \
__ ptest(tmp2, tmp2); \
__ cmovq(zero, dst, tmp1); \
#define ASSEMBLE_SIMD_ALL_TRUE(opcode) \
do { \
CpuFeatureScope sse_scope(tasm(), SSE4_1); \
Register dst = i.OutputRegister(); \
Register tmp1 = i.TempRegister(0); \
XMMRegister tmp2 = i.TempSimd128Register(1); \
__ movq(tmp1, Immediate(1)); \
__ xorq(dst, dst); \
__ pxor(tmp2, tmp2); \
__ opcode(tmp2, i.InputSimd128Register(0)); \
__ ptest(tmp2, tmp2); \
__ cmovq(zero, dst, tmp1); \
} while (false)
void CodeGenerator::AssembleDeconstructFrame() {
......@@ -2571,7 +2571,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I64x2Shl: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psllq(i.OutputSimd128Register(), tmp);
break;
......@@ -2610,8 +2610,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister left = i.InputSimd128Register(0);
XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp1 = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp2 = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp1 = i.TempSimd128Register(0);
XMMRegister tmp2 = i.TempSimd128Register(1);
__ movaps(tmp1, left);
__ movaps(tmp2, right);
......@@ -2636,7 +2636,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_2(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
DCHECK_EQ(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0);
......@@ -2648,7 +2648,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
Register tmp1 = i.TempRegister(1);
Register tmp2 = i.TempRegister(2);
DCHECK_EQ(dst, i.InputSimd128Register(0));
......@@ -2682,7 +2682,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_2(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
DCHECK_EQ(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0);
......@@ -2700,7 +2700,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kX64I64x2Ne: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqq(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqq(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp);
......@@ -2717,7 +2717,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movaps(tmp, src);
__ pcmpgtq(tmp, dst);
......@@ -2726,7 +2726,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I64x2ShrU: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psrlq(i.OutputSimd128Register(), tmp);
break;
......@@ -2736,8 +2736,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister src_tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister dst_tmp = i.ToSimd128Register(instr->TempAt(1));
XMMRegister src_tmp = i.TempSimd128Register(0);
XMMRegister dst_tmp = i.TempSimd128Register(1);
DCHECK_EQ(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0);
......@@ -2760,8 +2760,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister src_tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister dst_tmp = i.ToSimd128Register(instr->TempAt(1));
XMMRegister src_tmp = i.TempSimd128Register(0);
XMMRegister dst_tmp = i.TempSimd128Register(1);
DCHECK_EQ(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0);
......@@ -2783,7 +2783,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
__ psllq(kScratchDoubleReg, 63);
......@@ -2799,7 +2799,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
__ psllq(kScratchDoubleReg, 63);
......@@ -2840,7 +2840,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kX64I32x4SConvertF32x4: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
// NAN->0
__ movaps(tmp, dst);
__ cmpeqps(tmp, tmp);
......@@ -2882,13 +2882,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I32x4Shl: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ pslld(i.OutputSimd128Register(), tmp);
break;
}
case kX64I32x4ShrS: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psrad(i.OutputSimd128Register(), tmp);
break;
......@@ -2926,7 +2926,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I32x4Ne: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqd(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp);
......@@ -2948,8 +2948,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp2 = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp = i.TempSimd128Register(0);
XMMRegister tmp2 = i.TempSimd128Register(1);
// NAN->0, negative->0
__ pxor(tmp2, tmp2);
__ maxps(dst, tmp2);
......@@ -2986,7 +2986,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I32x4ShrU: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psrld(i.OutputSimd128Register(), tmp);
break;
......@@ -3005,7 +3005,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pmaxud(dst, src);
__ pcmpeqd(dst, src);
__ pcmpeqd(tmp, tmp);
......@@ -3079,13 +3079,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I16x8Shl: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psllw(i.OutputSimd128Register(), tmp);
break;
}
case kX64I16x8ShrS: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psraw(i.OutputSimd128Register(), tmp);
break;
......@@ -3136,7 +3136,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I16x8Ne: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqw(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp);
......@@ -3167,7 +3167,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I16x8ShrU: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1));
__ psrlw(i.OutputSimd128Register(), tmp);
break;
......@@ -3206,7 +3206,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pmaxuw(dst, src);
__ pcmpeqw(dst, src);
__ pcmpeqw(tmp, tmp);
......@@ -3273,7 +3273,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0));
// Temp registers for shift mask andadditional moves to XMM registers.
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
// Mask off the unwanted bits before word-shifting.
__ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
__ movq(tmp, i.InputRegister(1));
......@@ -3291,7 +3291,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0));
// Temp registers for shift mask andadditional moves to XMM registers.
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
// Unpack the bytes into words, do arithmetic shifts, and repack.
__ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst);
......@@ -3324,7 +3324,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register();
DCHECK_EQ(dst, i.InputSimd128Register(0));
XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
// I16x8 view of I8x16
// left = AAaa AAaa ... AAaa AAaa
// right= BBbb BBbb ... BBbb BBbb
......@@ -3368,7 +3368,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kX64I8x16Ne: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqb(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp);
......@@ -3404,7 +3404,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0));
// Temp registers for shift mask andadditional moves to XMM registers.
Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1));
XMMRegister tmp_simd = i.TempSimd128Register(1);
__ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst);
// Prepare shift value
......@@ -3438,7 +3438,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0));
XMMRegister tmp = i.TempSimd128Register(0);
__ pmaxub(dst, src);
__ pcmpeqb(dst, src);
__ pcmpeqb(tmp, tmp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment