| OLD | NEW |
| 1 //===- subzero/src/IceTargetLoweringX8632Traits.h - x86-32 traits -*- C++ -*-=// | 1 //===- subzero/src/IceTargetLoweringX8632Traits.h - x86-32 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 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 assert(Var->getType() == IceType_f64); | 926 assert(Var->getType() == IceType_f64); |
| 927 Vars = Func->allocateArrayOf<Variable *>(1); | 927 Vars = Func->allocateArrayOf<Variable *>(1); |
| 928 Vars[0] = Var; | 928 Vars[0] = Var; |
| 929 NumVars = 1; | 929 NumVars = 1; |
| 930 } | 930 } |
| 931 | 931 |
| 932 Variable *Var; | 932 Variable *Var; |
| 933 Portion Part; | 933 Portion Part; |
| 934 }; | 934 }; |
| 935 | 935 |
| 936 /// SpillVariable decorates a Variable by linking it to another Variable. When | |
| 937 /// stack frame offsets are computed, the SpillVariable is given a distinct | |
| 938 /// stack slot only if its linked Variable has a register. If the linked | |
| 939 /// Variable has a stack slot, then the Variable and SpillVariable share that | |
| 940 /// slot. | |
| 941 class SpillVariable : public Variable { | |
| 942 SpillVariable() = delete; | |
| 943 SpillVariable(const SpillVariable &) = delete; | |
| 944 SpillVariable &operator=(const SpillVariable &) = delete; | |
| 945 | |
| 946 public: | |
| 947 static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index) { | |
| 948 return new (Func->allocate<SpillVariable>()) | |
| 949 SpillVariable(Func, Ty, Index); | |
| 950 } | |
| 951 constexpr static auto SpillVariableKind = | |
| 952 static_cast<OperandKind>(kVariable_Target); | |
| 953 static bool classof(const Operand *Operand) { | |
| 954 return Operand->getKind() == SpillVariableKind; | |
| 955 } | |
| 956 void setLinkedTo(Variable *Var) { LinkedTo = Var; } | |
| 957 Variable *getLinkedTo() const { return LinkedTo; } | |
| 958 // Inherit dump() and emit() from Variable. | |
| 959 | |
| 960 private: | |
| 961 SpillVariable(const Cfg *Func, Type Ty, SizeT Index) | |
| 962 : Variable(Func, SpillVariableKind, Ty, Index), LinkedTo(nullptr) {} | |
| 963 Variable *LinkedTo; | |
| 964 }; | |
| 965 | |
| 966 // Note: The following data structures are defined in IceInstX8632.cpp. | 936 // Note: The following data structures are defined in IceInstX8632.cpp. |
| 967 | 937 |
| 968 static const struct InstBrAttributesType { | 938 static const struct InstBrAttributesType { |
| 969 Cond::BrCond Opposite; | 939 Cond::BrCond Opposite; |
| 970 const char *DisplayString; | 940 const char *DisplayString; |
| 971 const char *EmitString; | 941 const char *EmitString; |
| 972 } InstBrAttributes[]; | 942 } InstBrAttributes[]; |
| 973 | 943 |
| 974 static const struct InstCmppsAttributesType { | 944 static const struct InstCmppsAttributesType { |
| 975 const char *EmitString; | 945 const char *EmitString; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 990 | 960 |
| 991 static uint8_t InstSegmentPrefixes[]; | 961 static uint8_t InstSegmentPrefixes[]; |
| 992 }; | 962 }; |
| 993 | 963 |
| 994 using Traits = ::Ice::X8632::TargetX8632Traits; | 964 using Traits = ::Ice::X8632::TargetX8632Traits; |
| 995 } // end of namespace X8632 | 965 } // end of namespace X8632 |
| 996 | 966 |
| 997 } // end of namespace Ice | 967 } // end of namespace Ice |
| 998 | 968 |
| 999 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H | 969 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H |
| OLD | NEW |