[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/+/2389100
Reviewed-by: Bill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69659}
This commit is contained in:
Ng Zhi An 2020-09-01 14:53:22 -07:00 committed by Commit Bot
parent 3017f895f1
commit 1f9103e5a9
2 changed files with 3 additions and 3 deletions

View File

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

View File

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