Commit 29b46b01 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

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

Bug: v8:11416
Change-Id: I9fe70ae588147a3e04c719f14d86fb80ed9b6caa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2686310
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72787}
parent 3a960542
...@@ -2233,6 +2233,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -2233,6 +2233,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ Mov(dst, i.InputInt8(1), i.InputRegister64(2)); __ Mov(dst, i.InputInt8(1), i.InputRegister64(2));
break; break;
} }
SIMD_UNOP_CASE(kArm64I64x2Abs, Abs, 2D);
SIMD_UNOP_CASE(kArm64I64x2Neg, Neg, 2D); SIMD_UNOP_CASE(kArm64I64x2Neg, Neg, 2D);
case kArm64I64x2Shl: { case kArm64I64x2Shl: {
ASSEMBLE_SIMD_SHIFT_LEFT(Shl, 6, V2D, Sshl, X); ASSEMBLE_SIMD_SHIFT_LEFT(Shl, 6, V2D, Sshl, X);
......
...@@ -230,6 +230,7 @@ namespace compiler { ...@@ -230,6 +230,7 @@ namespace compiler {
V(Arm64I64x2Splat) \ V(Arm64I64x2Splat) \
V(Arm64I64x2ExtractLane) \ V(Arm64I64x2ExtractLane) \
V(Arm64I64x2ReplaceLane) \ V(Arm64I64x2ReplaceLane) \
V(Arm64I64x2Abs) \
V(Arm64I64x2Neg) \ V(Arm64I64x2Neg) \
V(Arm64I64x2Shl) \ V(Arm64I64x2Shl) \
V(Arm64I64x2ShrS) \ V(Arm64I64x2ShrS) \
......
...@@ -195,6 +195,7 @@ int InstructionScheduler::GetTargetInstructionFlags( ...@@ -195,6 +195,7 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kArm64I64x2Splat: case kArm64I64x2Splat:
case kArm64I64x2ExtractLane: case kArm64I64x2ExtractLane:
case kArm64I64x2ReplaceLane: case kArm64I64x2ReplaceLane:
case kArm64I64x2Abs:
case kArm64I64x2Neg: case kArm64I64x2Neg:
case kArm64I64x2Shl: case kArm64I64x2Shl:
case kArm64I64x2ShrS: case kArm64I64x2ShrS:
......
...@@ -3424,6 +3424,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { ...@@ -3424,6 +3424,7 @@ void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) {
V(F32x4RecipApprox, kArm64F32x4RecipApprox) \ V(F32x4RecipApprox, kArm64F32x4RecipApprox) \
V(F32x4RecipSqrtApprox, kArm64F32x4RecipSqrtApprox) \ V(F32x4RecipSqrtApprox, kArm64F32x4RecipSqrtApprox) \
V(F32x4DemoteF64x2Zero, kArm64F32x4DemoteF64x2Zero) \ V(F32x4DemoteF64x2Zero, kArm64F32x4DemoteF64x2Zero) \
V(I64x2Abs, kArm64I64x2Abs) \
V(I64x2Neg, kArm64I64x2Neg) \ V(I64x2Neg, kArm64I64x2Neg) \
V(I64x2BitMask, kArm64I64x2BitMask) \ V(I64x2BitMask, kArm64I64x2BitMask) \
V(I32x4SConvertF32x4, kArm64I32x4SConvertF32x4) \ V(I32x4SConvertF32x4, kArm64I32x4SConvertF32x4) \
......
...@@ -2807,9 +2807,9 @@ void InstructionSelector::VisitI64x2GeS(Node* node) { UNIMPLEMENTED(); } ...@@ -2807,9 +2807,9 @@ void InstructionSelector::VisitI64x2GeS(Node* node) { UNIMPLEMENTED(); }
#endif //! V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_IA32 #endif //! V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_IA32
// TODO(v8:11416) Prototyping i64x2.abs. // TODO(v8:11416) Prototyping i64x2.abs.
#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 #if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM64
void InstructionSelector::VisitI64x2Abs(Node* node) { UNIMPLEMENTED(); } void InstructionSelector::VisitI64x2Abs(Node* node) { UNIMPLEMENTED(); }
#endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 #endif // !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM64
void InstructionSelector::VisitFinishRegion(Node* node) { EmitIdentity(node); } void InstructionSelector::VisitFinishRegion(Node* node) { EmitIdentity(node); }
......
...@@ -952,11 +952,11 @@ WASM_SIMD_TEST(I64x2Neg) { ...@@ -952,11 +952,11 @@ WASM_SIMD_TEST(I64x2Neg) {
} }
// TODO(v8:11416) Prototyping i64x2.abs. // TODO(v8:11416) Prototyping i64x2.abs.
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 #if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64
WASM_SIMD_TEST_NO_LOWERING(I64x2Abs) { WASM_SIMD_TEST_NO_LOWERING(I64x2Abs) {
RunI64x2UnOpTest(execution_tier, lower_simd, kExprI64x2Abs, std::abs); RunI64x2UnOpTest(execution_tier, lower_simd, kExprI64x2Abs, std::abs);
} }
#endif // V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 #endif // V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64
void RunI64x2ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd, void RunI64x2ShiftOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd,
WasmOpcode opcode, Int64ShiftOp expected_op) { 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