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 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 void InstructionSelector::VisitInt32UMod(Node* node) { | 471 void InstructionSelector::VisitInt32UMod(Node* node) { |
472 VisitMod(this, node, kX64Udiv32); | 472 VisitMod(this, node, kX64Udiv32); |
473 } | 473 } |
474 | 474 |
475 | 475 |
476 void InstructionSelector::VisitInt64UMod(Node* node) { | 476 void InstructionSelector::VisitInt64UMod(Node* node) { |
477 VisitMod(this, node, kX64Udiv); | 477 VisitMod(this, node, kX64Udiv); |
478 } | 478 } |
479 | 479 |
480 | 480 |
| 481 void InstructionSelector::VisitChangeFloat32ToFloat64(Node* node) { |
| 482 X64OperandGenerator g(this); |
| 483 // TODO(turbofan): X64 SSE conversions should take an operand. |
| 484 Emit(kSSECvtss2sd, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); |
| 485 } |
| 486 |
| 487 |
481 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { | 488 void InstructionSelector::VisitChangeInt32ToFloat64(Node* node) { |
482 X64OperandGenerator g(this); | 489 X64OperandGenerator g(this); |
483 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 490 Emit(kSSEInt32ToFloat64, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
484 } | 491 } |
485 | 492 |
486 | 493 |
487 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { | 494 void InstructionSelector::VisitChangeUint32ToFloat64(Node* node) { |
488 X64OperandGenerator g(this); | 495 X64OperandGenerator g(this); |
489 // TODO(turbofan): X64 SSE cvtqsi2sd should support operands. | 496 // TODO(turbofan): X64 SSE cvtqsi2sd should support operands. |
490 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node), | 497 Emit(kSSEUint32ToFloat64, g.DefineAsRegister(node), |
(...skipping 18 matching lines...) Expand all Loading... |
509 Emit(kX64Movsxlq, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 516 Emit(kX64Movsxlq, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
510 } | 517 } |
511 | 518 |
512 | 519 |
513 void InstructionSelector::VisitChangeUint32ToUint64(Node* node) { | 520 void InstructionSelector::VisitChangeUint32ToUint64(Node* node) { |
514 X64OperandGenerator g(this); | 521 X64OperandGenerator g(this); |
515 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 522 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
516 } | 523 } |
517 | 524 |
518 | 525 |
| 526 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { |
| 527 X64OperandGenerator g(this); |
| 528 // TODO(turbofan): X64 SSE conversions should take an operand. |
| 529 Emit(kSSECvtsd2ss, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); |
| 530 } |
| 531 |
| 532 |
519 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { | 533 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { |
520 X64OperandGenerator g(this); | 534 X64OperandGenerator g(this); |
521 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 535 Emit(kX64Movl, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
522 } | 536 } |
523 | 537 |
524 | 538 |
525 void InstructionSelector::VisitFloat64Add(Node* node) { | 539 void InstructionSelector::VisitFloat64Add(Node* node) { |
526 X64OperandGenerator g(this); | 540 X64OperandGenerator g(this); |
527 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), | 541 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), |
528 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); | 542 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 call_instr->MarkAsCall(); | 728 call_instr->MarkAsCall(); |
715 if (deoptimization != NULL) { | 729 if (deoptimization != NULL) { |
716 DCHECK(continuation != NULL); | 730 DCHECK(continuation != NULL); |
717 call_instr->MarkAsControl(); | 731 call_instr->MarkAsControl(); |
718 } | 732 } |
719 } | 733 } |
720 | 734 |
721 } // namespace compiler | 735 } // namespace compiler |
722 } // namespace internal | 736 } // namespace internal |
723 } // namespace v8 | 737 } // namespace v8 |
OLD | NEW |