Commit 04368bbb authored by Mu Tao's avatar Mu Tao Committed by Commit Bot

[mips][wasm-simd] Implement f64x2 abs neg for mips

Port afbbfcbe

R=xwafish@gmail.com

Change-Id: Iab3a9f32d8bccddcdca8d9a874869e62ae961948
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1868558
Auto-Submit: Mu Tao <pamilty@gmail.com>
Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64491}
parent da0ef75f
...@@ -1942,6 +1942,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1942,6 +1942,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1)); i.InputSimd128Register(1));
break; break;
} }
case kMipsF64x2Abs: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ bclri_d(i.OutputSimd128Register(), i.InputSimd128Register(0), 63);
break;
}
case kMipsF64x2Neg: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ bnegi_d(i.OutputSimd128Register(), i.InputSimd128Register(0), 63);
break;
}
case kMipsF32x4Splat: { case kMipsF32x4Splat: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ FmoveLow(kScratchReg, i.InputSingleRegister(0)); __ FmoveLow(kScratchReg, i.InputSingleRegister(0));
......
...@@ -142,6 +142,8 @@ namespace compiler { ...@@ -142,6 +142,8 @@ namespace compiler {
V(MipsI32x4Add) \ V(MipsI32x4Add) \
V(MipsI32x4AddHoriz) \ V(MipsI32x4AddHoriz) \
V(MipsI32x4Sub) \ V(MipsI32x4Sub) \
V(MipsF64x2Abs) \
V(MipsF64x2Neg) \
V(MipsF32x4Splat) \ V(MipsF32x4Splat) \
V(MipsF32x4ExtractLane) \ V(MipsF32x4ExtractLane) \
V(MipsF32x4ReplaceLane) \ V(MipsF32x4ReplaceLane) \
......
...@@ -41,6 +41,8 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -41,6 +41,8 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kMipsDivS: case kMipsDivS:
case kMipsDivU: case kMipsDivU:
case kMipsExt: case kMipsExt:
case kMipsF64x2Abs:
case kMipsF64x2Neg:
case kMipsF32x4Abs: case kMipsF32x4Abs:
case kMipsF32x4Add: case kMipsF32x4Add:
case kMipsF32x4AddHoriz: case kMipsF32x4AddHoriz:
......
...@@ -2014,6 +2014,8 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { ...@@ -2014,6 +2014,8 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(I8x16) V(I8x16)
#define SIMD_UNOP_LIST(V) \ #define SIMD_UNOP_LIST(V) \
V(F64x2Abs, kMipsF64x2Abs) \
V(F64x2Neg, kMipsF64x2Neg) \
V(F32x4SConvertI32x4, kMipsF32x4SConvertI32x4) \ V(F32x4SConvertI32x4, kMipsF32x4SConvertI32x4) \
V(F32x4UConvertI32x4, kMipsF32x4UConvertI32x4) \ V(F32x4UConvertI32x4, kMipsF32x4UConvertI32x4) \
V(F32x4Abs, kMipsF32x4Abs) \ V(F32x4Abs, kMipsF32x4Abs) \
......
...@@ -2057,6 +2057,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2057,6 +2057,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputSimd128Register(1)); i.InputSimd128Register(1));
break; break;
} }
case kMips64F64x2Abs: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ bclri_d(i.OutputSimd128Register(), i.InputSimd128Register(0), 63);
break;
}
case kMips64F64x2Neg: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ bnegi_d(i.OutputSimd128Register(), i.InputSimd128Register(0), 63);
break;
}
case kMips64F32x4Splat: { case kMips64F32x4Splat: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ FmoveLow(kScratchReg, i.InputSingleRegister(0)); __ FmoveLow(kScratchReg, i.InputSingleRegister(0));
......
...@@ -172,6 +172,8 @@ namespace compiler { ...@@ -172,6 +172,8 @@ namespace compiler {
V(Mips64I32x4Add) \ V(Mips64I32x4Add) \
V(Mips64I32x4AddHoriz) \ V(Mips64I32x4AddHoriz) \
V(Mips64I32x4Sub) \ V(Mips64I32x4Sub) \
V(Mips64F64x2Abs) \
V(Mips64F64x2Neg) \
V(Mips64F32x4Splat) \ V(Mips64F32x4Splat) \
V(Mips64F32x4ExtractLane) \ V(Mips64F32x4ExtractLane) \
V(Mips64F32x4ReplaceLane) \ V(Mips64F32x4ReplaceLane) \
...@@ -189,7 +191,7 @@ namespace compiler { ...@@ -189,7 +191,7 @@ namespace compiler {
V(Mips64I32x4MinU) \ V(Mips64I32x4MinU) \
V(Mips64F32x4Abs) \ V(Mips64F32x4Abs) \
V(Mips64F32x4Neg) \ V(Mips64F32x4Neg) \
V(Mips64F32x4Sqrt) \ V(Mips64F32x4Sqrt) \
V(Mips64F32x4RecipApprox) \ V(Mips64F32x4RecipApprox) \
V(Mips64F32x4RecipSqrtApprox) \ V(Mips64F32x4RecipSqrtApprox) \
V(Mips64F32x4Add) \ V(Mips64F32x4Add) \
......
...@@ -69,6 +69,8 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -69,6 +69,8 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kMips64Dsub: case kMips64Dsub:
case kMips64DsubOvf: case kMips64DsubOvf:
case kMips64Ext: case kMips64Ext:
case kMips64F64x2Abs:
case kMips64F64x2Neg:
case kMips64F32x4Abs: case kMips64F32x4Abs:
case kMips64F32x4Add: case kMips64F32x4Add:
case kMips64F32x4AddHoriz: case kMips64F32x4AddHoriz:
......
...@@ -2677,6 +2677,8 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { ...@@ -2677,6 +2677,8 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(I8x16) V(I8x16)
#define SIMD_UNOP_LIST(V) \ #define SIMD_UNOP_LIST(V) \
V(F64x2Abs, kMips64F64x2Abs) \
V(F64x2Neg, kMips64F64x2Neg) \
V(F32x4SConvertI32x4, kMips64F32x4SConvertI32x4) \ V(F32x4SConvertI32x4, kMips64F32x4SConvertI32x4) \
V(F32x4UConvertI32x4, kMips64F32x4UConvertI32x4) \ V(F32x4UConvertI32x4, kMips64F32x4UConvertI32x4) \
V(F32x4Abs, kMips64F32x4Abs) \ V(F32x4Abs, kMips64F32x4Abs) \
......
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