grammar updates
[mono.git] / mono / mini / mini-ops.h
1
2 MINI_OP(OP_LOAD,        "load")
3 MINI_OP(OP_LDADDR,      "ldaddr")
4 MINI_OP(OP_STORE,       "store")
5 MINI_OP(OP_OBJADDR,     "objaddr")
6 MINI_OP(OP_VTADDR,      "vtaddr")
7 MINI_OP(OP_PHI, "phi")
8 MINI_OP(OP_RENAME,      "rename")
9 MINI_OP(OP_COMPARE,     "compare")
10 MINI_OP(OP_COMPARE_IMM, "compare_imm")
11 MINI_OP(OP_FCOMPARE,    "fcompare")
12 MINI_OP(OP_LCOMPARE,    "lcompare")
13 MINI_OP(OP_LOCAL,       "local")
14 MINI_OP(OP_ARG, "arg")
15 MINI_OP(OP_ARGLIST,     "oparglist")
16 MINI_OP(OP_OUTARG,      "outarg")
17 MINI_OP(OP_OUTARG_IMM,  "outarg_imm")
18 MINI_OP(OP_OUTARG_R4,   "outarg_r4")
19 MINI_OP(OP_OUTARG_R8,   "outarg_r8")
20 MINI_OP(OP_OUTARG_VT,   "outarg_vt")
21 MINI_OP(OP_RETARG,      "retarg")
22 MINI_OP(OP_SETRET,      "setret")
23 MINI_OP(OP_SETLRET,     "setlret")
24 MINI_OP(OP_SETREG,      "setreg")
25 MINI_OP(OP_SETREGIMM,   "setregimm")
26 MINI_OP(OP_SETFREG,     "setfreg")
27 MINI_OP(OP_CHECK_THIS,  "checkthis")
28 MINI_OP(OP_VOIDCALL,    "voidcall")
29 MINI_OP(OP_VOIDCALLVIRT,        "voidcallvirt")
30 MINI_OP(OP_VOIDCALL_REG,        "voidcall_reg")
31 MINI_OP(OP_VOIDCALL_MEMBASE,    "voidcall_membase")
32 MINI_OP(OP_FCALL,       "fcall")
33 MINI_OP(OP_FCALLVIRT,   "fcallvirt")
34 MINI_OP(OP_FCALL_REG,   "fcall_reg")
35 MINI_OP(OP_FCALL_MEMBASE,       "fcall_membase")
36 MINI_OP(OP_LCALL,       "lcall")
37 MINI_OP(OP_LCALLVIRT,   "lcallvirt")
38 MINI_OP(OP_LCALL_REG,   "lcall_reg")
39 MINI_OP(OP_LCALL_MEMBASE,       "lcall_membase")
40 MINI_OP(OP_VCALL,       "vcall")
41 MINI_OP(OP_VCALLVIRT,   "vcallvirt")
42 MINI_OP(OP_VCALL_REG,   "vcall_reg")
43 MINI_OP(OP_VCALL_MEMBASE,       "vcall_membase")
44 MINI_OP(OP_CALL_REG,    "call_reg")
45 MINI_OP(OP_CALL_MEMBASE,        "call_membase")
46 MINI_OP(OP_TRAP,        "trap")
47 MINI_OP(OP_ICONST,      "iconst")
48 MINI_OP(OP_I8CONST,     "i8const")
49 MINI_OP(OP_R4CONST,     "r4const")
50 MINI_OP(OP_R8CONST,     "r8const")
51 MINI_OP(OP_REGVAR,      "regvar")
52 MINI_OP(OP_REG,         "reg")
53 MINI_OP(OP_REGOFFSET,   "regoffset")
54 MINI_OP(OP_LABEL,       "label")
55 MINI_OP(OP_CHECK_ARRAY_TYPE,    "check_array_type")
56 MINI_OP(OP_ARRAY_RANK,  "array_rank")
57 MINI_OP(OP_THROW_OR_NULL,       "throw_or_null")
58
59 MINI_OP(OP_STORE_MEMBASE_IMM,"store_membase_imm")
60 MINI_OP(OP_STORE_MEMBASE_REG,"store_membase_reg")
61 MINI_OP(OP_STOREI1_MEMBASE_IMM, "storei1_membase_imm")
62 MINI_OP(OP_STOREI1_MEMBASE_REG, "storei1_membase_reg")
63 MINI_OP(OP_STOREI2_MEMBASE_IMM, "storei2_membase_imm")
64 MINI_OP(OP_STOREI2_MEMBASE_REG, "storei2_membase_reg")
65 MINI_OP(OP_STOREI4_MEMBASE_IMM, "storei4_membase_imm")
66 MINI_OP(OP_STOREI4_MEMBASE_REG, "storei4_membase_reg")
67 MINI_OP(OP_STOREI8_MEMBASE_IMM, "storei8_membase_imm")
68 MINI_OP(OP_STOREI8_MEMBASE_REG, "storei8_membase_reg")
69 MINI_OP(OP_STORER4_MEMBASE_REG, "storer4_membase_reg")
70 MINI_OP(OP_STORER8_MEMBASE_REG, "storer8_membase_reg")
71 MINI_OP(OP_LOAD_MEMBASE,        "load_membase")
72 MINI_OP(OP_LOADI1_MEMBASE,"loadi1_membase")
73 MINI_OP(OP_LOADU1_MEMBASE,"loadu1_membase")
74 MINI_OP(OP_LOADI2_MEMBASE,"loadi2_membase")
75 MINI_OP(OP_LOADU2_MEMBASE,"loadu2_membase")
76 MINI_OP(OP_LOADI4_MEMBASE,"loadi4_membase")
77 MINI_OP(OP_LOADU4_MEMBASE,"loadu4_membase")
78 MINI_OP(OP_LOADI8_MEMBASE,"loadi8_membase")
79 MINI_OP(OP_LOADR4_MEMBASE,"loadr4_membase")
80 MINI_OP(OP_LOADR8_MEMBASE,"loadr8_membase")
81 MINI_OP(OP_LOADU4_MEM,"loadu4_mem")
82 MINI_OP(OP_MOVE,        "move")
83
84 MINI_OP(OP_ADD_IMM,    "add_imm")
85 MINI_OP(OP_SUB_IMM,    "sub_imm")
86 MINI_OP(OP_MUL_IMM,    "mul_imm")
87 MINI_OP(OP_DIV_IMM,    "div_imm")
88 MINI_OP(OP_DIV_UN_IMM, "div_un_imm")
89 MINI_OP(OP_REM_IMM,    "rem_imm")
90 MINI_OP(OP_REM_UN_IMM, "rem_un_imm")
91 MINI_OP(OP_AND_IMM,    "and_imm")
92 MINI_OP(OP_OR_IMM,     "or_imm")
93 MINI_OP(OP_XOR_IMM,    "xor_imm")
94 MINI_OP(OP_SHL_IMM,    "shl_imm")
95 MINI_OP(OP_SHR_IMM,    "shr_imm")
96 MINI_OP(OP_SHR_UN_IMM, "shr_un_imm")
97
98 /* exceptions: must be in the same order as the matching CEE_ branch opcodes */
99 MINI_OP(OP_COND_EXC_EQ, "cond_exc_eq")
100 MINI_OP(OP_COND_EXC_GE, "cond_exc_ge")
101 MINI_OP(OP_COND_EXC_GT, "cond_exc_gt")
102 MINI_OP(OP_COND_EXC_LE, "cond_exc_le")
103 MINI_OP(OP_COND_EXC_LT, "cond_exc_lt")
104 MINI_OP(OP_COND_EXC_NE_UN, "cond_exc_ne_un")
105 MINI_OP(OP_COND_EXC_GE_UN, "cond_exc_ge_un")
106 MINI_OP(OP_COND_EXC_GT_UN, "cond_exc_gt_un")
107 MINI_OP(OP_COND_EXC_LE_UN, "cond_exc_le_un")
108 MINI_OP(OP_COND_EXC_LT_UN, "cond_exc_lt_un")
109
110 MINI_OP(OP_COND_EXC_OV, "cond_exc_ov")
111 MINI_OP(OP_COND_EXC_NO, "cond_exc_no")
112 MINI_OP(OP_COND_EXC_C, "cond_exc_c")
113 MINI_OP(OP_COND_EXC_NC, "cond_exc_nc")
114
115 /* 64 bit opcodes: must be in the same order as the matching CEE_ opcodes: binops_op_map */
116 MINI_OP(OP_LADD,    "long_add")
117 MINI_OP(OP_LSUB,    "long_sub")
118 MINI_OP(OP_LMUL,    "long_mul")
119 MINI_OP(OP_LDIV,    "long_div")
120 MINI_OP(OP_LDIV_UN, "long_div_un")
121 MINI_OP(OP_LREM,    "long_rem")
122 MINI_OP(OP_LREM_UN, "long_rem_un")
123 MINI_OP(OP_LAND,    "long_and")
124 MINI_OP(OP_LOR,     "long_or")
125 MINI_OP(OP_LXOR,    "long_xor")
126 MINI_OP(OP_LSHL,    "long_shl")
127 MINI_OP(OP_LSHR,    "long_shr")
128 MINI_OP(OP_LSHR_UN, "long_shr_un")
129
130 /* 64 bit opcodes: must be in the same order as the matching CEE_ opcodes: unops_op_map */
131 MINI_OP(OP_LNEG,       "long_neg")
132 MINI_OP(OP_LNOT,       "long_not")
133 MINI_OP(OP_LCONV_TO_I1,"long_conv_to_i1")
134 MINI_OP(OP_LCONV_TO_I2,"long_conv_to_i2")
135 MINI_OP(OP_LCONV_TO_I4,"long_conv_to_i4")
136 MINI_OP(OP_LCONV_TO_I8,"long_conv_to_i8")
137 MINI_OP(OP_LCONV_TO_R4,"long_conv_to_r4")
138 MINI_OP(OP_LCONV_TO_R8,"long_conv_to_r8")
139 MINI_OP(OP_LCONV_TO_U4,"long_conv_to_u4")
140 MINI_OP(OP_LCONV_TO_U8,"long_conv_to_u8")
141
142 MINI_OP(OP_LCONV_TO_U2,   "long_conv_to_u2")
143 MINI_OP(OP_LCONV_TO_U1,   "long_conv_to_u1")
144 MINI_OP(OP_LCONV_TO_I,    "long_conv_to_i")
145 MINI_OP(OP_LCONV_TO_OVF_I,"long_conv_to_ovf_i")
146 MINI_OP(OP_LCONV_TO_OVF_U,"long_conv_to_ovf_u")
147 MINI_OP(OP_LADD_OVF,      "long_add_ovf")
148 MINI_OP(OP_LADD_OVF_UN,   "long_add_ovf_un")
149 MINI_OP(OP_LMUL_OVF,      "long_mul_ovf")
150 MINI_OP(OP_LMUL_OVF_UN,   "long_mul_ovf_un")
151 MINI_OP(OP_LSUB_OVF,      "long_sub_ovf")
152 MINI_OP(OP_LSUB_OVF_UN,   "long_sub_ovf_un")
153
154 MINI_OP(OP_LCONV_TO_OVF_I1_UN,"long_conv_to_ovf_i1_un")
155 MINI_OP(OP_LCONV_TO_OVF_I2_UN,"long_conv_to_ovf_i2_un")
156 MINI_OP(OP_LCONV_TO_OVF_I4_UN,"long_conv_to_ovf_i4_un")
157 MINI_OP(OP_LCONV_TO_OVF_I8_UN,"long_conv_to_ovf_i8_un")
158 MINI_OP(OP_LCONV_TO_OVF_U1_UN,"long_conv_to_ovf_u1_un")
159 MINI_OP(OP_LCONV_TO_OVF_U2_UN,"long_conv_to_ovf_u2_un")
160 MINI_OP(OP_LCONV_TO_OVF_U4_UN,"long_conv_to_ovf_u4_un")
161 MINI_OP(OP_LCONV_TO_OVF_U8_UN,"long_conv_to_ovf_u8_un")
162 MINI_OP(OP_LCONV_TO_OVF_I_UN, "long_conv_to_ovf_i_un")
163 MINI_OP(OP_LCONV_TO_OVF_U_UN, "long_conv_to_ovf_u_un")
164
165 MINI_OP(OP_LCONV_TO_OVF_I1,"long_conv_to_ovf_i1")
166 MINI_OP(OP_LCONV_TO_OVF_U1,"long_conv_to_ovf_u1")
167 MINI_OP(OP_LCONV_TO_OVF_I2,"long_conv_to_ovf_i2")
168 MINI_OP(OP_LCONV_TO_OVF_U2,"long_conv_to_ovf_u2")
169 MINI_OP(OP_LCONV_TO_OVF_I4,"long_conv_to_ovf_i4")
170 MINI_OP(OP_LCONV_TO_OVF_U4,"long_conv_to_ovf_u4")
171 MINI_OP(OP_LCONV_TO_OVF_I8,"long_conv_to_ovf_i8")
172 MINI_OP(OP_LCONV_TO_OVF_U8,"long_conv_to_ovf_u8")
173
174 MINI_OP(OP_LCEQ,   "long_ceq")
175 MINI_OP(OP_LCGT,   "long_cgt")
176 MINI_OP(OP_LCGT_UN,"long_cgt_un")
177 MINI_OP(OP_LCLT,   "long_clt")
178 MINI_OP(OP_LCLT_UN,"long_clt_un")
179
180 MINI_OP(OP_LCONV_TO_R_UN,"long_conv_to_r_un")
181 MINI_OP(OP_LCONV_TO_U,   "long_conv_to_u")
182 MINI_OP(OP_LSHR_IMM,     "long_shr_imm")
183 MINI_OP(OP_LSHR_UN_IMM,  "long_shr_un_imm")
184 MINI_OP(OP_LSHL_IMM,     "long_shl_imm")
185 MINI_OP(OP_LADD_IMM,     "long_add_imm")
186 MINI_OP(OP_LSUB_IMM,     "long_sub_imm")
187
188 MINI_OP(OP_LBEQ,    "long_beq")
189 MINI_OP(OP_LBNE_UN, "long_bne_un")
190 MINI_OP(OP_LBLT,    "long_blt")
191 MINI_OP(OP_LBLT_UN, "long_blt_un")
192 MINI_OP(OP_LBGT,    "long_bgt")
193 MINI_OP(OP_LBGT_UN, "long_btg_un")
194 MINI_OP(OP_LBGE,    "long_bge")
195 MINI_OP(OP_LBGE_UN, "long_bge_un")
196 MINI_OP(OP_LBLE,    "long_ble")
197 MINI_OP(OP_LBLE_UN, "long_ble_un")
198
199 MINI_OP(OP_FBEQ,   "float_beq")
200 MINI_OP(OP_FBNE_UN,"float_bne_un")
201 MINI_OP(OP_FBLT,   "float_blt")
202 MINI_OP(OP_FBLT_UN,"float_blt_un")
203 MINI_OP(OP_FBGT,   "float_bgt")
204 MINI_OP(OP_FBGT_UN,"float_btg_un")
205 MINI_OP(OP_FBGE,   "float_bge")
206 MINI_OP(OP_FBGE_UN,"float_bge_un")
207 MINI_OP(OP_FBLE,   "float_ble")
208 MINI_OP(OP_FBLE_UN,"float_ble_un")
209
210 /* float opcodes: must be in the same order as the matching CEE_ opcodes: binops_op_map */
211 MINI_OP(OP_FADD,   "float_add")
212 MINI_OP(OP_FSUB,   "float_sub")
213 MINI_OP(OP_FMUL,   "float_mul")
214 MINI_OP(OP_FDIV,   "float_div")
215 MINI_OP(OP_FDIV_UN,"float_div_un")
216 MINI_OP(OP_FREM,   "float_rem")
217 MINI_OP(OP_FREM_UN,"float_rem_un")
218
219 /* float opcodes: must be in the same order as the matching CEE_ opcodes: unops_op_map */
220 MINI_OP(OP_FNEG,       "float_neg")
221 MINI_OP(OP_FNOT,       "float_not")
222 MINI_OP(OP_FCONV_TO_I1,"float_conv_to_i1")
223 MINI_OP(OP_FCONV_TO_I2,"float_conv_to_i2")
224 MINI_OP(OP_FCONV_TO_I4,"float_conv_to_i4")
225 MINI_OP(OP_FCONV_TO_I8,"float_conv_to_i8")
226 MINI_OP(OP_FCONV_TO_R4,"float_conv_to_r4")
227 MINI_OP(OP_FCONV_TO_R8,"float_conv_to_r8")
228 MINI_OP(OP_FCONV_TO_U4,"float_conv_to_u4")
229 MINI_OP(OP_FCONV_TO_U8,"float_conv_to_u8")
230
231 MINI_OP(OP_FCONV_TO_U2,   "float_conv_to_u2")
232 MINI_OP(OP_FCONV_TO_U1,   "float_conv_to_u1")
233 MINI_OP(OP_FCONV_TO_I,    "float_conv_to_i")
234 MINI_OP(OP_FCONV_TO_OVF_I,"float_conv_to_ovf_i")
235 MINI_OP(OP_FCONV_TO_OVF_U,"float_conv_to_ovd_u")
236 MINI_OP(OP_FADD_OVF,      "float_add_ovf")
237 MINI_OP(OP_FADD_OVF_UN,   "float_add_ovf_un")
238 MINI_OP(OP_FMUL_OVF,      "float_mul_ovf")
239 MINI_OP(OP_FMUL_OVF_UN,   "float_mul_ovf_un")
240 MINI_OP(OP_FSUB_OVF,      "float_sub_ovf")
241 MINI_OP(OP_FSUB_OVF_UN,   "float_sub_ovf_un")
242
243 MINI_OP(OP_FCONV_TO_OVF_I1_UN,"float_conv_to_ovf_i1_un")
244 MINI_OP(OP_FCONV_TO_OVF_I2_UN,"float_conv_to_ovf_i2_un")
245 MINI_OP(OP_FCONV_TO_OVF_I4_UN,"float_conv_to_ovf_i4_un")
246 MINI_OP(OP_FCONV_TO_OVF_I8_UN,"float_conv_to_ovf_i8_un")
247 MINI_OP(OP_FCONV_TO_OVF_U1_UN,"float_conv_to_ovf_u1_un")
248 MINI_OP(OP_FCONV_TO_OVF_U2_UN,"float_conv_to_ovf_u2_un")
249 MINI_OP(OP_FCONV_TO_OVF_U4_UN,"float_conv_to_ovf_u4_un")
250 MINI_OP(OP_FCONV_TO_OVF_U8_UN,"float_conv_to_ovf_u8_un")
251 MINI_OP(OP_FCONV_TO_OVF_I_UN, "float_conv_to_ovf_i_un")
252 MINI_OP(OP_FCONV_TO_OVF_U_UN, "float_conv_to_ovf_u_un")
253
254 MINI_OP(OP_FCONV_TO_OVF_I1,"float_conv_to_ovf_i1")
255 MINI_OP(OP_FCONV_TO_OVF_U1,"float_conv_to_ovf_u1")
256 MINI_OP(OP_FCONV_TO_OVF_I2,"float_conv_to_ovf_i2")
257 MINI_OP(OP_FCONV_TO_OVF_U2,"float_conv_to_ovf_u2")
258 MINI_OP(OP_FCONV_TO_OVF_I4,"float_conv_to_ovf_i4")
259 MINI_OP(OP_FCONV_TO_OVF_U4,"float_conv_to_ovf_u4")
260 MINI_OP(OP_FCONV_TO_OVF_I8,"float_conv_to_ovf_i8")
261 MINI_OP(OP_FCONV_TO_OVF_U8,"float_conv_to_ovf_u8")
262
263 MINI_OP(OP_FCEQ,   "float_ceq")
264 MINI_OP(OP_FCGT,   "float_cgt")
265 MINI_OP(OP_FCGT_UN,"float_cgt_un")
266 MINI_OP(OP_FCLT,   "float_clt")
267 MINI_OP(OP_FCLT_UN,"float_clt_un")
268
269 MINI_OP(OP_FCONV_TO_U,  "float_conv_to_u")
270
271 MINI_OP(OP_GROUP, "group")
272
273 /* aot compiler */
274 MINI_OP(OP_AOTCONST, "aot_const")
275
276 /* used to impl unbox */
277 MINI_OP(OP_UNBOXCAST  , "unboxcast")
278
279 /* exception related opcodes */
280 MINI_OP(OP_CALL_HANDLER  , "call_handler")
281 MINI_OP(OP_START_HANDLER  , "start_handler")
282 MINI_OP(OP_ENDFILTER,  "op_endfilter")
283
284 /* inline (long)int * (long)int */
285 MINI_OP(OP_BIGMUL, "op_bigmul")
286 MINI_OP(OP_BIGMUL_UN, "op_bigmul_un")
287
288 /* opcodes most architecture have */
289 MINI_OP(OP_ADC,     "adc")
290 MINI_OP(OP_ADC_IMM, "adc_imm")
291 MINI_OP(OP_SBB,     "sbb")
292 MINI_OP(OP_SBB_IMM, "sbb_imm")
293 MINI_OP(OP_ADDCC,   "addcc")
294 MINI_OP(OP_SUBCC,   "subcc")
295 MINI_OP(OP_BR_REG,  "br_reg")
296 MINI_OP(OP_SEXT_I1,  "sext_i1")
297 MINI_OP(OP_SEXT_I2,  "sext_i2")
298
299 /* FP functions usually done by the CPU */
300 MINI_OP(OP_SIN,     "sin")
301 MINI_OP(OP_COS,     "cos")
302 MINI_OP(OP_ABS,     "abs")
303 MINI_OP(OP_TAN,     "tan")
304 MINI_OP(OP_ATAN,    "atan")
305 MINI_OP(OP_SQRT,    "sqrt")
306 /* to optimize strings */
307 MINI_OP(OP_GETCHR, "getchar")
308 /* get adrress of element in a 2D array */
309 MINI_OP(OP_LDELEMA2D, "getldelema2")
310 /* inlined small memcpy with constant length */
311 MINI_OP(OP_MEMCPY, "memcpy")
312 /* inlined small memset with constant length */
313 MINI_OP(OP_MEMSET, "memset")
314
315 /* x86 specific */
316 MINI_OP(OP_X86_TEST_NULL,          "x86_test_null")
317 MINI_OP(OP_X86_COMPARE_MEMBASE_REG,"x86_compare_membase_reg")
318 MINI_OP(OP_X86_COMPARE_MEMBASE_IMM,"x86_compare_membase_imm")
319 MINI_OP(OP_X86_COMPARE_REG_MEMBASE,"x86_compare_reg_membase")
320 MINI_OP(OP_X86_INC_REG,            "x86_inc_reg")
321 MINI_OP(OP_X86_INC_MEMBASE,        "x86_inc_membase")
322 MINI_OP(OP_X86_DEC_REG,            "x86_dec_reg")
323 MINI_OP(OP_X86_DEC_MEMBASE,        "x86_dec_membase")
324 MINI_OP(OP_X86_ADD_MEMBASE_IMM,    "x86_add_membase_imm")
325 MINI_OP(OP_X86_SUB_MEMBASE_IMM,    "x86_sub_membase_imm")
326 MINI_OP(OP_X86_PUSH_MEMBASE,       "x86_push_membase")
327 MINI_OP(OP_X86_PUSH_IMM,           "x86_push_imm")
328 MINI_OP(OP_X86_PUSH,               "x86_push")
329 MINI_OP(OP_X86_PUSH_FP,            "x86_push_fp")
330 MINI_OP(OP_X86_PUSH_OBJ,           "x86_push_obj")
331 MINI_OP(OP_X86_LEA,                "x86_lea")
332 MINI_OP(OP_X86_LEA_MEMBASE,        "x86_lea_membase")
333 MINI_OP(OP_X86_XCHG,               "x86_xchg")
334 MINI_OP(OP_X86_FPOP,               "x86_fpop")
335 MINI_OP(OP_X86_FP_LOAD_I8,         "x86_fp_load_i8")
336 MINI_OP(OP_X86_FP_LOAD_I4,         "x86_fp_load_i4")
337 MINI_OP(OP_X86_SETEQ_MEMBASE,      "x86_seteq_membase")
338
339 MINI_OP(OP_PPC_SUBFIC,             "ppc_subfic")
340 MINI_OP(OP_PPC_SUBFZE,             "ppc_subfze")
341
342