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( ...@@ -1903,14 +1903,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArmI32x4Shl: { case kArmI32x4Shl: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon32, tmp, i.InputRegister(1)); __ vdup(Neon32, tmp, i.InputRegister(1));
__ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
tmp); tmp);
break; break;
} }
case kArmI32x4ShrS: { case kArmI32x4ShrS: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon32, tmp, i.InputRegister(1)); __ vdup(Neon32, tmp, i.InputRegister(1));
__ vneg(Neon32, tmp, tmp); __ vneg(Neon32, tmp, tmp);
__ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonS32, i.OutputSimd128Register(), i.InputSimd128Register(0),
...@@ -1982,7 +1982,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1982,7 +1982,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArmI32x4ShrU: { case kArmI32x4ShrU: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon32, tmp, i.InputRegister(1)); __ vdup(Neon32, tmp, i.InputRegister(1));
__ vneg(Neon32, tmp, tmp); __ vneg(Neon32, tmp, tmp);
__ vshl(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonU32, i.OutputSimd128Register(), i.InputSimd128Register(0),
...@@ -2038,14 +2038,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2038,14 +2038,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArmI16x8Shl: { case kArmI16x8Shl: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon16, tmp, i.InputRegister(1)); __ vdup(Neon16, tmp, i.InputRegister(1));
__ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
tmp); tmp);
break; break;
} }
case kArmI16x8ShrS: { case kArmI16x8ShrS: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon16, tmp, i.InputRegister(1)); __ vdup(Neon16, tmp, i.InputRegister(1));
__ vneg(Neon16, tmp, tmp); __ vneg(Neon16, tmp, tmp);
__ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonS16, i.OutputSimd128Register(), i.InputSimd128Register(0),
...@@ -2126,7 +2126,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2126,7 +2126,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArmI16x8ShrU: { case kArmI16x8ShrU: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon16, tmp, i.InputRegister(1)); __ vdup(Neon16, tmp, i.InputRegister(1));
__ vneg(Neon16, tmp, tmp); __ vneg(Neon16, tmp, tmp);
__ vshl(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonU16, i.OutputSimd128Register(), i.InputSimd128Register(0),
...@@ -2185,14 +2185,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2185,14 +2185,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArmI8x16Shl: { case kArmI8x16Shl: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon8, tmp, i.InputRegister(1)); __ vdup(Neon8, tmp, i.InputRegister(1));
__ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
tmp); tmp);
break; break;
} }
case kArmI8x16ShrS: { case kArmI8x16ShrS: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon8, tmp, i.InputRegister(1)); __ vdup(Neon8, tmp, i.InputRegister(1));
__ vneg(Neon8, tmp, tmp); __ vneg(Neon8, tmp, tmp);
__ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonS8, i.OutputSimd128Register(), i.InputSimd128Register(0),
...@@ -2259,7 +2259,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2259,7 +2259,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArmI8x16ShrU: { case kArmI8x16ShrU: {
QwNeonRegister tmp = i.ToSimd128Register(instr->TempAt(0)); QwNeonRegister tmp = i.TempSimd128Register(0);
__ vdup(Neon8, tmp, i.InputRegister(1)); __ vdup(Neon8, tmp, i.InputRegister(1));
__ vneg(Neon8, tmp, tmp); __ vneg(Neon8, tmp, tmp);
__ vshl(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0), __ vshl(NeonU8, i.OutputSimd128Register(), i.InputSimd128Register(0),
......
...@@ -1868,14 +1868,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1868,14 +1868,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
SIMD_UNOP_CASE(kArm64I64x2Neg, Neg, 2D); SIMD_UNOP_CASE(kArm64I64x2Neg, Neg, 2D);
case kArm64I64x2Shl: { case kArm64I64x2Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V2D(), i.InputRegister64(1)); __ Dup(tmp.V2D(), i.InputRegister64(1));
__ Sshl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(), __ Sshl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(),
tmp.V2D()); tmp.V2D());
break; break;
} }
case kArm64I64x2ShrS: { case kArm64I64x2ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V2D(), i.InputRegister64(1)); __ Dup(tmp.V2D(), i.InputRegister64(1));
__ Neg(tmp.V2D(), tmp.V2D()); __ Neg(tmp.V2D(), tmp.V2D());
__ Sshl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(), __ Sshl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(),
...@@ -1895,7 +1895,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1895,7 +1895,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_BINOP_CASE(kArm64I64x2GtS, Cmgt, 2D); SIMD_BINOP_CASE(kArm64I64x2GtS, Cmgt, 2D);
SIMD_BINOP_CASE(kArm64I64x2GeS, Cmge, 2D); SIMD_BINOP_CASE(kArm64I64x2GeS, Cmge, 2D);
case kArm64I64x2ShrU: { case kArm64I64x2ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V2D(), i.InputRegister64(1)); __ Dup(tmp.V2D(), i.InputRegister64(1));
__ Neg(tmp.V2D(), tmp.V2D()); __ Neg(tmp.V2D(), tmp.V2D());
__ Ushl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(), __ Ushl(i.OutputSimd128Register().V2D(), i.InputSimd128Register(0).V2D(),
...@@ -1927,14 +1927,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1927,14 +1927,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_WIDENING_UNOP_CASE(kArm64I32x4SConvertI16x8High, Sxtl2, 4S, 8H); SIMD_WIDENING_UNOP_CASE(kArm64I32x4SConvertI16x8High, Sxtl2, 4S, 8H);
SIMD_UNOP_CASE(kArm64I32x4Neg, Neg, 4S); SIMD_UNOP_CASE(kArm64I32x4Neg, Neg, 4S);
case kArm64I32x4Shl: { case kArm64I32x4Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V4S(), i.InputRegister32(1)); __ Dup(tmp.V4S(), i.InputRegister32(1));
__ Sshl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(), __ Sshl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
tmp.V4S()); tmp.V4S());
break; break;
} }
case kArm64I32x4ShrS: { case kArm64I32x4ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V4S(), i.InputRegister32(1)); __ Dup(tmp.V4S(), i.InputRegister32(1));
__ Neg(tmp.V4S(), tmp.V4S()); __ Neg(tmp.V4S(), tmp.V4S());
__ Sshl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(), __ Sshl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
...@@ -1961,7 +1961,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1961,7 +1961,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8Low, Uxtl, 4S, 4H); SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8Low, Uxtl, 4S, 4H);
SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8High, Uxtl2, 4S, 8H); SIMD_WIDENING_UNOP_CASE(kArm64I32x4UConvertI16x8High, Uxtl2, 4S, 8H);
case kArm64I32x4ShrU: { case kArm64I32x4ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V4S(), i.InputRegister32(1)); __ Dup(tmp.V4S(), i.InputRegister32(1));
__ Neg(tmp.V4S(), tmp.V4S()); __ Neg(tmp.V4S(), tmp.V4S());
__ Ushl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(), __ Ushl(i.OutputSimd128Register().V4S(), i.InputSimd128Register(0).V4S(),
...@@ -1994,14 +1994,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1994,14 +1994,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_WIDENING_UNOP_CASE(kArm64I16x8SConvertI8x16High, Sxtl2, 8H, 16B); SIMD_WIDENING_UNOP_CASE(kArm64I16x8SConvertI8x16High, Sxtl2, 8H, 16B);
SIMD_UNOP_CASE(kArm64I16x8Neg, Neg, 8H); SIMD_UNOP_CASE(kArm64I16x8Neg, Neg, 8H);
case kArm64I16x8Shl: { case kArm64I16x8Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V8H(), i.InputRegister32(1)); __ Dup(tmp.V8H(), i.InputRegister32(1));
__ Sshl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(), __ Sshl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
tmp.V8H()); tmp.V8H());
break; break;
} }
case kArm64I16x8ShrS: { case kArm64I16x8ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V8H(), i.InputRegister32(1)); __ Dup(tmp.V8H(), i.InputRegister32(1));
__ Neg(tmp.V8H(), tmp.V8H()); __ Neg(tmp.V8H(), tmp.V8H());
__ Sshl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(), __ Sshl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
...@@ -2050,7 +2050,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2050,7 +2050,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kArm64I16x8ShrU: { case kArm64I16x8ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V8H(), i.InputRegister32(1)); __ Dup(tmp.V8H(), i.InputRegister32(1));
__ Neg(tmp.V8H(), tmp.V8H()); __ Neg(tmp.V8H(), tmp.V8H());
__ Ushl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(), __ Ushl(i.OutputSimd128Register().V8H(), i.InputSimd128Register(0).V8H(),
...@@ -2097,14 +2097,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2097,14 +2097,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
SIMD_UNOP_CASE(kArm64I8x16Neg, Neg, 16B); SIMD_UNOP_CASE(kArm64I8x16Neg, Neg, 16B);
case kArm64I8x16Shl: { case kArm64I8x16Shl: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V16B(), i.InputRegister32(1)); __ Dup(tmp.V16B(), i.InputRegister32(1));
__ Sshl(i.OutputSimd128Register().V16B(), __ Sshl(i.OutputSimd128Register().V16B(),
i.InputSimd128Register(0).V16B(), tmp.V16B()); i.InputSimd128Register(0).V16B(), tmp.V16B());
break; break;
} }
case kArm64I8x16ShrS: { case kArm64I8x16ShrS: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V16B(), i.InputRegister32(1)); __ Dup(tmp.V16B(), i.InputRegister32(1));
__ Neg(tmp.V16B(), tmp.V16B()); __ Neg(tmp.V16B(), tmp.V16B());
__ Sshl(i.OutputSimd128Register().V16B(), __ Sshl(i.OutputSimd128Register().V16B(),
...@@ -2143,7 +2143,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2143,7 +2143,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
SIMD_BINOP_CASE(kArm64I8x16GtS, Cmgt, 16B); SIMD_BINOP_CASE(kArm64I8x16GtS, Cmgt, 16B);
SIMD_BINOP_CASE(kArm64I8x16GeS, Cmge, 16B); SIMD_BINOP_CASE(kArm64I8x16GeS, Cmge, 16B);
case kArm64I8x16ShrU: { case kArm64I8x16ShrU: {
VRegister tmp = i.ToSimd128Register(instr->TempAt(0)); VRegister tmp = i.TempSimd128Register(0);
__ Dup(tmp.V16B(), i.InputRegister32(1)); __ Dup(tmp.V16B(), i.InputRegister32(1));
__ Neg(tmp.V16B(), tmp.V16B()); __ Neg(tmp.V16B(), tmp.V16B());
__ Ushl(i.OutputSimd128Register().V16B(), __ Ushl(i.OutputSimd128Register().V16B(),
......
...@@ -116,6 +116,10 @@ class InstructionOperandConverter { ...@@ -116,6 +116,10 @@ class InstructionOperandConverter {
return ToSimd128Register(instr_->Output()); return ToSimd128Register(instr_->Output());
} }
Simd128Register TempSimd128Register(size_t index) {
return ToSimd128Register(instr_->TempAt(index));
}
// -- Conversions for operands ----------------------------------------------- // -- Conversions for operands -----------------------------------------------
Label* ToLabel(InstructionOperand* op) { Label* ToLabel(InstructionOperand* op) {
......
...@@ -2195,28 +2195,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2195,28 +2195,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
case kSSEI32x4Shl: { case kSSEI32x4Shl: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ pslld(i.OutputSimd128Register(), tmp); __ pslld(i.OutputSimd128Register(), tmp);
break; break;
} }
case kAVXI32x4Shl: { case kAVXI32x4Shl: {
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ vpslld(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp); __ vpslld(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break; break;
} }
case kSSEI32x4ShrS: { case kSSEI32x4ShrS: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ psrad(i.OutputSimd128Register(), tmp); __ psrad(i.OutputSimd128Register(), tmp);
break; break;
} }
case kAVXI32x4ShrS: { case kAVXI32x4ShrS: {
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ vpsrad(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp); __ vpsrad(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break; break;
...@@ -2350,7 +2350,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2350,7 +2350,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope sse_scope(tasm(), SSE4_1); CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
// NAN->0, negative->0 // NAN->0, negative->0
__ pxor(kScratchDoubleReg, kScratchDoubleReg); __ pxor(kScratchDoubleReg, kScratchDoubleReg);
__ maxps(dst, kScratchDoubleReg); __ maxps(dst, kScratchDoubleReg);
...@@ -2378,7 +2378,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2378,7 +2378,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
// NAN->0, negative->0 // NAN->0, negative->0
__ vpxor(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg); __ vpxor(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
__ vmaxps(dst, dst, kScratchDoubleReg); __ vmaxps(dst, dst, kScratchDoubleReg);
...@@ -2413,14 +2413,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2413,14 +2413,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
case kSSEI32x4ShrU: { case kSSEI32x4ShrU: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ psrld(i.OutputSimd128Register(), tmp); __ psrld(i.OutputSimd128Register(), tmp);
break; break;
} }
case kAVXI32x4ShrU: { case kAVXI32x4ShrU: {
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ vpsrld(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp); __ vpsrld(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break; break;
...@@ -2536,28 +2536,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2536,28 +2536,28 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
case kSSEI16x8Shl: { case kSSEI16x8Shl: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ psllw(i.OutputSimd128Register(), tmp); __ psllw(i.OutputSimd128Register(), tmp);
break; break;
} }
case kAVXI16x8Shl: { case kAVXI16x8Shl: {
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ vpsllw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp); __ vpsllw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break; break;
} }
case kSSEI16x8ShrS: { case kSSEI16x8ShrS: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ psraw(i.OutputSimd128Register(), tmp); __ psraw(i.OutputSimd128Register(), tmp);
break; break;
} }
case kAVXI16x8ShrS: { case kAVXI16x8ShrS: {
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ vpsraw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp); __ vpsraw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break; break;
...@@ -2728,14 +2728,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2728,14 +2728,14 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
} }
case kSSEI16x8ShrU: { case kSSEI16x8ShrU: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ psrlw(i.OutputSimd128Register(), tmp); __ psrlw(i.OutputSimd128Register(), tmp);
break; break;
} }
case kAVXI16x8ShrU: { case kAVXI16x8ShrU: {
CpuFeatureScope avx_scope(tasm(), AVX); CpuFeatureScope avx_scope(tasm(), AVX);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movd(tmp, i.InputRegister(1)); __ movd(tmp, i.InputRegister(1));
__ vpsrlw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp); __ vpsrlw(i.OutputSimd128Register(), i.InputSimd128Register(0), tmp);
break; break;
...@@ -2902,7 +2902,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2902,7 +2902,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
Register shift = i.InputRegister(1); Register shift = i.InputRegister(1);
Register tmp = i.ToRegister(instr->TempAt(0)); 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. // Mask off the unwanted bits before word-shifting.
__ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg); __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
__ mov(tmp, shift); __ mov(tmp, shift);
...@@ -2921,7 +2921,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2921,7 +2921,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister src = i.InputSimd128Register(0); XMMRegister src = i.InputSimd128Register(0);
Register shift = i.InputRegister(1); Register shift = i.InputRegister(1);
Register tmp = i.ToRegister(instr->TempAt(0)); 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. // Mask off the unwanted bits before word-shifting.
__ vpcmpeqw(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg); __ vpcmpeqw(kScratchDoubleReg, kScratchDoubleReg, kScratchDoubleReg);
__ mov(tmp, shift); __ mov(tmp, shift);
...@@ -2938,7 +2938,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2938,7 +2938,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
Register tmp = i.ToRegister(instr->TempAt(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. // Unpack the bytes into words, do arithmetic shifts, and repack.
__ punpckhbw(kScratchDoubleReg, dst); __ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst); __ punpcklbw(dst, dst);
...@@ -2998,7 +2998,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2998,7 +2998,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
XMMRegister right = i.InputSimd128Register(1); XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
// I16x8 view of I8x16 // I16x8 view of I8x16
// left = AAaa AAaa ... AAaa AAaa // left = AAaa AAaa ... AAaa AAaa
...@@ -3038,7 +3038,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3038,7 +3038,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister left = i.InputSimd128Register(0); XMMRegister left = i.InputSimd128Register(0);
XMMRegister right = i.InputSimd128Register(1); XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
// I16x8 view of I8x16 // I16x8 view of I8x16
// left = AAaa AAaa ... AAaa AAaa // left = AAaa AAaa ... AAaa AAaa
...@@ -3202,7 +3202,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3202,7 +3202,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
Register tmp = i.ToRegister(instr->TempAt(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 logical shifts, and repack. // Unpack the bytes into words, do logical shifts, and repack.
__ punpckhbw(kScratchDoubleReg, dst); __ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst); __ punpcklbw(dst, dst);
......
...@@ -593,7 +593,7 @@ void EmitWordLoadPoisoningIfNeeded( ...@@ -593,7 +593,7 @@ void EmitWordLoadPoisoningIfNeeded(
CpuFeatureScope sse_scope(tasm(), SSE4_1); \ CpuFeatureScope sse_scope(tasm(), SSE4_1); \
Register dst = i.OutputRegister(); \ Register dst = i.OutputRegister(); \
Register tmp1 = i.TempRegister(0); \ Register tmp1 = i.TempRegister(0); \
XMMRegister tmp2 = i.ToSimd128Register(instr->TempAt(1)); \ XMMRegister tmp2 = i.TempSimd128Register(1); \
__ movq(tmp1, Immediate(1)); \ __ movq(tmp1, Immediate(1)); \
__ xorq(dst, dst); \ __ xorq(dst, dst); \
__ pxor(tmp2, tmp2); \ __ pxor(tmp2, tmp2); \
...@@ -2571,7 +2571,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2571,7 +2571,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I64x2Shl: { case kX64I64x2Shl: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psllq(i.OutputSimd128Register(), tmp); __ psllq(i.OutputSimd128Register(), tmp);
break; break;
...@@ -2610,8 +2610,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2610,8 +2610,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1); CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister left = i.InputSimd128Register(0); XMMRegister left = i.InputSimd128Register(0);
XMMRegister right = i.InputSimd128Register(1); XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp1 = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp1 = i.TempSimd128Register(0);
XMMRegister tmp2 = i.ToSimd128Register(instr->TempAt(1)); XMMRegister tmp2 = i.TempSimd128Register(1);
__ movaps(tmp1, left); __ movaps(tmp1, left);
__ movaps(tmp2, right); __ movaps(tmp2, right);
...@@ -2636,7 +2636,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2636,7 +2636,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_2(tasm(), SSE4_2); CpuFeatureScope sse_scope_4_2(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); 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(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0); DCHECK_EQ(src, xmm0);
...@@ -2648,7 +2648,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2648,7 +2648,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1); CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
Register tmp1 = i.TempRegister(1); Register tmp1 = i.TempRegister(1);
Register tmp2 = i.TempRegister(2); Register tmp2 = i.TempRegister(2);
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
...@@ -2682,7 +2682,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2682,7 +2682,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_2(tasm(), SSE4_2); CpuFeatureScope sse_scope_4_2(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); 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(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0); DCHECK_EQ(src, xmm0);
...@@ -2700,7 +2700,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2700,7 +2700,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kX64I64x2Ne: { case kX64I64x2Ne: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope sse_scope(tasm(), SSE4_1); 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(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqq(tmp, tmp); __ pcmpeqq(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp); __ pxor(i.OutputSimd128Register(), tmp);
...@@ -2717,7 +2717,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2717,7 +2717,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_2); CpuFeatureScope sse_scope(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movaps(tmp, src); __ movaps(tmp, src);
__ pcmpgtq(tmp, dst); __ pcmpgtq(tmp, dst);
...@@ -2726,7 +2726,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2726,7 +2726,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I64x2ShrU: { case kX64I64x2ShrU: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psrlq(i.OutputSimd128Register(), tmp); __ psrlq(i.OutputSimd128Register(), tmp);
break; break;
...@@ -2736,8 +2736,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2736,8 +2736,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1); CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister src_tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister src_tmp = i.TempSimd128Register(0);
XMMRegister dst_tmp = i.ToSimd128Register(instr->TempAt(1)); XMMRegister dst_tmp = i.TempSimd128Register(1);
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0); DCHECK_EQ(src, xmm0);
...@@ -2760,8 +2760,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2760,8 +2760,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1); CpuFeatureScope sse_scope_4_1(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister src_tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister src_tmp = i.TempSimd128Register(0);
XMMRegister dst_tmp = i.ToSimd128Register(instr->TempAt(1)); XMMRegister dst_tmp = i.TempSimd128Register(1);
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
DCHECK_EQ(src, xmm0); DCHECK_EQ(src, xmm0);
...@@ -2783,7 +2783,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2783,7 +2783,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_2); CpuFeatureScope sse_scope(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
__ psllq(kScratchDoubleReg, 63); __ psllq(kScratchDoubleReg, 63);
...@@ -2799,7 +2799,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2799,7 +2799,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_2); CpuFeatureScope sse_scope(tasm(), SSE4_2);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg); __ pcmpeqd(kScratchDoubleReg, kScratchDoubleReg);
__ psllq(kScratchDoubleReg, 63); __ psllq(kScratchDoubleReg, 63);
...@@ -2840,7 +2840,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2840,7 +2840,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kX64I32x4SConvertF32x4: { case kX64I32x4SConvertF32x4: {
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
// NAN->0 // NAN->0
__ movaps(tmp, dst); __ movaps(tmp, dst);
__ cmpeqps(tmp, tmp); __ cmpeqps(tmp, tmp);
...@@ -2882,13 +2882,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2882,13 +2882,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I32x4Shl: { case kX64I32x4Shl: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ pslld(i.OutputSimd128Register(), tmp); __ pslld(i.OutputSimd128Register(), tmp);
break; break;
} }
case kX64I32x4ShrS: { case kX64I32x4ShrS: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psrad(i.OutputSimd128Register(), tmp); __ psrad(i.OutputSimd128Register(), tmp);
break; break;
...@@ -2926,7 +2926,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2926,7 +2926,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I32x4Ne: { case kX64I32x4Ne: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1)); __ pcmpeqd(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqd(tmp, tmp); __ pcmpeqd(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp); __ pxor(i.OutputSimd128Register(), tmp);
...@@ -2948,8 +2948,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2948,8 +2948,8 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0)); DCHECK_EQ(i.OutputSimd128Register(), i.InputSimd128Register(0));
CpuFeatureScope sse_scope(tasm(), SSE4_1); CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
XMMRegister tmp2 = i.ToSimd128Register(instr->TempAt(1)); XMMRegister tmp2 = i.TempSimd128Register(1);
// NAN->0, negative->0 // NAN->0, negative->0
__ pxor(tmp2, tmp2); __ pxor(tmp2, tmp2);
__ maxps(dst, tmp2); __ maxps(dst, tmp2);
...@@ -2986,7 +2986,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2986,7 +2986,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I32x4ShrU: { case kX64I32x4ShrU: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psrld(i.OutputSimd128Register(), tmp); __ psrld(i.OutputSimd128Register(), tmp);
break; break;
...@@ -3005,7 +3005,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3005,7 +3005,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1); CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pmaxud(dst, src); __ pmaxud(dst, src);
__ pcmpeqd(dst, src); __ pcmpeqd(dst, src);
__ pcmpeqd(tmp, tmp); __ pcmpeqd(tmp, tmp);
...@@ -3079,13 +3079,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3079,13 +3079,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I16x8Shl: { case kX64I16x8Shl: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psllw(i.OutputSimd128Register(), tmp); __ psllw(i.OutputSimd128Register(), tmp);
break; break;
} }
case kX64I16x8ShrS: { case kX64I16x8ShrS: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psraw(i.OutputSimd128Register(), tmp); __ psraw(i.OutputSimd128Register(), tmp);
break; break;
...@@ -3136,7 +3136,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3136,7 +3136,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I16x8Ne: { case kX64I16x8Ne: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1)); __ pcmpeqw(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqw(tmp, tmp); __ pcmpeqw(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp); __ pxor(i.OutputSimd128Register(), tmp);
...@@ -3167,7 +3167,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3167,7 +3167,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I16x8ShrU: { case kX64I16x8ShrU: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
__ psrlw(i.OutputSimd128Register(), tmp); __ psrlw(i.OutputSimd128Register(), tmp);
break; break;
...@@ -3206,7 +3206,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3206,7 +3206,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1); CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pmaxuw(dst, src); __ pmaxuw(dst, src);
__ pcmpeqw(dst, src); __ pcmpeqw(dst, src);
__ pcmpeqw(tmp, tmp); __ pcmpeqw(tmp, tmp);
...@@ -3273,7 +3273,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3273,7 +3273,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
// Temp registers for shift mask andadditional moves to XMM registers. // Temp registers for shift mask andadditional moves to XMM registers.
Register tmp = i.ToRegister(instr->TempAt(0)); 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. // Mask off the unwanted bits before word-shifting.
__ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg); __ pcmpeqw(kScratchDoubleReg, kScratchDoubleReg);
__ movq(tmp, i.InputRegister(1)); __ movq(tmp, i.InputRegister(1));
...@@ -3291,7 +3291,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3291,7 +3291,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
// Temp registers for shift mask andadditional moves to XMM registers. // Temp registers for shift mask andadditional moves to XMM registers.
Register tmp = i.ToRegister(instr->TempAt(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. // Unpack the bytes into words, do arithmetic shifts, and repack.
__ punpckhbw(kScratchDoubleReg, dst); __ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst); __ punpcklbw(dst, dst);
...@@ -3324,7 +3324,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3324,7 +3324,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
XMMRegister right = i.InputSimd128Register(1); XMMRegister right = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
// I16x8 view of I8x16 // I16x8 view of I8x16
// left = AAaa AAaa ... AAaa AAaa // left = AAaa AAaa ... AAaa AAaa
// right= BBbb BBbb ... BBbb BBbb // right= BBbb BBbb ... BBbb BBbb
...@@ -3368,7 +3368,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3368,7 +3368,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break; break;
} }
case kX64I8x16Ne: { case kX64I8x16Ne: {
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1)); __ pcmpeqb(i.OutputSimd128Register(), i.InputSimd128Register(1));
__ pcmpeqb(tmp, tmp); __ pcmpeqb(tmp, tmp);
__ pxor(i.OutputSimd128Register(), tmp); __ pxor(i.OutputSimd128Register(), tmp);
...@@ -3404,7 +3404,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3404,7 +3404,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
DCHECK_EQ(dst, i.InputSimd128Register(0)); DCHECK_EQ(dst, i.InputSimd128Register(0));
// Temp registers for shift mask andadditional moves to XMM registers. // Temp registers for shift mask andadditional moves to XMM registers.
Register tmp = i.ToRegister(instr->TempAt(0)); Register tmp = i.ToRegister(instr->TempAt(0));
XMMRegister tmp_simd = i.ToSimd128Register(instr->TempAt(1)); XMMRegister tmp_simd = i.TempSimd128Register(1);
__ punpckhbw(kScratchDoubleReg, dst); __ punpckhbw(kScratchDoubleReg, dst);
__ punpcklbw(dst, dst); __ punpcklbw(dst, dst);
// Prepare shift value // Prepare shift value
...@@ -3438,7 +3438,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3438,7 +3438,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
CpuFeatureScope sse_scope(tasm(), SSE4_1); CpuFeatureScope sse_scope(tasm(), SSE4_1);
XMMRegister dst = i.OutputSimd128Register(); XMMRegister dst = i.OutputSimd128Register();
XMMRegister src = i.InputSimd128Register(1); XMMRegister src = i.InputSimd128Register(1);
XMMRegister tmp = i.ToSimd128Register(instr->TempAt(0)); XMMRegister tmp = i.TempSimd128Register(0);
__ pmaxub(dst, src); __ pmaxub(dst, src);
__ pcmpeqb(dst, src); __ pcmpeqb(dst, src);
__ pcmpeqb(tmp, tmp); __ 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