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

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

Bug: v8:11416
Change-Id: I094e91b1e5b382e5eced24d198e1f6bbc1b4ae0f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2686311
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72793}
parent 0c760fad
......@@ -2155,6 +2155,16 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
// dst: [ (a2*b3 + a3*b2)<<32 + (a2*b2) | (a0*b1 + a1*b0)<<32 + (a0*b0) ]
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);
break;
}
case kArmI64x2Neg: {
Simd128Register dst = i.OutputSimd128Register();
__ vmov(dst, uint64_t{0});
......
......@@ -183,6 +183,7 @@ namespace compiler {
V(ArmF32x4DemoteF64x2Zero) \
V(ArmI64x2SplatI32Pair) \
V(ArmI64x2ReplaceLaneI32Pair) \
V(ArmI64x2Abs) \
V(ArmI64x2Neg) \
V(ArmI64x2Shl) \
V(ArmI64x2ShrS) \
......
......@@ -163,6 +163,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kArmF32x4DemoteF64x2Zero:
case kArmI64x2SplatI32Pair:
case kArmI64x2ReplaceLaneI32Pair:
case kArmI64x2Abs:
case kArmI64x2Neg:
case kArmI64x2Shl:
case kArmI64x2ShrS:
......
......@@ -2574,6 +2574,7 @@ void InstructionSelector::VisitWord32AtomicPairCompareExchange(Node* node) {
V(F32x4Neg, kArmF32x4Neg) \
V(F32x4RecipApprox, kArmF32x4RecipApprox) \
V(F32x4RecipSqrtApprox, kArmF32x4RecipSqrtApprox) \
V(I64x2Abs, kArmI64x2Abs) \
V(I64x2SConvertI32x4Low, kArmI64x2SConvertI32x4Low) \
V(I64x2SConvertI32x4High, kArmI64x2SConvertI32x4High) \
V(I64x2UConvertI32x4Low, kArmI64x2UConvertI32x4Low) \
......
......@@ -2801,11 +2801,6 @@ void InstructionSelector::VisitI32x4WidenI8x16S(Node* node) { UNIMPLEMENTED(); }
void InstructionSelector::VisitI32x4WidenI8x16U(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM64
// TODO(v8:11416) Prototyping i64x2.abs.
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM64
void InstructionSelector::VisitI64x2Abs(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM64
void InstructionSelector::VisitFinishRegion(Node* node) { EmitIdentity(node); }
void InstructionSelector::VisitParameter(Node* node) {
......
......@@ -951,12 +951,9 @@ WASM_SIMD_TEST(I64x2Neg) {
base::NegateWithWraparound);
}
// TODO(v8:11416) Prototyping i64x2.abs.
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64
WASM_SIMD_TEST_NO_LOWERING(I64x2Abs) {
RunI64x2UnOpTest(execution_tier, lower_simd, kExprI64x2Abs, std::abs);
}
#endif // V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64
void RunI64x2ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd,
WasmOpcode opcode, Int64ShiftOp expected_op) {
......
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