| 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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 } | 443 } |
| 444 | 444 |
| 445 | 445 |
| 446 void InstructionSelector::VisitConvertInt32ToFloat64(Node* node) { | 446 void InstructionSelector::VisitConvertInt32ToFloat64(Node* node) { |
| 447 X64OperandGenerator g(this); | 447 X64OperandGenerator g(this); |
| 448 Emit(kSSEInt32ToFloat64, g.DefineAsDoubleRegister(node), | 448 Emit(kSSEInt32ToFloat64, g.DefineAsDoubleRegister(node), |
| 449 g.Use(node->InputAt(0))); | 449 g.Use(node->InputAt(0))); |
| 450 } | 450 } |
| 451 | 451 |
| 452 | 452 |
| 453 void InstructionSelector::VisitConvertUint32ToFloat64(Node* node) { |
| 454 X64OperandGenerator g(this); |
| 455 // TODO(turbofan): X64 SSE cvtqsi2sd should support operands. |
| 456 Emit(kSSEUint32ToFloat64, g.DefineAsDoubleRegister(node), |
| 457 g.UseRegister(node->InputAt(0))); |
| 458 } |
| 459 |
| 460 |
| 453 void InstructionSelector::VisitConvertFloat64ToInt32(Node* node) { | 461 void InstructionSelector::VisitConvertFloat64ToInt32(Node* node) { |
| 454 X64OperandGenerator g(this); | 462 X64OperandGenerator g(this); |
| 455 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 463 Emit(kSSEFloat64ToInt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 456 } | 464 } |
| 457 | 465 |
| 458 | 466 |
| 467 void InstructionSelector::VisitConvertFloat64ToUint32(Node* node) { |
| 468 X64OperandGenerator g(this); |
| 469 // TODO(turbofan): X64 SSE cvttsd2siq should support operands. |
| 470 Emit(kSSEFloat64ToUint32, g.DefineAsRegister(node), |
| 471 g.UseDoubleRegister(node->InputAt(0))); |
| 472 } |
| 473 |
| 474 |
| 459 void InstructionSelector::VisitFloat64Add(Node* node) { | 475 void InstructionSelector::VisitFloat64Add(Node* node) { |
| 460 X64OperandGenerator g(this); | 476 X64OperandGenerator g(this); |
| 461 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), | 477 Emit(kSSEFloat64Add, g.DefineSameAsFirst(node), |
| 462 g.UseDoubleRegister(node->InputAt(0)), | 478 g.UseDoubleRegister(node->InputAt(0)), |
| 463 g.UseDoubleRegister(node->InputAt(1))); | 479 g.UseDoubleRegister(node->InputAt(1))); |
| 464 } | 480 } |
| 465 | 481 |
| 466 | 482 |
| 467 void InstructionSelector::VisitFloat64Sub(Node* node) { | 483 void InstructionSelector::VisitFloat64Sub(Node* node) { |
| 468 X64OperandGenerator g(this); | 484 X64OperandGenerator g(this); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 if (descriptor->kind() == CallDescriptor::kCallAddress && | 673 if (descriptor->kind() == CallDescriptor::kCallAddress && |
| 658 buffer.pushed_count > 0) { | 674 buffer.pushed_count > 0) { |
| 659 ASSERT(deoptimization == NULL && continuation == NULL); | 675 ASSERT(deoptimization == NULL && continuation == NULL); |
| 660 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); | 676 Emit(kPopStack | MiscField::encode(buffer.pushed_count), NULL); |
| 661 } | 677 } |
| 662 } | 678 } |
| 663 | 679 |
| 664 } // namespace compiler | 680 } // namespace compiler |
| 665 } // namespace internal | 681 } // namespace internal |
| 666 } // namespace v8 | 682 } // namespace v8 |
| OLD | NEW |