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