OLD | NEW |
1 //===- subzero/src/IceRegistersMIPS32.h - Register information --*- C++ -*-===// | 1 //===- subzero/src/IceRegistersMIPS32.h - Register information --*- 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // TODO(jvoung): Floating point and vector registers... | 65 // TODO(jvoung): Floating point and vector registers... |
66 // Need to model overlap and difference in encoding too. | 66 // Need to model overlap and difference in encoding too. |
67 | 67 |
68 static inline GPRRegister getEncodedGPR(RegNumT RegNum) { | 68 static inline GPRRegister getEncodedGPR(RegNumT RegNum) { |
69 assert(int(Reg_GPR_First) <= int(RegNum)); | 69 assert(int(Reg_GPR_First) <= int(RegNum)); |
70 assert(unsigned(RegNum) <= Reg_GPR_Last); | 70 assert(unsigned(RegNum) <= Reg_GPR_Last); |
71 return GPRRegister(RegNum - Reg_GPR_First); | 71 return GPRRegister(RegNum - Reg_GPR_First); |
72 } | 72 } |
73 | 73 |
74 static inline bool isGPRReg(RegNumT RegNum) { | 74 static inline bool isGPRReg(RegNumT RegNum) { |
75 return (int(Reg_GPR_First) <= int(RegNum)) && | 75 bool IsGPR = ((int(Reg_GPR_First) <= int(RegNum)) && |
76 (unsigned(RegNum) <= Reg_GPR_Last); | 76 (unsigned(RegNum) <= Reg_GPR_Last)) || |
| 77 ((int(Reg_I64PAIR_First) <= int(RegNum)) && |
| 78 (unsigned(RegNum) <= Reg_I64PAIR_Last)); |
| 79 return IsGPR; |
77 } | 80 } |
78 | 81 |
79 static inline FPRRegister getEncodedFPR(RegNumT RegNum) { | 82 static inline FPRRegister getEncodedFPR(RegNumT RegNum) { |
80 assert(int(Reg_FPR_First) <= int(RegNum)); | 83 assert(int(Reg_FPR_First) <= int(RegNum)); |
81 assert(unsigned(RegNum) <= Reg_FPR_Last); | 84 assert(unsigned(RegNum) <= Reg_FPR_Last); |
82 return FPRRegister(RegNum - Reg_FPR_First); | 85 return FPRRegister(RegNum - Reg_FPR_First); |
83 } | 86 } |
84 | 87 |
85 static inline bool isFPRReg(RegNumT RegNum) { | 88 static inline bool isFPRReg(RegNumT RegNum) { |
86 return (int(Reg_FPR_First) <= int(RegNum)) && | 89 return (int(Reg_FPR_First) <= int(RegNum)) && |
(...skipping 30 matching lines...) Expand all Loading... |
117 | 120 |
118 } // end of namespace RegMIPS32 | 121 } // end of namespace RegMIPS32 |
119 | 122 |
120 // Extend enum RegClass with MIPS32-specific register classes (if any). | 123 // Extend enum RegClass with MIPS32-specific register classes (if any). |
121 enum RegClassMIPS32 : uint8_t { RCMIPS32_NUM = RC_Target }; | 124 enum RegClassMIPS32 : uint8_t { RCMIPS32_NUM = RC_Target }; |
122 | 125 |
123 } // end of namespace MIPS32 | 126 } // end of namespace MIPS32 |
124 } // end of namespace Ice | 127 } // end of namespace Ice |
125 | 128 |
126 #endif // SUBZERO_SRC_ICEREGISTERSMIPS32_H | 129 #endif // SUBZERO_SRC_ICEREGISTERSMIPS32_H |
OLD | NEW |