| 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 #ifndef V8_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
| 6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <iosfwd> | 9 #include <iosfwd> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 bool InstructionOperand::IsSimd128StackSlot() const { | 598 bool InstructionOperand::IsSimd128StackSlot() const { |
| 599 return (IsAllocated() || IsExplicit()) && | 599 return (IsAllocated() || IsExplicit()) && |
| 600 LocationOperand::cast(this)->location_kind() == | 600 LocationOperand::cast(this)->location_kind() == |
| 601 LocationOperand::STACK_SLOT && | 601 LocationOperand::STACK_SLOT && |
| 602 LocationOperand::cast(this)->representation() == | 602 LocationOperand::cast(this)->representation() == |
| 603 MachineRepresentation::kSimd128; | 603 MachineRepresentation::kSimd128; |
| 604 } | 604 } |
| 605 | 605 |
| 606 uint64_t InstructionOperand::GetCanonicalizedValue() const { | 606 uint64_t InstructionOperand::GetCanonicalizedValue() const { |
| 607 if (IsAllocated() || IsExplicit()) { | 607 if (IsAllocated() || IsExplicit()) { |
| 608 MachineRepresentation rep = LocationOperand::cast(this)->representation(); | |
| 609 MachineRepresentation canonical = MachineRepresentation::kNone; | 608 MachineRepresentation canonical = MachineRepresentation::kNone; |
| 610 if (IsFloatingPoint(rep)) { | 609 if (IsFPRegister()) { |
| 611 if (kSimpleFPAliasing) { | 610 if (kSimpleFPAliasing) { |
| 612 // Archs with simple aliasing can treat all FP operands the same. | 611 // We treat all FP register operands the same for simple aliasing. |
| 613 canonical = MachineRepresentation::kFloat64; | 612 canonical = MachineRepresentation::kFloat64; |
| 614 } else { | 613 } else { |
| 615 // We need to distinguish FP operands of different reps when FP | 614 // We need to distinguish FP register operands of different reps when |
| 616 // aliasing is not simple (e.g. ARM). | 615 // aliasing is not simple (e.g. ARM). |
| 617 canonical = rep; | 616 canonical = LocationOperand::cast(this)->representation(); |
| 618 } | 617 } |
| 619 } | 618 } |
| 620 return InstructionOperand::KindField::update( | 619 return InstructionOperand::KindField::update( |
| 621 LocationOperand::RepresentationField::update(this->value_, canonical), | 620 LocationOperand::RepresentationField::update(this->value_, canonical), |
| 622 LocationOperand::EXPLICIT); | 621 LocationOperand::EXPLICIT); |
| 623 } | 622 } |
| 624 return this->value_; | 623 return this->value_; |
| 625 } | 624 } |
| 626 | 625 |
| 627 // Required for maps that don't care about machine type. | 626 // Required for maps that don't care about machine type. |
| (...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1487 | 1486 |
| 1488 | 1487 |
| 1489 std::ostream& operator<<(std::ostream& os, | 1488 std::ostream& operator<<(std::ostream& os, |
| 1490 const PrintableInstructionSequence& code); | 1489 const PrintableInstructionSequence& code); |
| 1491 | 1490 |
| 1492 } // namespace compiler | 1491 } // namespace compiler |
| 1493 } // namespace internal | 1492 } // namespace internal |
| 1494 } // namespace v8 | 1493 } // namespace v8 |
| 1495 | 1494 |
| 1496 #endif // V8_COMPILER_INSTRUCTION_H_ | 1495 #endif // V8_COMPILER_INSTRUCTION_H_ |
| OLD | NEW |