Commit b99a1ba0 authored by dusan.simicic's avatar dusan.simicic Committed by Commit bot

MIPS[64]: Support for some SIMD operations (6)

Add support for I16x8Mul, I16x8MaxS, I16x8MinS, I16x8Eq, I16x8Ne,
I16x8LtS, I16x8LeS, I16x8AddSaturateU, I16x8SubSaturateU, I16x8MaxU,
I16x8MinU, I16x8LtU, I16x8LeU, I8x16Splat, I8x16ExtractLane,
I8x16ReplaceLane, I8x16Neg, I8x16Shl, I8x16ShrS, S16x8Select,
S8x16Select for mips32 and mips64 architectures.

BUG=

Review-Url: https://codereview.chromium.org/2791213003
Cr-Commit-Position: refs/heads/master@{#45312}
parent 02c032c6
......@@ -2268,7 +2268,8 @@ void InstructionSelector::VisitI16x8SubSaturateS(Node* node) {
void InstructionSelector::VisitI16x8AddHoriz(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && \
!V8_TARGET_ARCH_MIPS64
void InstructionSelector::VisitI16x8Mul(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI16x8MinS(Node* node) { UNIMPLEMENTED(); }
......@@ -2290,7 +2291,8 @@ void InstructionSelector::VisitI16x8SubSaturateU(Node* node) {
void InstructionSelector::VisitI16x8MinU(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI16x8MaxU(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS &&
// !V8_TARGET_ARCH_MIPS64
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
void InstructionSelector::VisitI16x8Neg(Node* node) { UNIMPLEMENTED(); }
......@@ -2308,7 +2310,9 @@ void InstructionSelector::VisitI16x8UConvertI8x16Low(Node* node) {
void InstructionSelector::VisitI16x8UConvertI8x16High(Node* node) {
UNIMPLEMENTED();
}
#endif // !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
void InstructionSelector::VisitI16x8LtS(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI16x8LeS(Node* node) { UNIMPLEMENTED(); }
......@@ -2316,23 +2320,25 @@ void InstructionSelector::VisitI16x8LeS(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI16x8LtU(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI16x8LeU(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
void InstructionSelector::VisitI8x16Neg(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16Shl(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16ShrS(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_MIPS64
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && \
!V8_TARGET_ARCH_MIPS64
void InstructionSelector::VisitI8x16Splat(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16ExtractLane(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16ReplaceLane(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS &&
// !V8_TARGET_ARCH_MIPS64
#if !V8_TARGET_ARCH_ARM
void InstructionSelector::VisitI8x16Neg(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16Shl(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16ShrS(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI8x16SConvertI16x8(Node* node) {
UNIMPLEMENTED();
}
......@@ -2431,18 +2437,22 @@ void InstructionSelector::VisitS16x8Shuffle(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && \
!V8_TARGET_ARCH_MIPS64
void InstructionSelector::VisitS16x8Select(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS &&
// !V8_TARGET_ARCH_MIPS64
#if !V8_TARGET_ARCH_ARM
void InstructionSelector::VisitS8x16Shuffle(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS && \
!V8_TARGET_ARCH_MIPS64
void InstructionSelector::VisitS8x16Select(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS &&
// !V8_TARGET_ARCH_MIPS64
#if !V8_TARGET_ARCH_ARM
void InstructionSelector::VisitS1x4And(Node* node) { UNIMPLEMENTED(); }
......
......@@ -1758,7 +1758,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1));
break;
}
case kMipsS32x4Select: {
case kMipsS32x4Select:
case kMipsS16x8Select:
case kMipsS8x16Select: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0)));
__ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2),
......@@ -1950,6 +1952,125 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1));
break;
}
case kMipsI16x8Mul: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ mulv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8MaxS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ max_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8MinS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ min_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8Eq: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ ceq_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8Ne: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
Simd128Register dst = i.OutputSimd128Register();
__ ceq_h(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
__ nor_v(dst, dst, dst);
break;
}
case kMipsI16x8LtS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ clt_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8LeS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ cle_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8AddSaturateU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ adds_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8SubSaturateU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ subs_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8MaxU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ max_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8MinU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ min_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8LtU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ clt_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI16x8LeU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ cle_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMipsI8x16Splat: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ fill_b(i.OutputSimd128Register(), i.InputRegister(0));
break;
}
case kMipsI8x16ExtractLane: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ copy_s_b(i.OutputRegister(), i.InputSimd128Register(0),
i.InputInt8(1));
break;
}
case kMipsI8x16ReplaceLane: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
Simd128Register src = i.InputSimd128Register(0);
Simd128Register dst = i.OutputSimd128Register();
if (!src.is(dst)) {
__ move_v(dst, src);
}
__ insert_b(dst, i.InputInt8(1), i.InputRegister(2));
break;
}
case kMipsI8x16Neg: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
__ subv_b(i.OutputSimd128Register(), kSimd128RegZero,
i.InputSimd128Register(0));
break;
}
case kMipsI8x16Shl: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ slli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt3(1));
break;
}
case kMipsI8x16ShrS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ srai_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt3(1));
break;
}
}
return kSuccess;
} // NOLINT(readability/fn_size)
......
......@@ -185,7 +185,28 @@ namespace compiler {
V(MipsI16x8Add) \
V(MipsI16x8AddSaturateS) \
V(MipsI16x8Sub) \
V(MipsI16x8SubSaturateS)
V(MipsI16x8SubSaturateS) \
V(MipsI16x8Mul) \
V(MipsI16x8MaxS) \
V(MipsI16x8MinS) \
V(MipsI16x8Eq) \
V(MipsI16x8Ne) \
V(MipsI16x8LtS) \
V(MipsI16x8LeS) \
V(MipsI16x8AddSaturateU) \
V(MipsI16x8SubSaturateU) \
V(MipsI16x8MaxU) \
V(MipsI16x8MinU) \
V(MipsI16x8LtU) \
V(MipsI16x8LeU) \
V(MipsI8x16Splat) \
V(MipsI8x16ExtractLane) \
V(MipsI8x16ReplaceLane) \
V(MipsI8x16Neg) \
V(MipsI8x16Shl) \
V(MipsI8x16ShrS) \
V(MipsS16x8Select) \
V(MipsS8x16Select)
// Addressing modes represent the "shape" of inputs to an instruction.
// Many instructions support multiple addressing modes. Addressing modes
......
......@@ -2159,6 +2159,90 @@ void InstructionSelector::VisitI16x8SubSaturateS(Node* node) {
VisitRRR(this, kMipsI16x8SubSaturateS, node);
}
void InstructionSelector::VisitI16x8Mul(Node* node) {
VisitRRR(this, kMipsI16x8Mul, node);
}
void InstructionSelector::VisitI16x8MaxS(Node* node) {
VisitRRR(this, kMipsI16x8MaxS, node);
}
void InstructionSelector::VisitI16x8MinS(Node* node) {
VisitRRR(this, kMipsI16x8MinS, node);
}
void InstructionSelector::VisitI16x8Eq(Node* node) {
VisitRRR(this, kMipsI16x8Eq, node);
}
void InstructionSelector::VisitI16x8Ne(Node* node) {
VisitRRR(this, kMipsI16x8Ne, node);
}
void InstructionSelector::VisitI16x8LtS(Node* node) {
VisitRRR(this, kMipsI16x8LtS, node);
}
void InstructionSelector::VisitI16x8LeS(Node* node) {
VisitRRR(this, kMipsI16x8LeS, node);
}
void InstructionSelector::VisitI16x8AddSaturateU(Node* node) {
VisitRRR(this, kMipsI16x8AddSaturateU, node);
}
void InstructionSelector::VisitI16x8SubSaturateU(Node* node) {
VisitRRR(this, kMipsI16x8SubSaturateU, node);
}
void InstructionSelector::VisitI16x8MaxU(Node* node) {
VisitRRR(this, kMipsI16x8MaxU, node);
}
void InstructionSelector::VisitI16x8MinU(Node* node) {
VisitRRR(this, kMipsI16x8MinU, node);
}
void InstructionSelector::VisitI16x8LtU(Node* node) {
VisitRRR(this, kMipsI16x8LtU, node);
}
void InstructionSelector::VisitI16x8LeU(Node* node) {
VisitRRR(this, kMipsI16x8LeU, node);
}
void InstructionSelector::VisitI8x16Splat(Node* node) {
VisitRR(this, kMipsI8x16Splat, node);
}
void InstructionSelector::VisitI8x16ExtractLane(Node* node) {
VisitRRI(this, kMipsI8x16ExtractLane, node);
}
void InstructionSelector::VisitI8x16ReplaceLane(Node* node) {
VisitRRIR(this, kMipsI8x16ReplaceLane, node);
}
void InstructionSelector::VisitI8x16Neg(Node* node) {
VisitRR(this, kMipsI8x16Neg, node);
}
void InstructionSelector::VisitI8x16Shl(Node* node) {
VisitRRI(this, kMipsI8x16Shl, node);
}
void InstructionSelector::VisitI8x16ShrS(Node* node) {
VisitRRI(this, kMipsI8x16ShrS, node);
}
void InstructionSelector::VisitS16x8Select(Node* node) {
VisitRRRR(this, kMipsS16x8Select, node);
}
void InstructionSelector::VisitS8x16Select(Node* node) {
VisitRRRR(this, kMipsS8x16Select, node);
}
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
......
......@@ -2079,7 +2079,9 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1));
break;
}
case kMips64S32x4Select: {
case kMips64S32x4Select:
case kMips64S16x8Select:
case kMips64S8x16Select: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
DCHECK(i.OutputSimd128Register().is(i.InputSimd128Register(0)));
__ bsel_v(i.OutputSimd128Register(), i.InputSimd128Register(2),
......@@ -2271,6 +2273,125 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1));
break;
}
case kMips64I16x8Mul: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ mulv_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8MaxS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ max_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8MinS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ min_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8Eq: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ ceq_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8Ne: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
Simd128Register dst = i.OutputSimd128Register();
__ ceq_h(dst, i.InputSimd128Register(0), i.InputSimd128Register(1));
__ nor_v(dst, dst, dst);
break;
}
case kMips64I16x8LtS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ clt_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8LeS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ cle_s_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8AddSaturateU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ adds_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8SubSaturateU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ subs_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8MaxU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ max_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8MinU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ min_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8LtU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ clt_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I16x8LeU: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ cle_u_h(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kMips64I8x16Splat: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ fill_b(i.OutputSimd128Register(), i.InputRegister(0));
break;
}
case kMips64I8x16ExtractLane: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ copy_s_b(i.OutputRegister(), i.InputSimd128Register(0),
i.InputInt8(1));
break;
}
case kMips64I8x16ReplaceLane: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
Simd128Register src = i.InputSimd128Register(0);
Simd128Register dst = i.OutputSimd128Register();
if (!src.is(dst)) {
__ move_v(dst, src);
}
__ insert_b(dst, i.InputInt8(1), i.InputRegister(2));
break;
}
case kMips64I8x16Neg: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ xor_v(kSimd128RegZero, kSimd128RegZero, kSimd128RegZero);
__ subv_b(i.OutputSimd128Register(), kSimd128RegZero,
i.InputSimd128Register(0));
break;
}
case kMips64I8x16Shl: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ slli_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt3(1));
break;
}
case kMips64I8x16ShrS: {
CpuFeatureScope msa_scope(masm(), MIPS_SIMD);
__ srai_b(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt3(1));
break;
}
}
return kSuccess;
} // NOLINT(readability/fn_size)
......
......@@ -219,7 +219,28 @@ namespace compiler {
V(Mips64I16x8Add) \
V(Mips64I16x8AddSaturateS) \
V(Mips64I16x8Sub) \
V(Mips64I16x8SubSaturateS)
V(Mips64I16x8SubSaturateS) \
V(Mips64I16x8Mul) \
V(Mips64I16x8MaxS) \
V(Mips64I16x8MinS) \
V(Mips64I16x8Eq) \
V(Mips64I16x8Ne) \
V(Mips64I16x8LtS) \
V(Mips64I16x8LeS) \
V(Mips64I16x8AddSaturateU) \
V(Mips64I16x8SubSaturateU) \
V(Mips64I16x8MaxU) \
V(Mips64I16x8MinU) \
V(Mips64I16x8LtU) \
V(Mips64I16x8LeU) \
V(Mips64I8x16Splat) \
V(Mips64I8x16ExtractLane) \
V(Mips64I8x16ReplaceLane) \
V(Mips64I8x16Neg) \
V(Mips64I8x16Shl) \
V(Mips64I8x16ShrS) \
V(Mips64S16x8Select) \
V(Mips64S8x16Select)
// Addressing modes represent the "shape" of inputs to an instruction.
// Many instructions support multiple addressing modes. Addressing modes
......
......@@ -2910,6 +2910,90 @@ void InstructionSelector::VisitI16x8SubSaturateS(Node* node) {
VisitRRR(this, kMips64I16x8SubSaturateS, node);
}
void InstructionSelector::VisitI16x8Mul(Node* node) {
VisitRRR(this, kMips64I16x8Mul, node);
}
void InstructionSelector::VisitI16x8MaxS(Node* node) {
VisitRRR(this, kMips64I16x8MaxS, node);
}
void InstructionSelector::VisitI16x8MinS(Node* node) {
VisitRRR(this, kMips64I16x8MinS, node);
}
void InstructionSelector::VisitI16x8Eq(Node* node) {
VisitRRR(this, kMips64I16x8Eq, node);
}
void InstructionSelector::VisitI16x8Ne(Node* node) {
VisitRRR(this, kMips64I16x8Ne, node);
}
void InstructionSelector::VisitI16x8LtS(Node* node) {
VisitRRR(this, kMips64I16x8LtS, node);
}
void InstructionSelector::VisitI16x8LeS(Node* node) {
VisitRRR(this, kMips64I16x8LeS, node);
}
void InstructionSelector::VisitI16x8AddSaturateU(Node* node) {
VisitRRR(this, kMips64I16x8AddSaturateU, node);
}
void InstructionSelector::VisitI16x8SubSaturateU(Node* node) {
VisitRRR(this, kMips64I16x8SubSaturateU, node);
}
void InstructionSelector::VisitI16x8MaxU(Node* node) {
VisitRRR(this, kMips64I16x8MaxU, node);
}
void InstructionSelector::VisitI16x8MinU(Node* node) {
VisitRRR(this, kMips64I16x8MinU, node);
}
void InstructionSelector::VisitI16x8LtU(Node* node) {
VisitRRR(this, kMips64I16x8LtU, node);
}
void InstructionSelector::VisitI16x8LeU(Node* node) {
VisitRRR(this, kMips64I16x8LeU, node);
}
void InstructionSelector::VisitI8x16Splat(Node* node) {
VisitRR(this, kMips64I8x16Splat, node);
}
void InstructionSelector::VisitI8x16ExtractLane(Node* node) {
VisitRRI(this, kMips64I8x16ExtractLane, node);
}
void InstructionSelector::VisitI8x16ReplaceLane(Node* node) {
VisitRRIR(this, kMips64I8x16ReplaceLane, node);
}
void InstructionSelector::VisitI8x16Neg(Node* node) {
VisitRR(this, kMips64I8x16Neg, node);
}
void InstructionSelector::VisitI8x16Shl(Node* node) {
VisitRRI(this, kMips64I8x16Shl, node);
}
void InstructionSelector::VisitI8x16ShrS(Node* node) {
VisitRRI(this, kMips64I8x16ShrS, node);
}
void InstructionSelector::VisitS16x8Select(Node* node) {
VisitRRRR(this, kMips64S16x8Select, node);
}
void InstructionSelector::VisitS8x16Select(Node* node) {
VisitRRRR(this, kMips64S8x16Select, node);
}
// static
MachineOperatorBuilder::Flags
InstructionSelector::SupportedMachineOperatorFlags() {
......
......@@ -741,7 +741,8 @@ WASM_EXEC_COMPILED_TEST(I16x8ReplaceLane) {
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET ||
// V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || \
V8_TARGET_ARCH_MIPS64
WASM_EXEC_COMPILED_TEST(I8x16Splat) {
FLAG_wasm_simd_prototype = true;
......@@ -859,7 +860,8 @@ WASM_EXEC_COMPILED_TEST(I8x16ReplaceLane) {
CHECK_EQ(1, r.Call(1, 2));
}
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS ||
// V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
V8_TARGET_ARCH_MIPS64
......@@ -1242,7 +1244,8 @@ WASM_EXEC_COMPILED_TEST(I16x8SubSaturateS) {
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET ||
// V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET || \
V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
WASM_EXEC_COMPILED_TEST(I16x8Mul) { RunI16x8BinOpTest(kExprI16x8Mul, Mul); }
WASM_EXEC_COMPILED_TEST(I16x8MinS) {
......@@ -1295,9 +1298,11 @@ WASM_EXEC_COMPILED_TEST(I16x8Eq) { RunI16x8CompareOpTest(kExprI16x8Eq, Equal); }
WASM_EXEC_COMPILED_TEST(I16x8Ne) {
RunI16x8CompareOpTest(kExprI16x8Ne, NotEqual);
}
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET ||
// V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
#if V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS || \
V8_TARGET_ARCH_MIPS64
WASM_EXEC_COMPILED_TEST(I16x8LtS) {
RunI16x8CompareOpTest(kExprI16x8LtS, Less);
}
......@@ -1329,7 +1334,8 @@ WASM_EXEC_COMPILED_TEST(I16x8LtU) {
WASM_EXEC_COMPILED_TEST(I16x8LeU) {
RunI16x8CompareOpTest(kExprI16x8LeU, UnsignedLessEqual);
}
#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET
#endif // V8_TARGET_ARCH_ARM || SIMD_LOWERING_TARGET || V8_TARGET_ARCH_MIPS ||
// V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET || \
V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
......@@ -1362,7 +1368,7 @@ WASM_EXEC_COMPILED_TEST(I16x8ShrU) {
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || SIMD_LOWERING_TARGET ||
// V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
void RunI8x16UnOpTest(WasmOpcode simd_op, Int8UnOp expected_op) {
FLAG_wasm_simd_prototype = true;
WasmRunner<int32_t, int32_t, int32_t> r(kExecuteCompiled);
......@@ -1377,7 +1383,9 @@ void RunI8x16UnOpTest(WasmOpcode simd_op, Int8UnOp expected_op) {
}
WASM_EXEC_COMPILED_TEST(I8x16Neg) { RunI8x16UnOpTest(kExprI8x16Neg, Negate); }
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM
// Tests both signed and unsigned conversion from I16x8 (packing).
WASM_EXEC_COMPILED_TEST(I8x16ConvertI16x8) {
FLAG_wasm_simd_prototype = true;
......@@ -1526,6 +1534,7 @@ WASM_EXEC_COMPILED_TEST(I8x16LtU) {
WASM_EXEC_COMPILED_TEST(I8x16LeU) {
RunI8x16CompareOpTest(kExprI8x16LeU, UnsignedLessEqual);
}
#endif // V8_TARGET_ARCH_ARM
void RunI8x16ShiftOpTest(WasmOpcode simd_op, Int8ShiftOp expected_op,
int shift) {
......@@ -1542,6 +1551,7 @@ void RunI8x16ShiftOpTest(WasmOpcode simd_op, Int8ShiftOp expected_op,
FOR_INT8_INPUTS(i) { CHECK_EQ(1, r.Call(*i, expected_op(*i, shift))); }
}
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
WASM_EXEC_COMPILED_TEST(I8x16Shl) {
RunI8x16ShiftOpTest(kExprI8x16Shl, LogicalShiftLeft, 1);
}
......@@ -1549,7 +1559,9 @@ WASM_EXEC_COMPILED_TEST(I8x16Shl) {
WASM_EXEC_COMPILED_TEST(I8x16ShrS) {
RunI8x16ShiftOpTest(kExprI8x16ShrS, ArithmeticShiftRight, 1);
}
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM
WASM_EXEC_COMPILED_TEST(I8x16ShrU) {
RunI8x16ShiftOpTest(kExprI8x16ShrU, LogicalShiftRight, 1);
}
......@@ -1596,11 +1608,13 @@ WASM_SIMD_SELECT_TEST(32x4)
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS ||
// V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS || \
V8_TARGET_ARCH_MIPS64
WASM_SIMD_SELECT_TEST(16x8)
WASM_SIMD_SELECT_TEST(8x16)
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64
#endif // V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_MIPS ||
// V8_TARGET_ARCH_MIPS64
#if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_X64
// Test binary ops with two lane test patterns, all lanes distinct.
......
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