OLD | NEW |
1 //===- subzero/src/IceRegistersX8632.h - Register information ---*- C++ -*-===// | 1 //===- subzero/src/IceRegistersX8632.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 // This file declares the registers and their encodings for x86-32. | 10 // This file declares the registers and their encodings for x86-32. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 78 } |
79 | 79 |
80 static inline ByteRegister getEncodedByteReg(int32_t RegNum) { | 80 static inline ByteRegister getEncodedByteReg(int32_t RegNum) { |
81 assert(RegNum == Reg_ah || (Reg_GPR_First <= RegNum && RegNum <= Reg_ebx)); | 81 assert(RegNum == Reg_ah || (Reg_GPR_First <= RegNum && RegNum <= Reg_ebx)); |
82 if (RegNum == Reg_ah) | 82 if (RegNum == Reg_ah) |
83 return Encoded_Reg_ah; | 83 return Encoded_Reg_ah; |
84 return ByteRegister(RegNum - Reg_GPR_First); | 84 return ByteRegister(RegNum - Reg_GPR_First); |
85 } | 85 } |
86 | 86 |
87 static inline GPRRegister getEncodedByteRegOrGPR(Type Ty, int32_t RegNum) { | 87 static inline GPRRegister getEncodedByteRegOrGPR(Type Ty, int32_t RegNum) { |
88 if (Ty == IceType_i8 || Ty == IceType_i1) | 88 if (isByteSizedType(Ty)) |
89 return GPRRegister(getEncodedByteReg(RegNum)); | 89 return GPRRegister(getEncodedByteReg(RegNum)); |
90 else | 90 else |
91 return getEncodedGPR(RegNum); | 91 return getEncodedGPR(RegNum); |
92 } | 92 } |
93 | 93 |
94 } // end of namespace RegX8632 | 94 } // end of namespace RegX8632 |
95 | 95 |
96 } // end of namespace Ice | 96 } // end of namespace Ice |
97 | 97 |
98 #endif // SUBZERO_SRC_ICEREGISTERSX8632_H | 98 #endif // SUBZERO_SRC_ICEREGISTERSX8632_H |
OLD | NEW |