Commit 1f9103e5 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][arm] Fix i64x2.neg

We were using vqsub incorrectly (which saturates), we need vsub
(wraparound).

Found this issue while running spec test simd_i64x2_arith.js.

Bug: v8:10835
Change-Id: Ic9d45d69e64fa5ff9ddad5de4690f3dd32d1384e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2389100Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69659}
parent 3017f895
......@@ -2150,7 +2150,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArmI64x2Neg: {
Simd128Register dst = i.OutputSimd128Register();
__ vmov(dst, uint64_t{0});
__ vqsub(NeonS64, dst, dst, i.InputSimd128Register(0));
__ vsub(Neon64, dst, dst, i.InputSimd128Register(0));
break;
}
case kArmI64x2Shl: {
......
......@@ -2488,8 +2488,8 @@ void LiftoffAssembler::emit_i64x2_neg(LiftoffRegister dst,
QwNeonRegister zero =
dst == src ? temps.AcquireQ() : liftoff::GetSimd128Register(dst);
vmov(zero, uint64_t{0});
vqsub(NeonS64, liftoff::GetSimd128Register(dst), zero,
liftoff::GetSimd128Register(src));
vsub(Neon64, liftoff::GetSimd128Register(dst), zero,
liftoff::GetSimd128Register(src));
}
void LiftoffAssembler::emit_i64x2_shl(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