S390 [liftoff]: Implement simd const128

Change-Id: I39049c88f48c81b2f8ce84e9589e05405abce3a6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3453783
Reviewed-by: Junliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#79056}
This commit is contained in:
Milad Fa 2022-02-10 14:51:22 -05:00 committed by V8 LUCI CQ
parent e08f7ae558
commit d022238167
4 changed files with 17 additions and 4 deletions

View File

@ -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

View File

@ -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);

View File

@ -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: {

View File

@ -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,