Commit 74924382 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][arm][liftoff] Implement i64x2 signed compares

Extract code sequence out into macro-assembler for sharing between
Liftoff and TurboFan.

Bug: v8:11415
Change-Id: I76a5124eea917dc15385c90ce82fccdb31619295
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2707772Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72986}
parent 0f783b1d
......@@ -2650,6 +2650,19 @@ void TurboAssembler::I64x2Eq(QwNeonRegister dst, QwNeonRegister src1,
vand(dst, dst, scratch);
}
void TurboAssembler::I64x2GtS(QwNeonRegister dst, QwNeonRegister src1,
QwNeonRegister src2) {
vqsub(NeonS64, dst, src2, src1);
vshr(NeonS64, dst, dst, 63);
}
void TurboAssembler::I64x2GeS(QwNeonRegister dst, QwNeonRegister src1,
QwNeonRegister src2) {
vqsub(NeonS64, dst, src1, src2);
vshr(NeonS64, dst, dst, 63);
vmvn(dst, dst);
}
void TurboAssembler::V64x2AllTrue(Register dst, QwNeonRegister src) {
UseScratchRegisterScope temps(this);
QwNeonRegister tmp = temps.AcquireQ();
......
......@@ -571,6 +571,8 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
// and be used in both TurboFan and Liftoff.
void I64x2BitMask(Register dst, QwNeonRegister src);
void I64x2Eq(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
void I64x2GtS(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
void I64x2GeS(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
void V64x2AllTrue(Register dst, QwNeonRegister src);
private:
......
......@@ -2466,18 +2466,13 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI64x2GtS: {
Simd128Register dst = i.OutputSimd128Register();
__ vqsub(NeonS64, dst, i.InputSimd128Register(1),
i.InputSimd128Register(0));
__ vshr(NeonS64, dst, dst, 63);
__ I64x2GtS(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kArmI64x2GeS: {
Simd128Register dst = i.OutputSimd128Register();
__ vqsub(NeonS64, dst, i.InputSimd128Register(0),
i.InputSimd128Register(1));
__ vshr(NeonS64, dst, dst, 63);
__ vmvn(dst, dst);
__ I64x2GeS(i.OutputSimd128Register(), i.InputSimd128Register(0),
i.InputSimd128Register(1));
break;
}
case kArmI32x4Eq: {
......
......@@ -3777,12 +3777,14 @@ void LiftoffAssembler::emit_i64x2_ne(LiftoffRegister dst, LiftoffRegister lhs,
void LiftoffAssembler::emit_i64x2_gt_s(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "i64x2.gt_s");
I64x2GtS(liftoff::GetSimd128Register(dst), liftoff::GetSimd128Register(lhs),
liftoff::GetSimd128Register(rhs));
}
void LiftoffAssembler::emit_i64x2_ge_s(LiftoffRegister dst, LiftoffRegister lhs,
LiftoffRegister rhs) {
bailout(kSimd, "i64x2.ge_s");
I64x2GeS(liftoff::GetSimd128Register(dst), liftoff::GetSimd128Register(lhs),
liftoff::GetSimd128Register(rhs));
}
void LiftoffAssembler::emit_f32x4_eq(LiftoffRegister dst, LiftoffRegister lhs,
......
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