| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 void InstructionSelector::VisitWord32Ror(Node* node) { | 548 void InstructionSelector::VisitWord32Ror(Node* node) { |
| 549 VisitWord32Shift(this, node, kX64Ror32); | 549 VisitWord32Shift(this, node, kX64Ror32); |
| 550 } | 550 } |
| 551 | 551 |
| 552 | 552 |
| 553 void InstructionSelector::VisitWord64Ror(Node* node) { | 553 void InstructionSelector::VisitWord64Ror(Node* node) { |
| 554 VisitWord64Shift(this, node, kX64Ror); | 554 VisitWord64Shift(this, node, kX64Ror); |
| 555 } | 555 } |
| 556 | 556 |
| 557 | 557 |
| 558 void InstructionSelector::VisitWord32Clz(Node* node) { |
| 559 X64OperandGenerator g(this); |
| 560 Emit(kX64Lzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 561 } |
| 562 |
| 563 |
| 558 void InstructionSelector::VisitInt32Add(Node* node) { | 564 void InstructionSelector::VisitInt32Add(Node* node) { |
| 559 X64OperandGenerator g(this); | 565 X64OperandGenerator g(this); |
| 560 | 566 |
| 561 // Try to match the Add to a leal pattern | 567 // Try to match the Add to a leal pattern |
| 562 BaseWithIndexAndDisplacement32Matcher m(node); | 568 BaseWithIndexAndDisplacement32Matcher m(node); |
| 563 if (m.matches() && | 569 if (m.matches() && |
| 564 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { | 570 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { |
| 565 EmitLea(this, kX64Lea32, node, m.index(), m.scale(), m.base(), | 571 EmitLea(this, kX64Lea32, node, m.index(), m.scale(), m.base(), |
| 566 m.displacement()); | 572 m.displacement()); |
| 567 return; | 573 return; |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1479 if (CpuFeatures::IsSupported(SSE4_1)) { | 1485 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 1480 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1486 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
| 1481 MachineOperatorBuilder::kFloat64RoundTruncate; | 1487 MachineOperatorBuilder::kFloat64RoundTruncate; |
| 1482 } | 1488 } |
| 1483 return flags; | 1489 return flags; |
| 1484 } | 1490 } |
| 1485 | 1491 |
| 1486 } // namespace compiler | 1492 } // namespace compiler |
| 1487 } // namespace internal | 1493 } // namespace internal |
| 1488 } // namespace v8 | 1494 } // namespace v8 |
| OLD | NEW |