Commit fca1d52b authored by Liu Yu's avatar Liu Yu Committed by Commit Bot

[mips][wasm-simd] Prototype i8x16.popcnt

Port: e2aa734a

Bug: v8:11002
Change-Id: I8564a810938a07031afab20bd5448f048d4bb5de
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2674182
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#72520}
parent 251ab1f6
...@@ -3006,6 +3006,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3006,6 +3006,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
kSimd128RegZero); kSimd128RegZero);
break; break;
} }
case kMipsI8x16Popcnt: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ pcnt_b(i.OutputSimd128Register(), i.InputSimd128Register(0));
break;
}
case kMipsI8x16BitMask: { case kMipsI8x16BitMask: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
Register dst = i.OutputRegister(); Register dst = i.OutputRegister();
......
...@@ -292,6 +292,7 @@ namespace compiler { ...@@ -292,6 +292,7 @@ namespace compiler {
V(MipsI8x16GeU) \ V(MipsI8x16GeU) \
V(MipsI8x16RoundingAverageU) \ V(MipsI8x16RoundingAverageU) \
V(MipsI8x16Abs) \ V(MipsI8x16Abs) \
V(MipsI8x16Popcnt) \
V(MipsI8x16BitMask) \ V(MipsI8x16BitMask) \
V(MipsS128And) \ V(MipsS128And) \
V(MipsS128Or) \ V(MipsS128Or) \
......
...@@ -229,6 +229,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -229,6 +229,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kMipsI8x16SubSatU: case kMipsI8x16SubSatU:
case kMipsI8x16UConvertI16x8: case kMipsI8x16UConvertI16x8:
case kMipsI8x16Abs: case kMipsI8x16Abs:
case kMipsI8x16Popcnt:
case kMipsI8x16BitMask: case kMipsI8x16BitMask:
case kMipsIns: case kMipsIns:
case kMipsLsa: case kMipsLsa:
......
...@@ -2151,6 +2151,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { ...@@ -2151,6 +2151,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(I16x8UConvertI8x16Low, kMipsI16x8UConvertI8x16Low) \ V(I16x8UConvertI8x16Low, kMipsI16x8UConvertI8x16Low) \
V(I16x8UConvertI8x16High, kMipsI16x8UConvertI8x16High) \ V(I16x8UConvertI8x16High, kMipsI16x8UConvertI8x16High) \
V(I8x16Neg, kMipsI8x16Neg) \ V(I8x16Neg, kMipsI8x16Neg) \
V(I8x16Popcnt, kMipsI8x16Popcnt) \
V(I8x16BitMask, kMipsI8x16BitMask) \ V(I8x16BitMask, kMipsI8x16BitMask) \
V(S128Not, kMipsS128Not) \ V(S128Not, kMipsS128Not) \
V(V32x4AllTrue, kMipsV32x4AllTrue) \ V(V32x4AllTrue, kMipsV32x4AllTrue) \
......
...@@ -3206,6 +3206,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -3206,6 +3206,11 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
kSimd128RegZero); kSimd128RegZero);
break; break;
} }
case kMips64I8x16Popcnt: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
__ pcnt_b(i.OutputSimd128Register(), i.InputSimd128Register(0));
break;
}
case kMips64I8x16BitMask: { case kMips64I8x16BitMask: {
CpuFeatureScope msa_scope(tasm(), MIPS_SIMD); CpuFeatureScope msa_scope(tasm(), MIPS_SIMD);
Register dst = i.OutputRegister(); Register dst = i.OutputRegister();
......
...@@ -317,6 +317,7 @@ namespace compiler { ...@@ -317,6 +317,7 @@ namespace compiler {
V(Mips64I8x16GeU) \ V(Mips64I8x16GeU) \
V(Mips64I8x16RoundingAverageU) \ V(Mips64I8x16RoundingAverageU) \
V(Mips64I8x16Abs) \ V(Mips64I8x16Abs) \
V(Mips64I8x16Popcnt) \
V(Mips64I8x16BitMask) \ V(Mips64I8x16BitMask) \
V(Mips64S128And) \ V(Mips64S128And) \
V(Mips64S128Or) \ V(Mips64S128Or) \
......
...@@ -250,6 +250,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -250,6 +250,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kMips64I8x16SubSatU: case kMips64I8x16SubSatU:
case kMips64I8x16RoundingAverageU: case kMips64I8x16RoundingAverageU:
case kMips64I8x16Abs: case kMips64I8x16Abs:
case kMips64I8x16Popcnt:
case kMips64I8x16BitMask: case kMips64I8x16BitMask:
case kMips64Ins: case kMips64Ins:
case kMips64Lsa: case kMips64Lsa:
......
...@@ -2889,6 +2889,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { ...@@ -2889,6 +2889,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(I16x8BitMask, kMips64I16x8BitMask) \ V(I16x8BitMask, kMips64I16x8BitMask) \
V(I8x16Neg, kMips64I8x16Neg) \ V(I8x16Neg, kMips64I8x16Neg) \
V(I8x16Abs, kMips64I8x16Abs) \ V(I8x16Abs, kMips64I8x16Abs) \
V(I8x16Popcnt, kMips64I8x16Popcnt) \
V(I8x16BitMask, kMips64I8x16BitMask) \ V(I8x16BitMask, kMips64I8x16BitMask) \
V(S128Not, kMips64S128Not) \ V(S128Not, kMips64S128Not) \
V(V32x4AllTrue, kMips64V32x4AllTrue) \ V(V32x4AllTrue, kMips64V32x4AllTrue) \
......
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