diff --git a/src/compiler/backend/s390/instruction-selector-s390.cc b/src/compiler/backend/s390/instruction-selector-s390.cc index 2f12b76d3e..1892504ee5 100644 --- a/src/compiler/backend/s390/instruction-selector-s390.cc +++ b/src/compiler/backend/s390/instruction-selector-s390.cc @@ -2533,8 +2533,7 @@ void InstructionSelector::VisitWord64AtomicStore(Node* node) { V(I8x16AddSatS) \ V(I8x16SubSatS) \ V(I8x16AddSatU) \ - V(I8x16SubSatU) \ - V(I8x16Swizzle) + V(I8x16SubSatU) #define SIMD_UNOP_LIST(V) \ V(F64x2Abs) \ @@ -2716,8 +2715,21 @@ void InstructionSelector::VisitI8x16Shuffle(Node* node) { g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_remapped + 8)), g.UseImmediate(wasm::SimdShuffle::Pack4Lanes(shuffle_remapped + 12))); } + +void InstructionSelector::VisitI8x16Swizzle(Node* node) { + S390OperandGenerator g(this); + bool relaxed = OpParameter(node->op()); + // TODO(miladfarca): Optimize Swizzle if relaxed. + USE(relaxed); + + InstructionOperand temps[] = {g.TempSimd128Register()}; + Emit(kS390_I8x16Swizzle, g.DefineAsRegister(node), + g.UseUniqueRegister(node->InputAt(0)), + g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); +} #else void InstructionSelector::VisitI8x16Shuffle(Node* node) { UNREACHABLE(); } +void InstructionSelector::VisitI8x16Swizzle(Node* node) { UNREACHABLE(); } #endif // V8_ENABLE_WEBASSEMBLY // This is a replica of SimdShuffle::Pack4Lanes. However, above function will diff --git a/src/wasm/baseline/s390/liftoff-assembler-s390.h b/src/wasm/baseline/s390/liftoff-assembler-s390.h index 2a4205ff89..f49a6615de 100644 --- a/src/wasm/baseline/s390/liftoff-assembler-s390.h +++ b/src/wasm/baseline/s390/liftoff-assembler-s390.h @@ -2743,7 +2743,12 @@ void LiftoffAssembler::emit_i8x16_swizzle(LiftoffRegister dst, void LiftoffAssembler::emit_i8x16_relaxed_swizzle(LiftoffRegister dst, LiftoffRegister lhs, LiftoffRegister rhs) { - bailout(kRelaxedSimd, "emit_i8x16_relaxed_swizzle"); + Simd128Register src1 = lhs.fp(); + Simd128Register src2 = rhs.fp(); + Simd128Register dest = dst.fp(); + Simd128Register temp = + GetUnusedRegister(kFpReg, LiftoffRegList{dest, src1, src2}).fp(); + I8x16Swizzle(dest, src1, src2, r0, r1, kScratchDoubleReg, temp); } void LiftoffAssembler::emit_i32x4_relaxed_trunc_f32x4_s(LiftoffRegister dst,