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

[wasm-simd][arm64][arm][liftoff] Implement i64x2.abs

arm64 is straightforward, for arm we extract the code sequence into a
macro-assembler function.

Bug: v8:11416
Change-Id: I6dddcee700c497e29f1ee8094cd81adfb1df2f4e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2707769Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73030}
parent 48926e83
......@@ -2686,6 +2686,14 @@ void TurboAssembler::V64x2AllTrue(Register dst, QwNeonRegister src) {
// = defintion of i64x2.all_true.
}
void TurboAssembler::I64x2Abs(QwNeonRegister dst, QwNeonRegister src) {
UseScratchRegisterScope temps(this);
Simd128Register tmp = temps.AcquireQ();
vshr(NeonS64, tmp, src, 63);
veor(dst, src, tmp);
vsub(Neon64, dst, dst, tmp);
}
} // namespace internal
} // namespace v8
......
......@@ -574,6 +574,7 @@ class V8_EXPORT_PRIVATE TurboAssembler : public TurboAssemblerBase {
void I64x2GtS(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
void I64x2GeS(QwNeonRegister dst, QwNeonRegister src1, QwNeonRegister src2);
void V64x2AllTrue(Register dst, QwNeonRegister src);
void I64x2Abs(QwNeonRegister dst, QwNeonRegister src);
private:
// Compare single values and then load the fpscr flags to a register.
......
......@@ -2159,13 +2159,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
break;
}
case kArmI64x2Abs: {
Simd128Register dst = i.OutputSimd128Register();
Simd128Register src = i.InputSimd128Register(0);
UseScratchRegisterScope temps(tasm());
Simd128Register tmp = temps.AcquireQ();
__ vshr(NeonS64, tmp, src, 63);
__ veor(dst, src, tmp);
__ vsub(Neon64, dst, dst, tmp);
__ I64x2Abs(i.OutputSimd128Register(), i.InputSimd128Register(0));
break;
}
case kArmI64x2Neg: {
......
......@@ -4025,7 +4025,7 @@ void LiftoffAssembler::emit_i32x4_abs(LiftoffRegister dst,
void LiftoffAssembler::emit_i64x2_abs(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i64x2.abs");
I64x2Abs(liftoff::GetSimd128Register(dst), liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
......
......@@ -3068,7 +3068,7 @@ void LiftoffAssembler::emit_i32x4_abs(LiftoffRegister dst,
void LiftoffAssembler::emit_i64x2_abs(LiftoffRegister dst,
LiftoffRegister src) {
bailout(kSimd, "i64x2.abs");
Abs(dst.fp().V2D(), src.fp().V2D());
}
void LiftoffAssembler::StackCheck(Label* ool_code, Register limit_address) {
......
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