| 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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 Begin, | 269 Begin, |
| 270 // SSE2 is the PNaCl baseline instruction set. | 270 // SSE2 is the PNaCl baseline instruction set. |
| 271 SSE2 = Begin, | 271 SSE2 = Begin, |
| 272 SSE4_1, | 272 SSE4_1, |
| 273 End | 273 End |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 static const char *TargetName; | 276 static const char *TargetName; |
| 277 static constexpr Type WordType = IceType_i32; | 277 static constexpr Type WordType = IceType_i32; |
| 278 | 278 |
| 279 static IceString getRegName(RegNumT RegNum) { | 279 static const char *getRegName(RegNumT RegNum) { |
| 280 static const char *const RegNames[RegisterSet::Reg_NUM] = { | 280 static const char *const RegNames[RegisterSet::Reg_NUM] = { |
| 281 #define X(val, encode, name, base, scratch, preserved, stackptr, frameptr, \ | 281 #define X(val, encode, name, base, scratch, preserved, stackptr, frameptr, \ |
| 282 isGPR, is64, is32, is16, is8, isXmm, is64To8, is32To8, is16To8, \ | 282 isGPR, is64, is32, is16, is8, isXmm, is64To8, is32To8, is16To8, \ |
| 283 isTrunc8Rcvr, isAhRcvr, aliases) \ | 283 isTrunc8Rcvr, isAhRcvr, aliases) \ |
| 284 name, | 284 name, |
| 285 REGX8632_TABLE | 285 REGX8632_TABLE |
| 286 #undef X | 286 #undef X |
| 287 }; | 287 }; |
| 288 RegNum.assertIsValid(); | 288 RegNum.assertIsValid(); |
| 289 return RegNames[RegNum]; | 289 return RegNames[RegNum]; |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 /// stack slot only if its linked Variable has a register. If the linked | 940 /// stack slot only if its linked Variable has a register. If the linked |
| 941 /// Variable has a stack slot, then the Variable and SpillVariable share that | 941 /// Variable has a stack slot, then the Variable and SpillVariable share that |
| 942 /// slot. | 942 /// slot. |
| 943 class SpillVariable : public Variable { | 943 class SpillVariable : public Variable { |
| 944 SpillVariable() = delete; | 944 SpillVariable() = delete; |
| 945 SpillVariable(const SpillVariable &) = delete; | 945 SpillVariable(const SpillVariable &) = delete; |
| 946 SpillVariable &operator=(const SpillVariable &) = delete; | 946 SpillVariable &operator=(const SpillVariable &) = delete; |
| 947 | 947 |
| 948 public: | 948 public: |
| 949 static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index) { | 949 static SpillVariable *create(Cfg *Func, Type Ty, SizeT Index) { |
| 950 return new (Func->allocate<SpillVariable>()) SpillVariable(Ty, Index); | 950 return new (Func->allocate<SpillVariable>()) |
| 951 SpillVariable(Func, Ty, Index); |
| 951 } | 952 } |
| 952 constexpr static auto SpillVariableKind = | 953 constexpr static auto SpillVariableKind = |
| 953 static_cast<OperandKind>(kVariable_Target); | 954 static_cast<OperandKind>(kVariable_Target); |
| 954 static bool classof(const Operand *Operand) { | 955 static bool classof(const Operand *Operand) { |
| 955 return Operand->getKind() == SpillVariableKind; | 956 return Operand->getKind() == SpillVariableKind; |
| 956 } | 957 } |
| 957 void setLinkedTo(Variable *Var) { LinkedTo = Var; } | 958 void setLinkedTo(Variable *Var) { LinkedTo = Var; } |
| 958 Variable *getLinkedTo() const { return LinkedTo; } | 959 Variable *getLinkedTo() const { return LinkedTo; } |
| 959 // Inherit dump() and emit() from Variable. | 960 // Inherit dump() and emit() from Variable. |
| 960 | 961 |
| 961 private: | 962 private: |
| 962 SpillVariable(Type Ty, SizeT Index) | 963 SpillVariable(const Cfg *Func, Type Ty, SizeT Index) |
| 963 : Variable(SpillVariableKind, Ty, Index), LinkedTo(nullptr) {} | 964 : Variable(Func, SpillVariableKind, Ty, Index), LinkedTo(nullptr) {} |
| 964 Variable *LinkedTo; | 965 Variable *LinkedTo; |
| 965 }; | 966 }; |
| 966 | 967 |
| 967 // Note: The following data structures are defined in IceInstX8632.cpp. | 968 // Note: The following data structures are defined in IceInstX8632.cpp. |
| 968 | 969 |
| 969 static const struct InstBrAttributesType { | 970 static const struct InstBrAttributesType { |
| 970 Cond::BrCond Opposite; | 971 Cond::BrCond Opposite; |
| 971 const char *DisplayString; | 972 const char *DisplayString; |
| 972 const char *EmitString; | 973 const char *EmitString; |
| 973 } InstBrAttributes[]; | 974 } InstBrAttributes[]; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 990 | 991 |
| 991 static uint8_t InstSegmentPrefixes[]; | 992 static uint8_t InstSegmentPrefixes[]; |
| 992 }; | 993 }; |
| 993 | 994 |
| 994 using Traits = ::Ice::X8632::TargetX8632Traits; | 995 using Traits = ::Ice::X8632::TargetX8632Traits; |
| 995 } // end of namespace X8632 | 996 } // end of namespace X8632 |
| 996 | 997 |
| 997 } // end of namespace Ice | 998 } // end of namespace Ice |
| 998 | 999 |
| 999 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H | 1000 #endif // SUBZERO_SRC_ICETARGETLOWERINGX8632TRAITS_H |
| OLD | NEW |