| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 | 408 |
| 409 void VisitMulHigh(InstructionSelector* selector, Node* node, | 409 void VisitMulHigh(InstructionSelector* selector, Node* node, |
| 410 ArchOpcode opcode) { | 410 ArchOpcode opcode) { |
| 411 X64OperandGenerator g(selector); | 411 X64OperandGenerator g(selector); |
| 412 Node* left = node->InputAt(0); | 412 Node* left = node->InputAt(0); |
| 413 Node* right = node->InputAt(1); | 413 Node* right = node->InputAt(1); |
| 414 if (selector->IsLive(left) && !selector->IsLive(right)) { | 414 if (selector->IsLive(left) && !selector->IsLive(right)) { |
| 415 std::swap(left, right); | 415 std::swap(left, right); |
| 416 } | 416 } |
| 417 // TODO(turbofan): We use UseUniqueRegister here to improve register |
| 418 // allocation. |
| 417 selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax), | 419 selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax), |
| 418 g.UseUnique(right)); | 420 g.UseUniqueRegister(right)); |
| 419 } | 421 } |
| 420 | 422 |
| 421 | 423 |
| 422 void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) { | 424 void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) { |
| 423 X64OperandGenerator g(selector); | 425 X64OperandGenerator g(selector); |
| 424 InstructionOperand* temps[] = {g.TempRegister(rdx)}; | 426 InstructionOperand* temps[] = {g.TempRegister(rdx)}; |
| 425 selector->Emit( | 427 selector->Emit( |
| 426 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), | 428 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), |
| 427 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); | 429 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); |
| 428 } | 430 } |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1070 if (CpuFeatures::IsSupported(SSE4_1)) { | 1072 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 1071 return MachineOperatorBuilder::kFloat64Floor | | 1073 return MachineOperatorBuilder::kFloat64Floor | |
| 1072 MachineOperatorBuilder::kFloat64Ceil | | 1074 MachineOperatorBuilder::kFloat64Ceil | |
| 1073 MachineOperatorBuilder::kFloat64RoundTruncate; | 1075 MachineOperatorBuilder::kFloat64RoundTruncate; |
| 1074 } | 1076 } |
| 1075 return MachineOperatorBuilder::kNoFlags; | 1077 return MachineOperatorBuilder::kNoFlags; |
| 1076 } | 1078 } |
| 1077 } // namespace compiler | 1079 } // namespace compiler |
| 1078 } // namespace internal | 1080 } // namespace internal |
| 1079 } // namespace v8 | 1081 } // namespace v8 |
| OLD | NEW |