| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/simd-scalar-lowering.h" | 5 #include "src/compiler/simd-scalar-lowering.h" |
| 6 #include "src/compiler/diamond.h" | 6 #include "src/compiler/diamond.h" |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 | 10 |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 case IrOpcode::kI32x4MaxU: | 822 case IrOpcode::kI32x4MaxU: |
| 823 case IrOpcode::kI16x8MaxU: { | 823 case IrOpcode::kI16x8MaxU: { |
| 824 LowerIntMinMax(node, machine()->Uint32LessThan(), true, rep_type); | 824 LowerIntMinMax(node, machine()->Uint32LessThan(), true, rep_type); |
| 825 break; | 825 break; |
| 826 } | 826 } |
| 827 case IrOpcode::kI32x4MinU: | 827 case IrOpcode::kI32x4MinU: |
| 828 case IrOpcode::kI16x8MinU: { | 828 case IrOpcode::kI16x8MinU: { |
| 829 LowerIntMinMax(node, machine()->Uint32LessThan(), false, rep_type); | 829 LowerIntMinMax(node, machine()->Uint32LessThan(), false, rep_type); |
| 830 break; | 830 break; |
| 831 } | 831 } |
| 832 case IrOpcode::kI32x4Neg: { | 832 case IrOpcode::kI32x4Neg: |
| 833 case IrOpcode::kI16x8Neg: { |
| 833 DCHECK(node->InputCount() == 1); | 834 DCHECK(node->InputCount() == 1); |
| 834 Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type); | 835 Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type); |
| 835 Node* rep_node[kNumLanes32]; | 836 int num_lanes = NumLanes(rep_type); |
| 837 Node** rep_node = zone()->NewArray<Node*>(num_lanes); |
| 836 Node* zero = graph()->NewNode(common()->Int32Constant(0)); | 838 Node* zero = graph()->NewNode(common()->Int32Constant(0)); |
| 837 for (int i = 0; i < kNumLanes32; ++i) { | 839 for (int i = 0; i < num_lanes; ++i) { |
| 838 rep_node[i] = graph()->NewNode(machine()->Int32Sub(), zero, rep[i]); | 840 rep_node[i] = graph()->NewNode(machine()->Int32Sub(), zero, rep[i]); |
| 841 if (node->opcode() == IrOpcode::kI16x8Neg) { |
| 842 rep_node[i] = FixUpperBits(rep_node[i], kShift16); |
| 843 } |
| 839 } | 844 } |
| 840 ReplaceNode(node, rep_node, kNumLanes32); | 845 ReplaceNode(node, rep_node, num_lanes); |
| 841 break; | 846 break; |
| 842 } | 847 } |
| 843 case IrOpcode::kS128Not: { | 848 case IrOpcode::kS128Not: { |
| 844 DCHECK(node->InputCount() == 1); | 849 DCHECK(node->InputCount() == 1); |
| 845 Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type); | 850 Node** rep = GetReplacementsWithType(node->InputAt(0), rep_type); |
| 846 Node* rep_node[kNumLanes32]; | 851 Node* rep_node[kNumLanes32]; |
| 847 Node* mask = graph()->NewNode(common()->Int32Constant(0xffffffff)); | 852 Node* mask = graph()->NewNode(common()->Int32Constant(0xffffffff)); |
| 848 for (int i = 0; i < kNumLanes32; ++i) { | 853 for (int i = 0; i < kNumLanes32; ++i) { |
| 849 rep_node[i] = graph()->NewNode(machine()->Word32Xor(), rep[i], mask); | 854 rep_node[i] = graph()->NewNode(machine()->Word32Xor(), rep[i], mask); |
| 850 } | 855 } |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 UNREACHABLE(); | 1153 UNREACHABLE(); |
| 1149 } | 1154 } |
| 1150 #undef PHI_CASE | 1155 #undef PHI_CASE |
| 1151 } | 1156 } |
| 1152 ReplaceNode(phi, rep_nodes, num_lanes); | 1157 ReplaceNode(phi, rep_nodes, num_lanes); |
| 1153 } | 1158 } |
| 1154 } | 1159 } |
| 1155 } // namespace compiler | 1160 } // namespace compiler |
| 1156 } // namespace internal | 1161 } // namespace internal |
| 1157 } // namespace v8 | 1162 } // namespace v8 |
| OLD | NEW |