Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceRegistersARM32.h - Register information ---*- C++ -*-===// | 1 //===- subzero/src/IceRegistersMIPS32.h - Register information ---*- C++ -*-===/ / |
|
Jim Stichnoth
2015/05/30 00:47:14
remove a '-' to maintain 80-col
| |
| 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 ARM32. | 10 // This file declares the registers and their encodings for MIPS32. |
| 11 // | 11 // |
| 12 //===----------------------------------------------------------------------===// | 12 //===----------------------------------------------------------------------===// |
| 13 | 13 |
| 14 #ifndef SUBZERO_SRC_ICEREGISTERSARM32_H | 14 #ifndef SUBZERO_SRC_ICEREGISTERSMIPS32_H |
| 15 #define SUBZERO_SRC_ICEREGISTERSARM32_H | 15 #define SUBZERO_SRC_ICEREGISTERSMIPS32_H |
| 16 | 16 |
| 17 #include "IceDefs.h" | 17 #include "IceDefs.h" |
| 18 #include "IceInstARM32.def" | 18 #include "IceInstMIPS32.def" |
| 19 #include "IceTypes.h" | 19 #include "IceTypes.h" |
| 20 | 20 |
| 21 namespace Ice { | 21 namespace Ice { |
| 22 | 22 |
| 23 namespace RegARM32 { | 23 namespace RegMIPS32 { |
| 24 | 24 |
| 25 // An enum of every register. The enum value may not match the encoding | 25 // An enum of every register. The enum value may not match the encoding |
| 26 // used to binary encode register operands in instructions. | 26 // used to binary encode register operands in instructions. |
| 27 enum AllRegisters { | 27 enum AllRegisters { |
| 28 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ | 28 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ |
| 29 isFP) \ | 29 isFP) \ |
| 30 val, | 30 val, |
| 31 REGARM32_TABLE | 31 REGMIPS32_TABLE |
| 32 #undef X | 32 #undef X |
| 33 Reg_NUM, | 33 Reg_NUM, |
| 34 #define X(val, init) val init, | 34 #define X(val, init) val init, |
| 35 REGARM32_TABLE_BOUNDS | 35 REGMIPS32_TABLE_BOUNDS |
| 36 #undef X | 36 #undef X |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // An enum of GPR Registers. The enum value does match the encoding used | 39 // An enum of GPR Registers. The enum value does match the encoding used |
| 40 // to binary encode register operands in instructions. | 40 // to binary encode register operands in instructions. |
| 41 enum GPRRegister { | 41 enum GPRRegister { |
| 42 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ | 42 #define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ |
| 43 isFP) \ | 43 isFP) \ |
| 44 Encoded_##val encode, | 44 Encoded_##val encode, |
| 45 REGARM32_GPR_TABLE | 45 REGMIPS32_GPR_TABLE |
| 46 #undef X | 46 #undef X |
| 47 Encoded_Not_GPR = -1 | 47 Encoded_Not_GPR = -1 |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // TODO(jvoung): Floating point and vector registers... | 50 // TODO(jvoung): Floating point and vector registers... |
| 51 // Need to model overlap and difference in encoding too. | 51 // Need to model overlap and difference in encoding too. |
| 52 | 52 |
| 53 static inline GPRRegister getEncodedGPR(int32_t RegNum) { | 53 static inline GPRRegister getEncodedGPR(int32_t RegNum) { |
| 54 assert(Reg_GPR_First <= RegNum && RegNum <= Reg_GPR_Last); | 54 assert(Reg_GPR_First <= RegNum && RegNum <= Reg_GPR_Last); |
| 55 return GPRRegister(RegNum - Reg_GPR_First); | 55 return GPRRegister(RegNum - Reg_GPR_First); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // end of namespace RegARM32 | 58 } // end of namespace RegMIPS32 |
| 59 | 59 |
| 60 } // end of namespace Ice | 60 } // end of namespace Ice |
| 61 | 61 |
| 62 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H | 62 #endif // SUBZERO_SRC_ICEREGISTERSMIPS32_H |
| OLD | NEW |