| 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/generic-node-inl.h" | 5 #include "src/compiler/generic-node-inl.h" |
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
| 8 | 8 |
| 9 namespace v8 { | 9 namespace v8 { |
| 10 namespace internal { | 10 namespace internal { |
| (...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 void InstructionSelector::VisitInt32Div(Node* node) { | 538 void InstructionSelector::VisitInt32Div(Node* node) { |
| 539 VisitDiv(this, node, kX64Idiv32); | 539 VisitDiv(this, node, kX64Idiv32); |
| 540 } | 540 } |
| 541 | 541 |
| 542 | 542 |
| 543 void InstructionSelector::VisitInt64Div(Node* node) { | 543 void InstructionSelector::VisitInt64Div(Node* node) { |
| 544 VisitDiv(this, node, kX64Idiv); | 544 VisitDiv(this, node, kX64Idiv); |
| 545 } | 545 } |
| 546 | 546 |
| 547 | 547 |
| 548 void InstructionSelector::VisitInt32UDiv(Node* node) { | 548 void InstructionSelector::VisitUint32Div(Node* node) { |
| 549 VisitDiv(this, node, kX64Udiv32); | 549 VisitDiv(this, node, kX64Udiv32); |
| 550 } | 550 } |
| 551 | 551 |
| 552 | 552 |
| 553 void InstructionSelector::VisitInt64UDiv(Node* node) { | 553 void InstructionSelector::VisitUint64Div(Node* node) { |
| 554 VisitDiv(this, node, kX64Udiv); | 554 VisitDiv(this, node, kX64Udiv); |
| 555 } | 555 } |
| 556 | 556 |
| 557 | 557 |
| 558 static void VisitMod(InstructionSelector* selector, Node* node, | 558 static void VisitMod(InstructionSelector* selector, Node* node, |
| 559 ArchOpcode opcode) { | 559 ArchOpcode opcode) { |
| 560 X64OperandGenerator g(selector); | 560 X64OperandGenerator g(selector); |
| 561 InstructionOperand* temps[] = {g.TempRegister(rax), g.TempRegister(rdx)}; | 561 InstructionOperand* temps[] = {g.TempRegister(rax), g.TempRegister(rdx)}; |
| 562 selector->Emit( | 562 selector->Emit( |
| 563 opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax), | 563 opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax), |
| 564 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); | 564 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); |
| 565 } | 565 } |
| 566 | 566 |
| 567 | 567 |
| 568 void InstructionSelector::VisitInt32Mod(Node* node) { | 568 void InstructionSelector::VisitInt32Mod(Node* node) { |
| 569 VisitMod(this, node, kX64Idiv32); | 569 VisitMod(this, node, kX64Idiv32); |
| 570 } | 570 } |
| 571 | 571 |
| 572 | 572 |
| 573 void InstructionSelector::VisitInt64Mod(Node* node) { | 573 void InstructionSelector::VisitInt64Mod(Node* node) { |
| 574 VisitMod(this, node, kX64Idiv); | 574 VisitMod(this, node, kX64Idiv); |
| 575 } | 575 } |
| 576 | 576 |
| 577 | 577 |
| 578 void InstructionSelector::VisitInt32UMod(Node* node) { | 578 void InstructionSelector::VisitUint32Mod(Node* node) { |
| 579 VisitMod(this, node, kX64Udiv32); | 579 VisitMod(this, node, kX64Udiv32); |
| 580 } | 580 } |
| 581 | 581 |
| 582 | 582 |
| 583 void InstructionSelector::VisitInt64UMod(Node* node) { | 583 void InstructionSelector::VisitUint64Mod(Node* node) { |
| 584 VisitMod(this, node, kX64Udiv); | 584 VisitMod(this, node, kX64Udiv); |
| 585 } | 585 } |
| 586 | 586 |
| 587 | 587 |
| 588 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { | 588 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { |
| 589 X64OperandGenerator g(this); | 589 X64OperandGenerator g(this); |
| 590 // TODO(turbofan): X64 SSE conversions should take an operand. | 590 // TODO(turbofan): X64 SSE conversions should take an operand. |
| 591 Emit(kSSECvtss2sd, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); | 591 Emit(kSSECvtss2sd, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); |
| 592 } | 592 } |
| 593 | 593 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 call_instr->MarkAsCall(); | 831 call_instr->MarkAsCall(); |
| 832 if (deoptimization != NULL) { | 832 if (deoptimization != NULL) { |
| 833 DCHECK(continuation != NULL); | 833 DCHECK(continuation != NULL); |
| 834 call_instr->MarkAsControl(); | 834 call_instr->MarkAsControl(); |
| 835 } | 835 } |
| 836 } | 836 } |
| 837 | 837 |
| 838 } // namespace compiler | 838 } // namespace compiler |
| 839 } // namespace internal | 839 } // namespace internal |
| 840 } // namespace v8 | 840 } // namespace v8 |
| OLD | NEW |