OLD | NEW |
1 //===- subzero/src/IceTargetLoweringX8664Traits.h - x86-64 traits -*- C++ -*-=// | 1 //===- subzero/src/IceTargetLoweringX8664Traits.h - x86-64 traits -*- C++ -*-=// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 (void)SegmentRegister; | 710 (void)SegmentRegister; |
711 return new (Func->allocate<X86OperandMem>()) | 711 return new (Func->allocate<X86OperandMem>()) |
712 X86OperandMem(Func, Ty, Base, Offset, Index, Shift); | 712 X86OperandMem(Func, Ty, Base, Offset, Index, Shift); |
713 } | 713 } |
714 Variable *getBase() const { return Base; } | 714 Variable *getBase() const { return Base; } |
715 Constant *getOffset() const { return Offset; } | 715 Constant *getOffset() const { return Offset; } |
716 Variable *getIndex() const { return Index; } | 716 Variable *getIndex() const { return Index; } |
717 uint16_t getShift() const { return Shift; } | 717 uint16_t getShift() const { return Shift; } |
718 SegmentRegisters getSegmentRegister() const { return DefaultSegment; } | 718 SegmentRegisters getSegmentRegister() const { return DefaultSegment; } |
719 void emitSegmentOverride(Assembler *) const {} | 719 void emitSegmentOverride(Assembler *) const {} |
720 Address toAsmAddress(Assembler *Asm) const; | 720 Address toAsmAddress(Assembler *Asm, |
| 721 const Ice::TargetLowering *Target) const; |
721 | 722 |
722 void emit(const Cfg *Func) const override; | 723 void emit(const Cfg *Func) const override; |
723 using X86Operand::dump; | 724 using X86Operand::dump; |
724 void dump(const Cfg *Func, Ostream &Str) const override; | 725 void dump(const Cfg *Func, Ostream &Str) const override; |
725 | 726 |
726 static bool classof(const Operand *Operand) { | 727 static bool classof(const Operand *Operand) { |
727 return Operand->getKind() == static_cast<OperandKind>(kMem); | 728 return Operand->getKind() == static_cast<OperandKind>(kMem); |
728 } | 729 } |
729 | 730 |
730 void setRandomized(bool R) { Randomized = R; } | 731 void setRandomized(bool R) { Randomized = R; } |
731 | 732 |
732 bool getRandomized() const { return Randomized; } | 733 bool getRandomized() const { return Randomized; } |
733 | 734 |
| 735 void setIgnoreStackAdjust(bool Ignore) { IgnoreStackAdjust = Ignore; } |
| 736 bool getIgnoreStackAdjust() const { return IgnoreStackAdjust; } |
| 737 |
734 private: | 738 private: |
735 X86OperandMem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset, | 739 X86OperandMem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset, |
736 Variable *Index, uint16_t Shift); | 740 Variable *Index, uint16_t Shift); |
737 | 741 |
738 Variable *Base; | 742 Variable *Base; |
739 Constant *Offset; | 743 Constant *Offset; |
740 Variable *Index; | 744 Variable *Index; |
741 uint16_t Shift; | 745 uint16_t Shift; |
742 /// A flag to show if this memory operand is a randomized one. Randomized | 746 /// A flag to show if this memory operand is a randomized one. Randomized |
743 /// memory operands are generated in | 747 /// memory operands are generated in |
744 /// TargetX86Base::randomizeOrPoolImmediate() | 748 /// TargetX86Base::randomizeOrPoolImmediate() |
745 bool Randomized = false; | 749 bool Randomized = false; |
| 750 /// Memory operations involving the stack pointer need to know when the |
| 751 /// stack pointer was moved temporarily. Ignore that adjustment in |
| 752 /// cases that should be pinned to the stack pointer, such as outgoing |
| 753 /// arguments to calls. |
| 754 bool IgnoreStackAdjust = false; |
746 }; | 755 }; |
747 | 756 |
748 /// VariableSplit is a way to treat an f64 memory location as a pair of i32 | 757 /// VariableSplit is a way to treat an f64 memory location as a pair of i32 |
749 /// locations (Low and High). This is needed for some cases of the Bitcast | 758 /// locations (Low and High). This is needed for some cases of the Bitcast |
750 /// instruction. Since it's not possible for integer registers to access the | 759 /// instruction. Since it's not possible for integer registers to access the |
751 /// XMM registers and vice versa, the lowering forces the f64 to be spilled to | 760 /// XMM registers and vice versa, the lowering forces the f64 to be spilled to |
752 /// the stack and then accesses through the VariableSplit. | 761 /// the stack and then accesses through the VariableSplit. |
753 // TODO(jpp): remove references to VariableSplit from IceInstX86Base as 64bit | 762 // TODO(jpp): remove references to VariableSplit from IceInstX86Base as 64bit |
754 // targets can natively handle these. | 763 // targets can natively handle these. |
755 class VariableSplit : public X86Operand { | 764 class VariableSplit : public X86Operand { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 848 |
840 } // end of namespace X86Internal | 849 } // end of namespace X86Internal |
841 | 850 |
842 namespace X8664 { | 851 namespace X8664 { |
843 using Traits = ::Ice::X86Internal::MachineTraits<TargetX8664>; | 852 using Traits = ::Ice::X86Internal::MachineTraits<TargetX8664>; |
844 } // end of namespace X8664 | 853 } // end of namespace X8664 |
845 | 854 |
846 } // end of namespace Ice | 855 } // end of namespace Ice |
847 | 856 |
848 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8664TRAITS_H | 857 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8664TRAITS_H |
OLD | NEW |