OLD | NEW |
---|---|
1 //===- subzero/src/IceInstMIPS32.def - X-Macros for MIPS32 insts --*- C++ -*-=== // | 1 //===- subzero/src/IceInstMIPS32.def - X-Macros for MIPS32 insts --*- 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 defines properties of MIPS32 instructions in the form of x-macros. | 10 // This file defines properties of MIPS32 instructions in the form of x-macros. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 X(Reg_GP, 28, "gp", 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | 98 X(Reg_GP, 28, "gp", 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
99 ALIASES1(Reg_GP)) \ | 99 ALIASES1(Reg_GP)) \ |
100 X(Reg_SP, 29, "sp", 0, 0, 1, 0, 0, 0, 0, 0, 0, \ | 100 X(Reg_SP, 29, "sp", 0, 0, 1, 0, 0, 0, 0, 0, 0, \ |
101 ALIASES1(Reg_SP)) \ | 101 ALIASES1(Reg_SP)) \ |
102 X(Reg_FP, 30, "fp", 0, 0, 0, 1, 0, 0, 0, 0, 0, \ | 102 X(Reg_FP, 30, "fp", 0, 0, 0, 1, 0, 0, 0, 0, 0, \ |
103 ALIASES1(Reg_FP)) \ | 103 ALIASES1(Reg_FP)) \ |
104 X(Reg_RA, 31, "ra", 0, 1, 0, 0, 0, 0, 0, 0, 0, \ | 104 X(Reg_RA, 31, "ra", 0, 1, 0, 0, 0, 0, 0, 0, 0, \ |
105 ALIASES1(Reg_RA)) \ | 105 ALIASES1(Reg_RA)) \ |
106 X(Reg_LO, 0, "lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | 106 X(Reg_LO, 0, "lo", 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
107 ALIASES2(Reg_LO, Reg_LOHI)) \ | 107 ALIASES2(Reg_LO, Reg_LOHI)) \ |
108 X(Reg_HI, 0, "hi", 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | 108 X(Reg_HI, 0, "hi", 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
109 ALIASES2(Reg_HI, Reg_LOHI)) | 109 ALIASES2(Reg_HI, Reg_LOHI)) |
110 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, | 110 |
111 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) | 111 #define REGMIPS32_FPR_TABLE \ |
112 // TODO(reed kotler): List FP registers etc. | 112 /* val, encode, name, scratch, preserved, stackptr, frameptr, \ |
113 // Be able to grab even registers, and the corresponding odd register | 113 isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init */ \ |
114 // for each even register. | 114 X(Reg_F0, 0, "f0", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F0)) \ |
Jim Stichnoth
2016/05/19 23:12:25
This is just a suggestion:
With so many columns,
obucinac
2016/05/27 11:13:18
Acknowledged.
| |
115 X(Reg_F1, 1, "f1", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F1)) \ | |
116 X(Reg_F2, 2, "f2", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F2)) \ | |
117 X(Reg_F3, 3, "f3", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F3)) \ | |
118 X(Reg_F4, 4, "f4", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F4)) \ | |
119 X(Reg_F5, 5, "f5", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F5)) \ | |
120 X(Reg_F6, 6, "f6", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F6)) \ | |
121 X(Reg_F7, 7, "f7", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F7)) \ | |
122 X(Reg_F8, 8, "f8", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F8)) \ | |
123 X(Reg_F9, 9, "f9", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F9)) \ | |
124 X(Reg_F10, 10, "f10", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F10)) \ | |
125 X(Reg_F11, 11, "f11", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F11)) \ | |
126 X(Reg_F12, 12, "f12", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F12)) \ | |
127 X(Reg_F13, 13, "f13", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F13)) \ | |
128 X(Reg_F14, 14, "f14", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F14)) \ | |
129 X(Reg_F15, 15, "f15", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F15)) \ | |
130 X(Reg_F16, 16, "f16", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F16)) \ | |
131 X(Reg_F17, 17, "f17", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F17)) \ | |
132 X(Reg_F18, 18, "f18", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F18)) \ | |
133 X(Reg_F19, 19, "f19", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F19)) \ | |
134 X(Reg_F20, 20, "f20", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F20)) \ | |
135 X(Reg_F21, 21, "f21", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F21)) \ | |
136 X(Reg_F22, 22, "f22", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F22)) \ | |
137 X(Reg_F23, 22, "f23", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F23)) \ | |
Jim Stichnoth
2016/05/19 23:12:25
Numbering got off here. The 22 should be 23, and
obucinac
2016/05/27 11:13:18
Done.
| |
138 X(Reg_F24, 23, "f24", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F24)) \ | |
139 X(Reg_F25, 24, "f25", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F25)) \ | |
140 X(Reg_F26, 25, "f26", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F26)) \ | |
141 X(Reg_F27, 26, "f27", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F27)) \ | |
142 X(Reg_F28, 27, "f28", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F28)) \ | |
143 X(Reg_F29, 28, "f29", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F29)) \ | |
144 X(Reg_F30, 29, "f30", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F30)) \ | |
145 X(Reg_F31, 30, "f31", 1, 0, 0, 0, 0, 0, 1, 0, 0, ALIASES1(Reg_F31)) | |
146 | |
115 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, | 147 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, |
116 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) | 148 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) |
117 // The following defines a table with the available pairs of consecutive i32 | 149 // The following defines a table with the available pairs of consecutive i32 |
118 // GPRs starting at an even GPR that is not r14. Those are used to hold i64 | 150 // GPRs starting at an even GPR that is not r14. Those are used to hold i64 |
119 // variables for atomic memory operations. If one of the registers in the pair | 151 // variables for atomic memory operations. If one of the registers in the pair |
120 // is preserved, then we mark the whole pair as preserved to help the register | 152 // is preserved, then we mark the whole pair as preserved to help the register |
121 // allocator. | 153 // allocator. |
122 #define REGMIPS32_I64PAIR_TABLE \ | 154 #define REGMIPS32_I64PAIR_TABLE \ |
123 /* val, encode, name, scratch, preserved, stackptr, frameptr, \ | 155 /* val, encode, name, scratch, preserved, stackptr, frameptr, \ |
124 isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init */ \ | 156 isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init */ \ |
(...skipping 27 matching lines...) Expand all Loading... | |
152 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) | 184 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) |
153 | 185 |
154 // We also provide a combined table, so that there is a namespace where | 186 // We also provide a combined table, so that there is a namespace where |
155 // all of the registers are considered and have distinct numberings. | 187 // all of the registers are considered and have distinct numberings. |
156 // This is in contrast to the above, where the "encode" is based on how | 188 // This is in contrast to the above, where the "encode" is based on how |
157 // the register numbers will be encoded in binaries and values can overlap. | 189 // the register numbers will be encoded in binaries and values can overlap. |
158 #define REGMIPS32_TABLE \ | 190 #define REGMIPS32_TABLE \ |
159 /* val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ | 191 /* val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \ |
160 isFP32, isFP64, isVec128, alias_init */ \ | 192 isFP32, isFP64, isVec128, alias_init */ \ |
161 REGMIPS32_GPR_TABLE \ | 193 REGMIPS32_GPR_TABLE \ |
194 REGMIPS32_FPR_TABLE \ | |
162 REGMIPS32_I64PAIR_TABLE | 195 REGMIPS32_I64PAIR_TABLE |
163 | 196 |
164 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, | 197 //#define X(val, encode, name, scratch, preserved, stackptr, frameptr, |
165 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) | 198 // isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) |
166 #define REGMIPS32_TABLE_BOUNDS \ | 199 #define REGMIPS32_TABLE_BOUNDS \ |
167 /* val, init */ \ | 200 /* val, init */ \ |
168 X(Reg_GPR_First, = Reg_ZERO) \ | 201 X(Reg_GPR_First, = Reg_ZERO) \ |
169 X(Reg_GPR_Last, = Reg_HI) \ | 202 X(Reg_GPR_Last, = Reg_HI) \ |
203 X(Reg_FPR_First, = Reg_F0) \ | |
204 X(Reg_FPR_Last, = Reg_F31) \ | |
170 X(Reg_I64PAIR_First, = Reg_V0V1) \ | 205 X(Reg_I64PAIR_First, = Reg_V0V1) \ |
171 X(Reg_I64PAIR_Last, = Reg_LOHI) \ | 206 X(Reg_I64PAIR_Last, = Reg_LOHI) \ |
172 //define X(val, init) | 207 //define X(val, init) |
173 | 208 |
174 // TODO(reed kotler): add condition code tables, etc. | 209 // TODO(reed kotler): add condition code tables, etc. |
175 | 210 |
176 | 211 |
177 #endif // SUBZERO_SRC_ICEINSTMIPS32_DEF | 212 #endif // SUBZERO_SRC_ICEINSTMIPS32_DEF |
OLD | NEW |