Commit 13414fb8 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][scalar-lowering] Implement i32x4_dot_i16x8_s

Bug: v8:10993
Change-Id: I9b3cd1499cc9ebb93690e4940e9d94c5f445e315
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2477432Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70587}
parent 208578dc
......@@ -141,6 +141,7 @@ void SimdScalarLowering::LowerGraph() {
V(I32x4ShrU) \
V(I32x4MinU) \
V(I32x4MaxU) \
V(I32x4DotI16x8S) \
V(I32x4Eq) \
V(I32x4Ne) \
V(I32x4LtS) \
......@@ -1620,6 +1621,25 @@ void SimdScalarLowering::LowerNode(Node* node) {
LowerIntMinMax(node, machine()->Uint32LessThan(), false, rep_type);
break;
}
case IrOpcode::kI32x4DotI16x8S: {
// i32x4.dot_i16x8_s wants the inputs to be i16x8, but outputs to i32x4.
DCHECK_EQ(2, node->InputCount());
Node** rep_left =
GetReplacementsWithType(node->InputAt(0), SimdType::kInt16x8);
Node** rep_right =
GetReplacementsWithType(node->InputAt(1), SimdType::kInt16x8);
int num_lanes = NumLanes(rep_type);
Node** rep_node = zone()->NewArray<Node*>(num_lanes);
for (int i = 0; i < num_lanes; ++i) {
Node* lo = graph()->NewNode(machine()->Int32Mul(), rep_left[i * 2],
rep_right[i * 2]);
Node* hi = graph()->NewNode(machine()->Int32Mul(), rep_left[i * 2 + 1],
rep_right[i * 2 + 1]);
rep_node[i] = graph()->NewNode(machine()->Int32Add(), lo, hi);
}
ReplaceNode(node, rep_node, num_lanes);
break;
}
case IrOpcode::kI64x2Neg: {
DCHECK_EQ(1, node->InputCount());
Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type);
......
......@@ -2229,7 +2229,7 @@ WASM_SIMD_TEST_NO_LOWERING(I16x8Q15MulRSatS) {
}
#endif // V8_TARGET_ARCH_ARM64
WASM_SIMD_TEST_NO_LOWERING(I32x4DotI16x8S) {
WASM_SIMD_TEST(I32x4DotI16x8S) {
WasmRunner<int32_t, int16_t, int16_t> r(execution_tier, lower_simd);
int32_t* g = r.builder().template AddGlobal<int32_t>(kWasmS128);
byte value1 = 0, value2 = 1;
......
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