Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: src/compiler/simd-scalar-lowering.cc

Issue 2861113002: [wasm] Add simd lowering for I16x8Neg (Closed)
Patch Set: Enable I16x8Neg test for SIMD_LOWERING_TARGET Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-simd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simd-scalar-lowering.cc
diff --git a/src/compiler/simd-scalar-lowering.cc b/src/compiler/simd-scalar-lowering.cc
index 5cc6eebfb557d6db8a347d3e7394c48a30e8ba45..512b46557360c708fe14628b3f68fbb4ea52fef6 100644
--- a/src/compiler/simd-scalar-lowering.cc
+++ b/src/compiler/simd-scalar-lowering.cc
@@ -829,15 +829,20 @@ void SimdScalarLowering::LowerNode(Node* node) {
LowerIntMinMax(node, machine()->Uint32LessThan(), false, rep_type);
break;
}
- case IrOpcode::kI32x4Neg: {
+ case IrOpcode::kI32x4Neg:
+ case IrOpcode::kI16x8Neg: {
DCHECK(node->InputCount() == 1);
Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type);
- Node* rep_node[kNumLanes32];
+ int num_lanes = NumLanes(rep_type);
+ Node** rep_node = zone()->NewArray<Node*>(num_lanes);
Node* zero = graph()->NewNode(common()->Int32Constant(0));
- for (int i = 0; i < kNumLanes32; ++i) {
+ for (int i = 0; i < num_lanes; ++i) {
rep_node[i] = graph()->NewNode(machine()->Int32Sub(), zero, rep[i]);
+ if (node->opcode() == IrOpcode::kI16x8Neg) {
+ rep_node[i] = FixUpperBits(rep_node[i], kShift16);
+ }
}
- ReplaceNode(node, rep_node, kNumLanes32);
+ ReplaceNode(node, rep_node, num_lanes);
break;
}
case IrOpcode::kS128Not: {
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-simd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698