diff --git a/src/compiler/backend/mips/code-generator-mips.cc b/src/compiler/backend/mips/code-generator-mips.cc index ee23402e69..2be24f7923 100644 --- a/src/compiler/backend/mips/code-generator-mips.cc +++ b/src/compiler/backend/mips/code-generator-mips.cc @@ -1942,6 +1942,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputSimd128Register(1)); 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: { CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); __ FmoveLow(kScratchReg, i.InputSingleRegister(0)); diff --git a/src/compiler/backend/mips/instruction-codes-mips.h b/src/compiler/backend/mips/instruction-codes-mips.h index af0774f468..9bea9631a5 100644 --- a/src/compiler/backend/mips/instruction-codes-mips.h +++ b/src/compiler/backend/mips/instruction-codes-mips.h @@ -142,6 +142,8 @@ namespace compiler { V(MipsI32x4Add) \ V(MipsI32x4AddHoriz) \ V(MipsI32x4Sub) \ + V(MipsF64x2Abs) \ + V(MipsF64x2Neg) \ V(MipsF32x4Splat) \ V(MipsF32x4ExtractLane) \ V(MipsF32x4ReplaceLane) \ diff --git a/src/compiler/backend/mips/instruction-scheduler-mips.cc b/src/compiler/backend/mips/instruction-scheduler-mips.cc index ba17ad2581..21cab35f5c 100644 --- a/src/compiler/backend/mips/instruction-scheduler-mips.cc +++ b/src/compiler/backend/mips/instruction-scheduler-mips.cc @@ -41,6 +41,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kMipsDivS: case kMipsDivU: case kMipsExt: + case kMipsF64x2Abs: + case kMipsF64x2Neg: case kMipsF32x4Abs: case kMipsF32x4Add: case kMipsF32x4AddHoriz: diff --git a/src/compiler/backend/mips/instruction-selector-mips.cc b/src/compiler/backend/mips/instruction-selector-mips.cc index 7ee5c7c2c7..3c10379549 100644 --- a/src/compiler/backend/mips/instruction-selector-mips.cc +++ b/src/compiler/backend/mips/instruction-selector-mips.cc @@ -2014,6 +2014,8 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { V(I8x16) #define SIMD_UNOP_LIST(V) \ + V(F64x2Abs, kMipsF64x2Abs) \ + V(F64x2Neg, kMipsF64x2Neg) \ V(F32x4SConvertI32x4, kMipsF32x4SConvertI32x4) \ V(F32x4UConvertI32x4, kMipsF32x4UConvertI32x4) \ V(F32x4Abs, kMipsF32x4Abs) \ diff --git a/src/compiler/backend/mips64/code-generator-mips64.cc b/src/compiler/backend/mips64/code-generator-mips64.cc index 9cec463e87..822beea30f 100644 --- a/src/compiler/backend/mips64/code-generator-mips64.cc +++ b/src/compiler/backend/mips64/code-generator-mips64.cc @@ -2057,6 +2057,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( i.InputSimd128Register(1)); 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: { CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); __ FmoveLow(kScratchReg, i.InputSingleRegister(0)); diff --git a/src/compiler/backend/mips64/instruction-codes-mips64.h b/src/compiler/backend/mips64/instruction-codes-mips64.h index bcf3532b57..86f4edb453 100644 --- a/src/compiler/backend/mips64/instruction-codes-mips64.h +++ b/src/compiler/backend/mips64/instruction-codes-mips64.h @@ -172,6 +172,8 @@ namespace compiler { V(Mips64I32x4Add) \ V(Mips64I32x4AddHoriz) \ V(Mips64I32x4Sub) \ + V(Mips64F64x2Abs) \ + V(Mips64F64x2Neg) \ V(Mips64F32x4Splat) \ V(Mips64F32x4ExtractLane) \ V(Mips64F32x4ReplaceLane) \ @@ -189,7 +191,7 @@ namespace compiler { V(Mips64I32x4MinU) \ V(Mips64F32x4Abs) \ V(Mips64F32x4Neg) \ - V(Mips64F32x4Sqrt) \ + V(Mips64F32x4Sqrt) \ V(Mips64F32x4RecipApprox) \ V(Mips64F32x4RecipSqrtApprox) \ V(Mips64F32x4Add) \ diff --git a/src/compiler/backend/mips64/instruction-scheduler-mips64.cc b/src/compiler/backend/mips64/instruction-scheduler-mips64.cc index fe2d33d1db..a3af47fc90 100644 --- a/src/compiler/backend/mips64/instruction-scheduler-mips64.cc +++ b/src/compiler/backend/mips64/instruction-scheduler-mips64.cc @@ -69,6 +69,8 @@ int InstructionScheduler::GetTargetInstructionFlags( case kMips64Dsub: case kMips64DsubOvf: case kMips64Ext: + case kMips64F64x2Abs: + case kMips64F64x2Neg: case kMips64F32x4Abs: case kMips64F32x4Add: case kMips64F32x4AddHoriz: diff --git a/src/compiler/backend/mips64/instruction-selector-mips64.cc b/src/compiler/backend/mips64/instruction-selector-mips64.cc index dfc0ff5bad..8f82255baf 100644 --- a/src/compiler/backend/mips64/instruction-selector-mips64.cc +++ b/src/compiler/backend/mips64/instruction-selector-mips64.cc @@ -2677,6 +2677,8 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { V(I8x16) #define SIMD_UNOP_LIST(V) \ + V(F64x2Abs, kMips64F64x2Abs) \ + V(F64x2Neg, kMips64F64x2Neg) \ V(F32x4SConvertI32x4, kMips64F32x4SConvertI32x4) \ V(F32x4UConvertI32x4, kMips64F32x4UConvertI32x4) \ V(F32x4Abs, kMips64F32x4Abs) \