Commit 4a9a8368 authored by Zhao Jiazhong's avatar Zhao Jiazhong Committed by Commit Bot

[mips][wasm-simd] Implement i64x2 shifts

port aafbc138 https://crrev.com/c/1900662

Original Commit Message:

  [wasm-simd] Implement i64x2 shifts for arm

Change-Id: I036610bdcf8e36879cf7a47fbf6e28034345a945
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1928499
Auto-Submit: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65126}
parent 90c64442
......@@ -2060,6 +2060,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(0));
break;
}
case kMipsI64x2Shl: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ slli_d(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt6(1));
break;
}
case kMipsI64x2ShrS: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ srai_d(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt6(1));
break;
}
case kMipsI64x2ShrU: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ srli_d(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt6(1));
break;
}
case kMipsF32x4Splat: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ FmoveLow(kScratchReg, i.InputSingleRegister(0));
......
......@@ -156,6 +156,9 @@ namespace compiler {
V(MipsI64x2Add) \
V(MipsI64x2Sub) \
V(MipsI64x2Neg) \
V(MipsI64x2Shl) \
V(MipsI64x2ShrS) \
V(MipsI64x2ShrU) \
V(MipsF32x4Splat) \
V(MipsF32x4ExtractLane) \
V(MipsF32x4ReplaceLane) \
......
......@@ -58,6 +58,9 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kMipsI64x2Add:
case kMipsI64x2Sub:
case kMipsI64x2Neg:
case kMipsI64x2Shl:
case kMipsI64x2ShrS:
case kMipsI64x2ShrU:
case kMipsF32x4Abs:
case kMipsF32x4Add:
case kMipsF32x4AddHoriz:
......
......@@ -2063,6 +2063,9 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(S1x16AllTrue, kMipsS1x16AllTrue)
#define SIMD_SHIFT_OP_LIST(V) \
V(I64x2Shl) \
V(I64x2ShrS) \
V(I64x2ShrU) \
V(I32x4Shl) \
V(I32x4ShrS) \
V(I32x4ShrU) \
......
......@@ -2165,6 +2165,24 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(0));
break;
}
case kMips64I64x2Shl: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ slli_d(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt6(1));
break;
}
case kMips64I64x2ShrS: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ srai_d(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt6(1));
break;
}
case kMips64I64x2ShrU: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ srli_d(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputInt6(1));
break;
}
case kMips64F32x4Splat: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ FmoveLow(kScratchReg, i.InputSingleRegister(0));
......
......@@ -204,6 +204,9 @@ namespace compiler {
V(Mips64I64x2Add) \
V(Mips64I64x2Sub) \
V(Mips64I64x2Neg) \
V(Mips64I64x2Shl) \
V(Mips64I64x2ShrS) \
V(Mips64I64x2ShrU) \
V(Mips64F32x4Abs) \
V(Mips64F32x4Neg) \
V(Mips64F32x4Sqrt) \
......
......@@ -83,6 +83,9 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kMips64I64x2Add:
case kMips64I64x2Sub:
case kMips64I64x2Neg:
case kMips64I64x2Shl:
case kMips64I64x2ShrS:
case kMips64I64x2ShrU:
case kMips64F32x4Abs:
case kMips64F32x4Add:
case kMips64F32x4AddHoriz:
......
......@@ -2730,6 +2730,9 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(S1x16AllTrue, kMips64S1x16AllTrue)
#define SIMD_SHIFT_OP_LIST(V) \
V(I64x2Shl) \
V(I64x2ShrS) \
V(I64x2ShrU) \
V(I32x4Shl) \
V(I32x4ShrS) \
V(I32x4ShrU) \
......
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