| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/instruction-selector-impl.h" | 5 #include "src/compiler/instruction-selector-impl.h" |
| 6 #include "src/compiler/node-matchers.h" | 6 #include "src/compiler/node-matchers.h" |
| 7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 void InstructionSelector::VisitWord32Sar(Node* node) { | 496 void InstructionSelector::VisitWord32Sar(Node* node) { |
| 497 VisitShift(this, node, kIA32Sar); | 497 VisitShift(this, node, kIA32Sar); |
| 498 } | 498 } |
| 499 | 499 |
| 500 | 500 |
| 501 void InstructionSelector::VisitWord32Ror(Node* node) { | 501 void InstructionSelector::VisitWord32Ror(Node* node) { |
| 502 VisitShift(this, node, kIA32Ror); | 502 VisitShift(this, node, kIA32Ror); |
| 503 } | 503 } |
| 504 | 504 |
| 505 | 505 |
| 506 void InstructionSelector::VisitWord32Clz(Node* node) { |
| 507 IA32OperandGenerator g(this); |
| 508 Emit(kIA32Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 509 } |
| 510 |
| 511 |
| 506 void InstructionSelector::VisitInt32Add(Node* node) { | 512 void InstructionSelector::VisitInt32Add(Node* node) { |
| 507 IA32OperandGenerator g(this); | 513 IA32OperandGenerator g(this); |
| 508 | 514 |
| 509 // Try to match the Add to a lea pattern | 515 // Try to match the Add to a lea pattern |
| 510 BaseWithIndexAndDisplacement32Matcher m(node); | 516 BaseWithIndexAndDisplacement32Matcher m(node); |
| 511 if (m.matches() && | 517 if (m.matches() && |
| 512 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { | 518 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { |
| 513 InstructionOperand inputs[4]; | 519 InstructionOperand inputs[4]; |
| 514 size_t input_count = 0; | 520 size_t input_count = 0; |
| 515 AddressingMode mode = g.GenerateMemoryOperandInputs( | 521 AddressingMode mode = g.GenerateMemoryOperandInputs( |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 if (CpuFeatures::IsSupported(SSE4_1)) { | 1171 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 1166 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1172 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
| 1167 MachineOperatorBuilder::kFloat64RoundTruncate; | 1173 MachineOperatorBuilder::kFloat64RoundTruncate; |
| 1168 } | 1174 } |
| 1169 return flags; | 1175 return flags; |
| 1170 } | 1176 } |
| 1171 | 1177 |
| 1172 } // namespace compiler | 1178 } // namespace compiler |
| 1173 } // namespace internal | 1179 } // namespace internal |
| 1174 } // namespace v8 | 1180 } // namespace v8 |
| OLD | NEW |