Commit 53cf5df4 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd] Implement v128.andnot scalar lowering

Bug: v8:10082
Change-Id: I5ade4269e70e09d0f98b51faf819163e736ae76b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1990507
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarDeepti Gandluri <gdeepti@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65939}
parent b92aca8e
......@@ -1140,6 +1140,22 @@ void SimdScalarLowering::LowerNode(Node* node) {
ReplaceNode(node, rep_node, kNumLanes32);
break;
}
case IrOpcode::kS128AndNot: {
DCHECK_EQ(2, node->InputCount());
Node** rep_left = GetReplacementsWithType(node->InputAt(0), rep_type);
Node** rep_right = GetReplacementsWithType(node->InputAt(1), rep_type);
int num_lanes = NumLanes(rep_type);
Node** rep_node = zone()->NewArray<Node*>(num_lanes);
Node* mask = graph()->NewNode(common()->Int32Constant(0xFFFFFFFF));
for (int i = 0; i < num_lanes; ++i) {
Node* not_rep_right =
graph()->NewNode(machine()->Word32Xor(), rep_right[i], mask);
rep_node[i] = graph()->NewNode(machine()->Word32And(), rep_left[i],
not_rep_right);
}
ReplaceNode(node, rep_node, num_lanes);
break;
}
case IrOpcode::kI32x4SConvertF32x4: {
LowerConvertFromFloat(node, true);
break;
......
......@@ -1909,7 +1909,7 @@ WASM_SIMD_TEST(S128Xor) {
}
// Bitwise operation, doesn't really matter what simd type we test it with.
WASM_SIMD_TEST_NO_LOWERING(S128AndNot) {
WASM_SIMD_TEST(S128AndNot) {
RunI32x4BinOpTest(execution_tier, lower_simd, kExprS128AndNot, AndNot);
}
......
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