diff --git a/src/codegen/s390/macro-assembler-s390.cc b/src/codegen/s390/macro-assembler-s390.cc index a60d93691d..f6f1fe704a 100644 --- a/src/codegen/s390/macro-assembler-s390.cc +++ b/src/codegen/s390/macro-assembler-s390.cc @@ -5970,6 +5970,13 @@ void TurboAssembler::I32x4TruncSatF64x2UZero(Simd128Register dst, vpkls(dst, dst, scratch, Condition(0), Condition(3)); } +void TurboAssembler::S128Const(Simd128Register dst, uint64_t high, uint64_t low, + Register scratch1, Register scratch2) { + mov(scratch1, Operand(low)); + mov(scratch2, Operand(high)); + vlvgp(dst, scratch2, scratch1); +} + // Vector LE Load and Transform instructions. #ifdef V8_TARGET_BIG_ENDIAN #define IS_BIG_ENDIAN true diff --git a/src/codegen/s390/macro-assembler-s390.h b/src/codegen/s390/macro-assembler-s390.h index 75145af0c5..c12b5e5bae 100644 --- a/src/codegen/s390/macro-assembler-s390.h +++ b/src/codegen/s390/macro-assembler-s390.h @@ -1144,6 +1144,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase { Simd128Register scratch); void I32x4TruncSatF64x2UZero(Simd128Register dst, Simd128Register src, Simd128Register scratch); + void S128Const(Simd128Register dst, uint64_t high, uint64_t low, + Register scratch1, Register scratch2); void S128Select(Simd128Register dst, Simd128Register src1, Simd128Register src2, Simd128Register mask); diff --git a/src/compiler/backend/s390/code-generator-s390.cc b/src/compiler/backend/s390/code-generator-s390.cc index 5e09d59746..cc1ad41be7 100644 --- a/src/compiler/backend/s390/code-generator-s390.cc +++ b/src/compiler/backend/s390/code-generator-s390.cc @@ -2866,9 +2866,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( case kS390_S128Const: { uint64_t low = make_uint64(i.InputUint32(1), i.InputUint32(0)); uint64_t high = make_uint64(i.InputUint32(3), i.InputUint32(2)); - __ mov(r0, Operand(low)); - __ mov(ip, Operand(high)); - __ vlvgp(i.OutputSimd128Register(), ip, r0); + __ S128Const(i.OutputSimd128Register(), high, low, r0, ip); break; } case kS390_S128Zero: { diff --git a/src/wasm/baseline/s390/liftoff-assembler-s390.h b/src/wasm/baseline/s390/liftoff-assembler-s390.h index b79c67c4ef..91c8b6ad42 100644 --- a/src/wasm/baseline/s390/liftoff-assembler-s390.h +++ b/src/wasm/baseline/s390/liftoff-assembler-s390.h @@ -2662,7 +2662,13 @@ void LiftoffAssembler::emit_i8x16_bitmask(LiftoffRegister dst, void LiftoffAssembler::emit_s128_const(LiftoffRegister dst, const uint8_t imms[16]) { - bailout(kUnsupportedArchitecture, "emit_s128_const"); + uint64_t vals[2]; + memcpy(vals, imms, sizeof(vals)); +#ifdef V8_TARGET_BIG_ENDIAN + vals[0] = ByteReverse(vals[0]); + vals[1] = ByteReverse(vals[1]); +#endif + S128Const(dst.fp(), vals[1], vals[0], r0, ip); } void LiftoffAssembler::emit_s128_select(LiftoffRegister dst,