Please test before you commit
[mono.git] / mono / mini / cpu-s390.md
1 # S/390 cpu description file
2 # this file is read by genmdesc to pruduce a table with all the relevant information
3 # about the cpu instructions that may be used by the regsiter allocator, the scheduler
4 # and other parts of the arch-dependent part of mini.
5 #
6 # An opcode name is followed by a colon and optional specifiers.
7 # A specifier has a name, a colon and a value. Specifiers are separated by white space.
8 # Here is a description of the specifiers valid for this file and their possible values.
9 #
10 # dest:register       describes the destination register of an instruction
11 # src1:register       describes the first source register of an instruction
12 # src2:register       describes the second source register of an instruction
13 #
14 # register may have the following values:
15 #       i  integer register
16 #       a  r3 register (output from calls)
17 #       b  base register (used in address references)
18 #       f  floating point register
19 #
20 # len:number         describe the maximun length in bytes of the instruction
21 # number is a positive integer
22 #
23 # cost:number        describe how many cycles are needed to complete the instruction (unused)
24 #
25 # clob:spec          describe if the instruction clobbers registers or has special needs
26 #
27 # spec can be one of the following characters:
28 #       c  clobbers caller-save registers
29 #       r  'reserves' the destination register until a later instruction unreserves it
30 #          used mostly to set output registers in function calls
31 #
32 # flags:spec        describe if the instruction uses or sets the flags (unused)
33 #
34 # spec can be one of the following chars:
35 #       s  sets the flags
36 #       u  uses the flags
37 #       m  uses and modifies the flags
38 #
39 # res:spec          describe what units are used in the processor (unused)
40 #
41 # delay:            describe delay slots (unused)
42 #
43 # the required specifiers are: len, clob (if registers are clobbered), the registers
44 # specifiers if the registers are actually used, flags (when scheduling is implemented).
45 #
46 # See the code in mini-x86.c for more details on how the specifiers are used.
47 #
48 nop: len:4
49 break: len:4
50 ldarg.0:
51 ldarg.1:
52 ldarg.2:
53 ldarg.3:
54 ldloc.0:
55 ldloc.1:
56 ldloc.2:
57 ldloc.3:
58 stloc.0:
59 stloc.1:
60 stloc.2:
61 stloc.3:
62 ldarg.s:
63 ldarga.s:
64 starg.s:
65 ldloc.s:
66 ldloca.s:
67 stloc.s:
68 ldnull:
69 ldc.i4.m1:
70 ldc.i4.0:
71 ldc.i4.1:
72 ldc.i4.2:
73 ldc.i4.3:
74 ldc.i4.4:
75 ldc.i4.5:
76 ldc.i4.6:
77 ldc.i4.7:
78 ldc.i4.8:
79 ldc.i4.s:
80 ldc.i4:
81 ldc.i8:
82 ldc.r4:
83 ldc.r8:
84 dup:
85 pop:
86 jmp:
87 call: dest:a clob:c len:6
88 calli:
89 ret:
90 br.s:
91 brfalse.s:
92 brtrue.s:
93 beq.s:
94 bge.s:
95 bgt.s:
96 ble.s:
97 blt.s:
98 bne.un.s:
99 bge.un.s:
100 bgt.un.s:
101 ble.un.s:
102 blt.un.s:
103 br: len:6
104 brfalse:
105 brtrue:
106 beq: len:8
107 bge: len:8
108 bgt: len:8
109 ble: len:8
110 blt: len:8
111 bne.un: len:8
112 bge.un: len:8
113 bgt.un: len:8
114 ble.un: len:8
115 blt.un: len:8
116 switch:
117 ldind.i1: dest:i len:8
118 ldind.u1: dest:i len:8
119 ldind.i2: dest:i len:8
120 ldind.u2: dest:i len:8
121 ldind.i4: dest:i len:8
122 ldind.u4: dest:i len:8
123 ldind.i8:
124 ldind.i: dest:i len:8
125 ldind.r4:
126 ldind.r8:
127 ldind.ref: dest:i len:8
128 stind.ref: src1:b src2:i
129 stind.i1: src1:b src2:i
130 stind.i2: src1:b src2:i
131 stind.i4: src1:b src2:i
132 stind.i8:
133 stind.r4: src1:b src2:f
134 stind.r8: src1:b src2:f
135
136 add: dest:i src1:i src2:i len:4 clob:1
137 sub: dest:i src1:i src2:i len:4 clob:1
138 mul: dest:i src1:i src2:i len:4 clob:1
139 div: dest:a src1:i src2:i len:10 clob:d
140 div.un: dest:a src1:i src2:i len:12 clob:d
141 rem: dest:d src1:i src2:i len:10 clob:d
142 rem.un: dest:d src1:i src2:i len:12 clob:d
143 and: dest:i src1:i src2:i len:6 clob:1
144 or: dest:i src1:i src2:i len:4 clob:1
145 xor: dest:i src1:i src2:i len:4 clob:1
146 shl: dest:i src1:i src2:i clob:s len:6
147 shr: dest:i src1:i src2:i clob:s len:6
148 shr.un: dest:i src1:i src2:i clob:s len:6
149 neg: dest:i src1:i len:4 clob:1
150 not: dest:i src1:i len:8 clob:1
151 conv.i1: dest:i src1:i len:22
152 conv.i2: dest:i src1:i len:22
153 conv.i4: dest:i src1:i len:2
154 conv.i8:
155 conv.r4: dest:f src1:i len:4
156 conv.r8: dest:f src1:i len:4
157 conv.u4: dest:i src1:i
158 conv.u8:
159 callvirt:
160 cpobj:
161 ldobj:
162 ldstr:
163 newobj:
164 castclass:
165 isinst:
166 conv.r.un: dest:f src1:i len:30
167 unbox:
168 throw: src1:i len:8
169 ldfld:
170 ldflda:
171 stfld:
172 ldsfld:
173 ldsflda:
174 stsfld:
175 stobj:
176 conv.ovf.i1.un:
177 conv.ovf.i2.un:
178 conv.ovf.i4.un:
179 conv.ovf.i8.un:
180 conv.ovf.u1.un:
181 conv.ovf.u2.un:
182 conv.ovf.u4.un:
183 conv.ovf.u8.un:
184 conv.ovf.i.un:
185 conv.ovf.u.un:
186 box:
187 newarr:
188 ldlen:
189 ldelema:
190 ldelem.i1:
191 ldelem.u1:
192 ldelem.i2:
193 ldelem.u2:
194 ldelem.i4:
195 ldelem.u4:
196 ldelem.i8:
197 ldelem.i:
198 ldelem.r4:
199 ldelem.r8:
200 ldelem.ref:
201 stelem.i:
202 stelem.i1:
203 stelem.i2:
204 stelem.i4:
205 stelem.i8:
206 stelem.r4:
207 stelem.r8:
208 stelem.ref:
209 conv.ovf.i1:
210 conv.ovf.u1:
211 conv.ovf.i2:
212 conv.ovf.u2:
213 conv.ovf.i4:
214 conv.ovf.u4:
215 conv.ovf.i8:
216 conv.ovf.u8:
217 refanyval:
218 ckfinite: dest:f src1:f len:22
219 mkrefany:
220 ldtoken:
221 conv.u2: dest:i src1:i len:14
222 conv.u1: dest:i src1:i len:8
223 conv.i: dest:i src1:i len:2
224 conv.ovf.i:
225 conv.ovf.u:
226 add.ovf:
227 add.ovf.un:
228 mul.ovf: dest:i src1:i src2:i len:18 clob:1
229 # this opcode is handled specially in the code generator
230 mul.ovf.un: dest:i src1:i src2:i len:20 clob:1
231 sub.ovf:
232 sub.ovf.un:
233 start_handler: len:8
234 endfinally: len:12
235 leave:
236 leave.s:
237 stind.i:
238 conv.u: dest:i src1:i len:4
239 prefix7:
240 prefix6:
241 prefix5:
242 prefix4:
243 prefix3:
244 prefix2:
245 prefix1:
246 prefixref:
247 arglist:
248 ceq: dest:i len:12
249 cgt: dest:i len:12
250 cgt.un: dest:i len:12
251 clt: dest:i len:12
252 clt.un: dest:i len:12
253 ldftn:
254 ldvirtftn:
255 ldarg:
256 ldarga:
257 starg:
258 ldloc:
259 ldloca:
260 stloc:
261 localloc: dest:i src1:i len:40
262 endfilter: len:12
263 unaligned.:
264 volatile.:
265 tail.:
266 initobj:
267 cpblk:
268 initblk:
269 rethrow:
270 sizeof:
271 refanytype:
272 illegal:
273 endmac:
274 mono_func1:
275 mono_proc2:
276 mono_proc3:
277 mono_free:
278 mono_objaddr:
279 mono_ldptr:
280 mono_vtaddr:
281 mono_newobj:
282 mono_retobj:
283 load:
284 ldaddr:
285 store:
286 phi:
287 rename:
288 compare: src1:i src2:i len:4
289 compare_imm: src1:i len:14
290 fcompare: src1:f src2:f len:14
291 lcompare:
292 local:
293 arg:
294 outarg: src1:i len:1
295 outarg_imm: len:5
296 retarg:
297 setret: dest:a src1:i len:4
298 setlret: src1:i src2:i len:12
299 setreg: dest:i src1:i len:4 clob:r
300 setregimm: dest:i len:16 clob:r
301 setfreg: dest:f src1:f len:4 clob:r
302 checkthis: src1:b len:4
303 voidcall: len:8 clob:c
304 voidcall_reg: src1:i len:8 clob:c
305 voidcall_membase: src1:b len:12 clob:c
306 fcall: dest:f len:8 clob:c
307 fcall_reg: dest:f src1:i len:8 clob:c
308 fcall_membase: dest:f src1:b len:12 clob:c
309 lcall: dest:l len:8 clob:c
310 lcall_reg: dest:l src1:i len:8 clob:c
311 lcall_membase: dest:l src1:b len:12 clob:c
312 vcall: len:8 clob:c
313 vcall_reg: src1:i len:8 clob:c
314 vcall_membase: src1:b len:12 clob:c
315 call_reg: dest:a src1:i len:8 clob:c
316 call_membase: dest:a src1:b len:12 clob:c
317 trap:
318 iconst: dest:i len:16
319 i8const:
320 r4const: dest:f len:22
321 r8const: dest:f len:18
322 regvar:
323 reg:
324 regoffset:
325 label:
326 store_membase_imm: dest:b len:32
327 store_membase_reg: dest:b src1:i len:18
328 storei1_membase_imm: dest:b len:32
329 storei1_membase_reg: dest:b src1:i len:18
330 storei2_membase_imm: dest:b len:32
331 storei2_membase_reg: dest:b src1:i len:18
332 storei4_membase_imm: dest:b len:32
333 storei4_membase_reg: dest:b src1:i len:18
334 storei8_membase_imm: dest:b 
335 storei8_membase_reg: dest:b src1:i 
336 storer4_membase_reg: dest:b src1:f len:20
337 storer8_membase_reg: dest:b src1:f len:20
338 load_membase: dest:i src1:b len:18
339 loadi1_membase: dest:i src1:b len:40
340 loadu1_membase: dest:i src1:b len:26
341 loadi2_membase: dest:i src1:b len:22
342 loadu2_membase: dest:i src1:b len:26
343 loadi4_membase: dest:i src1:b len:18
344 loadu4_membase: dest:i src1:b len:18
345 loadi8_membase: dest:i src1:b
346 loadr4_membase: dest:f src1:b len:18
347 loadr8_membase: dest:f src1:b len:18
348 loadu4_mem: dest:i len:8
349 move: dest:i src1:i len:4
350 fmove: dest:f src1:f len:4
351 add_imm: dest:i src1:i len:18
352 addcc_imm: dest:i src1:i len:18
353 sub_imm: dest:i src1:i len:18
354 subcc_imm: dest:i src1:i len:18
355 mul_imm: dest:i src1:i len:18
356 # there is no actual support for division or reminder by immediate
357 # we simulate them, though (but we need to change the burg rules 
358 # to allocate a symbolic reg for src2)
359 div_imm: dest:i src1:i src2:i len:24
360 div_un_imm: dest:i src1:i src2:i len:24
361 rem_imm: dest:i src1:i src2:i len:24
362 rem_un_imm: dest:i src1:i src2:i len:24
363 and_imm: dest:i src1:i len:16
364 or_imm: dest:i src1:i len:16
365 xor_imm: dest:i src1:i len:16
366 shl_imm: dest:i src1:i len:8
367 shr_imm: dest:i src1:i len:8
368 shr_un_imm: dest:i src1:i len:8
369 cond_exc_eq: len:8
370 cond_exc_ne_un: len:8
371 cond_exc_lt: len:8
372 cond_exc_lt_un: len:8
373 cond_exc_gt: len:8
374 cond_exc_gt_un: len:8
375 cond_exc_ge: len:8
376 cond_exc_ge_un: len:8
377 cond_exc_le: len:8
378 cond_exc_le_un: len:8
379 cond_exc_ov: len:8
380 cond_exc_no: len:8
381 cond_exc_c: len:8
382 cond_exc_nc: len:8
383 long_add:
384 long_sub:
385 long_mul:
386 long_div:
387 long_div_un:
388 long_rem:
389 long_rem_un:
390 long_and:
391 long_or:
392 long_xor:
393 long_shl:
394 long_shr:
395 long_shr_un:
396 long_neg:
397 long_not:
398 long_conv_to_i1:
399 long_conv_to_i2:
400 long_conv_to_i4:
401 long_conv_to_i8:
402 long_conv_to_r4:
403 long_conv_to_r8:
404 long_conv_to_u4:
405 long_conv_to_u8:
406 long_conv_to_u2:
407 long_conv_to_u1:
408 long_conv_to_i:
409 long_conv_to_ovf_i: dest:i src1:i src2:i len:44
410 long_conv_to_ovf_u:
411 long_add_ovf:
412 long_add_ovf_un:
413 long_mul_ovf: len: 18
414 long_mul_ovf_un: len: 18 
415 long_sub_ovf:
416 long_sub_ovf_un:
417 long_conv_to_ovf_i1_un:
418 long_conv_to_ovf_i2_un:
419 long_conv_to_ovf_i4_un:
420 long_conv_to_ovf_i8_un:
421 long_conv_to_ovf_u1_un:
422 long_conv_to_ovf_u2_un:
423 long_conv_to_ovf_u4_un:
424 long_conv_to_ovf_u8_un:
425 long_conv_to_ovf_i_un:
426 long_conv_to_ovf_u_un:
427 long_conv_to_ovf_i1:
428 long_conv_to_ovf_u1:
429 long_conv_to_ovf_i2:
430 long_conv_to_ovf_u2:
431 long_conv_to_ovf_i4:
432 long_conv_to_ovf_u4:
433 long_conv_to_ovf_i8:
434 long_conv_to_ovf_u8:
435 long_ceq:
436 long_cgt:
437 long_cgt_un:
438 long_clt:
439 long_clt_un:
440 long_conv_to_r_un: dest:f src1:i src2:i len:37 
441 long_conv_to_u:
442 long_shr_imm:
443 long_shr_un_imm:
444 long_shl_imm:
445 long_add_imm:
446 long_sub_imm:
447 long_beq:
448 long_bne_un:
449 long_blt:
450 long_blt_un:
451 long_bgt:
452 long_btg_un:
453 long_bge:
454 long_bge_un:
455 long_ble:
456 long_ble_un:
457 float_beq: len:8
458 float_bne_un: len:8
459 float_blt: len:8
460 float_blt_un: len:8
461 float_bgt: len:8
462 float_btg_un: len:8
463 float_bge: len:8
464 float_bge_un: len:8
465 float_ble: len:8
466 float_ble_un: len:8
467 float_add: dest:f src1:f src2:f len:6
468 float_sub: dest:f src1:f src2:f len:6
469 float_mul: dest:f src1:f src2:f len:6
470 float_div: dest:f src1:f src2:f len:6
471 float_div_un: dest:f src1:f src2:f len:6
472 float_rem: dest:f src1:f src2:f len:16
473 float_rem_un: dest:f src1:f src2:f len:16
474 float_neg: dest:f src1:f len:6
475 float_not: dest:f src1:f len:6
476 float_conv_to_i1: dest:i src1:f len:50
477 float_conv_to_i2: dest:i src1:f len:50
478 float_conv_to_i4: dest:i src1:f len:50
479 float_conv_to_i8: dest:l src1:f len:50
480 float_conv_to_r4: dest:f src1:f len:4
481 float_conv_to_r8:
482 float_conv_to_u4: dest:i src1:f len:52
483 float_conv_to_u8: dest:l src1:f len:52
484 float_conv_to_u2: dest:i src1:f len:52
485 float_conv_to_u1: dest:i src1:f len:52
486 float_conv_to_i: dest:i src1:f len:52
487 float_conv_to_ovf_i:
488 float_conv_to_ovd_u:
489 float_add_ovf:
490 float_add_ovf_un:
491 float_mul_ovf:
492 float_mul_ovf_un:
493 float_sub_ovf:
494 float_sub_ovf_un:
495 float_conv_to_ovf_i1_un:
496 float_conv_to_ovf_i2_un:
497 float_conv_to_ovf_i4_un:
498 float_conv_to_ovf_i8_un:
499 float_conv_to_ovf_u1_un:
500 float_conv_to_ovf_u2_un:
501 float_conv_to_ovf_u4_un:
502 float_conv_to_ovf_u8_un:
503 float_conv_to_ovf_i_un:
504 float_conv_to_ovf_u_un:
505 float_conv_to_ovf_i1:
506 float_conv_to_ovf_u1:
507 float_conv_to_ovf_i2:
508 float_conv_to_ovf_u2:
509 float_conv_to_ovf_i4:
510 float_conv_to_ovf_u4:
511 float_conv_to_ovf_i8:
512 float_conv_to_ovf_u8:
513 float_ceq: dest:i src1:f src2:f len:16
514 float_cgt: dest:i src1:f src2:f len:16
515 float_cgt_un: dest:i src1:f src2:f len:16
516 float_clt: dest:i src1:f src2:f len:16
517 float_clt_un: dest:i src1:f src2:f len:16
518 float_conv_to_u: dest:i src1:f len:36
519 call_handler: len:12
520 op_endfilter: src1:i len:12
521 aot_const: dest:i len:8
522 #x86_test_null: src1:i len:4
523 #x86_compare_membase_reg: src1:b src2:i len:8
524 #x86_compare_membase_imm: src1:b len:8
525 #x86_compare_reg_membase: src1:i src2:b len:8
526 #x86_inc_reg: dest:i src1:i clob:1 len:1
527 #x86_inc_membase: src1:b len:6
528 #x86_dec_reg: dest:i src1:i clob:1 len:1
529 #x86_dec_membase: src1:b len:6
530 #x86_add_membase_imm: src1:b len:8
531 #x86_sub_membase_imm: src1:b len:8
532 #x86_push: src1:i len:1
533 #x86_push_imm: len:5
534 #x86_push_membase: src1:b len:6
535 #x86_push_obj: src1:b len:30
536 #x86_lea: dest:i src1:i src2:i len:7
537 #x86_xchg: src1:i src2:i clob:x len:1
538 #x86_fpop: src1:f len:2
539 #x86_fp_load_i8: dest:f src1:b len:7
540 #x86_fp_load_i4: dest:f src1:b len:7
541 sqrt: dest:f src1:f len:4
542 adc: dest:i src1:i src2:i len:6
543 addcc: dest:i src1:i src2:i len:6
544 subcc: dest:i src1:i src2:i len:6
545 adc_imm: dest:i src1:i len:14
546 sbb: dest:i src1:i src2:i len:6
547 sbb_imm: dest:i src1:i len:14
548 br_reg: src1:i len:8
549 #ppc_subfic: dest:i src1:i len:4
550 #ppc_subfze: dest:i src1:i len:4
551 op_bigmul: len:2 dest:l src1:a src2:i
552 op_bigmul_un: len:2 dest:l src1:a src2:i