Commit 646bdbf8 authored by Zhi An Ng's avatar Zhi An Ng Committed by Commit Bot

[wasm-simd][arm] Prototype i64x2 widen i32x4 instructions

Prototype these 4 instructions:

- i64x2.widen_low_i32x4_s
- i64x2.widen_high_i32x4_s
- i64x2.widen_low_i32x4_u
- i64x2.widen_high_i32x4_u

Bug: v8:10972
Change-Id: I57508a7fcafdf3b8a9477d6e9292fbb6b67e3619
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2612342
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72029}
parent dff4f7a9
......@@ -2202,6 +2202,26 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
__ add(dst, dst, Operand(tmp, LSL, 1));
break;
}
case kArmI64x2SConvertI32x4Low: {
__ vmovl(NeonS32, i.OutputSimd128Register(),
i.InputSimd128Register(0).low());
break;
}
case kArmI64x2SConvertI32x4High: {
__ vmovl(NeonS32, i.OutputSimd128Register(),
i.InputSimd128Register(0).high());
break;
}
case kArmI64x2UConvertI32x4Low: {
__ vmovl(NeonU32, i.OutputSimd128Register(),
i.InputSimd128Register(0).low());
break;
}
case kArmI64x2UConvertI32x4High: {
__ vmovl(NeonU32, i.OutputSimd128Register(),
i.InputSimd128Register(0).high());
break;
}
case kArmF32x4Splat: {
int src_code = i.InputFloatRegister(0).code();
__ vdup(Neon32, i.OutputSimd128Register(),
......
......@@ -188,6 +188,10 @@ namespace compiler {
V(ArmI64x2ShrU) \
V(ArmI64x2BitMask) \
V(ArmI64x2Eq) \
V(ArmI64x2SConvertI32x4Low) \
V(ArmI64x2SConvertI32x4High) \
V(ArmI64x2UConvertI32x4Low) \
V(ArmI64x2UConvertI32x4High) \
V(ArmI32x4Splat) \
V(ArmI32x4ExtractLane) \
V(ArmI32x4ReplaceLane) \
......
......@@ -168,6 +168,10 @@ int InstructionScheduler::GetTargetInstructionFlags(
case kArmI64x2ShrU:
case kArmI64x2BitMask:
case kArmI64x2Eq:
case kArmI64x2SConvertI32x4Low:
case kArmI64x2SConvertI32x4High:
case kArmI64x2UConvertI32x4Low:
case kArmI64x2UConvertI32x4High:
case kArmI32x4Splat:
case kArmI32x4ExtractLane:
case kArmI32x4ReplaceLane:
......
......@@ -2605,6 +2605,10 @@ void InstructionSelector::VisitWord32AtomicPairCompareExchange(Node* node) {
V(F32x4Neg, kArmF32x4Neg) \
V(F32x4RecipApprox, kArmF32x4RecipApprox) \
V(F32x4RecipSqrtApprox, kArmF32x4RecipSqrtApprox) \
V(I64x2SConvertI32x4Low, kArmI64x2SConvertI32x4Low) \
V(I64x2SConvertI32x4High, kArmI64x2SConvertI32x4High) \
V(I64x2UConvertI32x4Low, kArmI64x2UConvertI32x4Low) \
V(I64x2UConvertI32x4High, kArmI64x2UConvertI32x4High) \
V(I32x4SConvertF32x4, kArmI32x4SConvertF32x4) \
V(I32x4SConvertI16x8Low, kArmI32x4SConvertI16x8Low) \
V(I32x4SConvertI16x8High, kArmI32x4SConvertI16x8High) \
......
......@@ -2748,7 +2748,8 @@ void InstructionSelector::VisitI64x2Eq(Node* node) { UNIMPLEMENTED(); }
// && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM
// && !V8_TARGET_ARCH_MIPS64 && !V8_TARGET_ARCH_MIPS
#if !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32
#if !V8_TARGET_ARCH_ARM64 && !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \
!V8_TARGET_ARCH_ARM
// TODO(v8:10972) Prototype i64x2 widen i32x4.
void InstructionSelector::VisitI64x2SConvertI32x4Low(Node* node) {
UNIMPLEMENTED();
......@@ -2766,6 +2767,7 @@ void InstructionSelector::VisitI64x2UConvertI32x4High(Node* node) {
UNIMPLEMENTED();
}
#endif // !V8_TARGET_ARCH_ARM64 || !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32
// && !V8_TARGET_ARCH_ARM
#if !V8_TARGET_ARCH_ARM64
// TODO(v8:11168): Prototyping prefetch.
......
......@@ -1806,7 +1806,8 @@ WASM_SIMD_TEST(I32x4ConvertI16x8) {
// TODO(v8:10972) Prototyping i64x2 convert from i32x4.
// Tests both signed and unsigned conversion from I32x4 (unpacking).
#if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32
#if V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || \
V8_TARGET_ARCH_ARM
WASM_SIMD_TEST_NO_LOWERING(I64x2ConvertI32x4) {
FLAG_SCOPE(wasm_simd_post_mvp);
WasmRunner<int32_t, int32_t> r(execution_tier, lower_simd);
......@@ -1841,7 +1842,8 @@ WASM_SIMD_TEST_NO_LOWERING(I64x2ConvertI32x4) {
}
}
}
#endif // V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32
#endif // V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 ||
// V8_TARGET_ARCH_ARM
void RunI32x4UnOpTest(TestExecutionTier execution_tier, LowerSimd lower_simd,
WasmOpcode opcode, Int32UnOp 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