Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: src/compiler/instruction.h

Issue 2101653003: [Turbofan] Simplify operand canonicalization on archs with simple FP aliasing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/instruction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(); 608 MachineRepresentation rep = LocationOperand::cast(this)->representation();
609 // Preserve FP representation so we can check for interference on 609 MachineRepresentation canonical = MachineRepresentation::kNone;
610 // architectures with complex register aliasing. 610 if (IsFloatingPoint(rep)) {
611 MachineRepresentation canonical = 611 if (kSimpleFPAliasing) {
612 IsFPRegister() ? rep : MachineRepresentation::kNone; 612 // Archs with simple aliasing can treat all FP operands the same.
613 canonical = MachineRepresentation::kFloat64;
614 } else {
615 // We need to distinguish FP operands of different reps when FP
616 // aliasing is not simple (e.g. ARM).
617 canonical = rep;
618 }
619 }
613 return InstructionOperand::KindField::update( 620 return InstructionOperand::KindField::update(
614 LocationOperand::RepresentationField::update(this->value_, canonical), 621 LocationOperand::RepresentationField::update(this->value_, canonical),
615 LocationOperand::EXPLICIT); 622 LocationOperand::EXPLICIT);
616 } 623 }
617 return this->value_; 624 return this->value_;
618 } 625 }
619 626
620
621 // Required for maps that don't care about machine type. 627 // Required for maps that don't care about machine type.
622 struct CompareOperandModuloType { 628 struct CompareOperandModuloType {
623 bool operator()(const InstructionOperand& a, 629 bool operator()(const InstructionOperand& a,
624 const InstructionOperand& b) const { 630 const InstructionOperand& b) const {
625 return a.CompareCanonicalized(b); 631 return a.CompareCanonicalized(b);
626 } 632 }
627 }; 633 };
628 634
629 635
630 class MoveOperands final : public ZoneObject { 636 class MoveOperands final : public ZoneObject {
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 1487
1482 1488
1483 std::ostream& operator<<(std::ostream& os, 1489 std::ostream& operator<<(std::ostream& os,
1484 const PrintableInstructionSequence& code); 1490 const PrintableInstructionSequence& code);
1485 1491
1486 } // namespace compiler 1492 } // namespace compiler
1487 } // namespace internal 1493 } // namespace internal
1488 } // namespace v8 1494 } // namespace v8
1489 1495
1490 #endif // V8_COMPILER_INSTRUCTION_H_ 1496 #endif // V8_COMPILER_INSTRUCTION_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/instruction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698