1 /* DO NOT EDIT! -*- buffer-read-only: t -*- vi:set ro: */
2 /* Instruction opcode table for m32r.
4 THIS FILE IS MACHINE GENERATED WITH CGEN.
6 Copyright (C) 1996-2019 Free Software Foundation, Inc.
8 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
10 This file is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3, or (at your option)
15 It is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18 License for more details.
20 You should have received a copy of the GNU General Public License along
21 with this program; if not, write to the Free Software Foundation, Inc.,
22 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
30 #include "m32r-desc.h"
32 #include "libiberty.h"
36 m32r_cgen_dis_hash (const char * buf ATTRIBUTE_UNUSED, CGEN_INSN_INT value)
40 if (value & 0xffff0000) /* 32bit instructions. */
41 value = (value >> 16) & 0xffff;
43 x = (value >> 8) & 0xf0;
44 if (x == 0x40 || x == 0xe0 || x == 0x60 || x == 0x50)
47 if (x == 0x70 || x == 0xf0)
48 return x | ((value >> 8) & 0x0f);
51 return x | ((value & 0x70) >> 4);
53 return x | ((value & 0xf0) >> 4);
57 /* The hash functions are recorded here to help keep assembler code out of
58 the disassembler and vice versa. */
60 static int asm_hash_insn_p (const CGEN_INSN *);
61 static unsigned int asm_hash_insn (const char *);
62 static int dis_hash_insn_p (const CGEN_INSN *);
63 static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT);
65 /* Instruction formats. */
67 #define F(f) & m32r_cgen_ifld_table[M32R_##f]
68 static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
72 static const CGEN_IFMT ifmt_add ATTRIBUTE_UNUSED = {
73 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
76 static const CGEN_IFMT ifmt_add3 ATTRIBUTE_UNUSED = {
77 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
80 static const CGEN_IFMT ifmt_and3 ATTRIBUTE_UNUSED = {
81 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
84 static const CGEN_IFMT ifmt_or3 ATTRIBUTE_UNUSED = {
85 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
88 static const CGEN_IFMT ifmt_addi ATTRIBUTE_UNUSED = {
89 16, 16, 0xf000, { { F (F_OP1) }, { F (F_R1) }, { F (F_SIMM8) }, { 0 } }
92 static const CGEN_IFMT ifmt_addv3 ATTRIBUTE_UNUSED = {
93 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
96 static const CGEN_IFMT ifmt_bc8 ATTRIBUTE_UNUSED = {
97 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
100 static const CGEN_IFMT ifmt_bc24 ATTRIBUTE_UNUSED = {
101 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
104 static const CGEN_IFMT ifmt_beq ATTRIBUTE_UNUSED = {
105 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_DISP16) }, { 0 } }
108 static const CGEN_IFMT ifmt_beqz ATTRIBUTE_UNUSED = {
109 32, 32, 0xfff00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_DISP16) }, { 0 } }
112 static const CGEN_IFMT ifmt_cmp ATTRIBUTE_UNUSED = {
113 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
116 static const CGEN_IFMT ifmt_cmpi ATTRIBUTE_UNUSED = {
117 32, 32, 0xfff00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
120 static const CGEN_IFMT ifmt_cmpz ATTRIBUTE_UNUSED = {
121 16, 16, 0xfff0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
124 static const CGEN_IFMT ifmt_div ATTRIBUTE_UNUSED = {
125 32, 32, 0xf0f0ffff, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
128 static const CGEN_IFMT ifmt_jc ATTRIBUTE_UNUSED = {
129 16, 16, 0xfff0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
132 static const CGEN_IFMT ifmt_ld24 ATTRIBUTE_UNUSED = {
133 32, 32, 0xf0000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_UIMM24) }, { 0 } }
136 static const CGEN_IFMT ifmt_ldi16 ATTRIBUTE_UNUSED = {
137 32, 32, 0xf0ff0000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
140 static const CGEN_IFMT ifmt_machi_a ATTRIBUTE_UNUSED = {
141 16, 16, 0xf070, { { F (F_OP1) }, { F (F_R1) }, { F (F_ACC) }, { F (F_OP23) }, { F (F_R2) }, { 0 } }
144 static const CGEN_IFMT ifmt_mvfachi ATTRIBUTE_UNUSED = {
145 16, 16, 0xf0ff, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
148 static const CGEN_IFMT ifmt_mvfachi_a ATTRIBUTE_UNUSED = {
149 16, 16, 0xf0f3, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_OP3) }, { 0 } }
152 static const CGEN_IFMT ifmt_mvfc ATTRIBUTE_UNUSED = {
153 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
156 static const CGEN_IFMT ifmt_mvtachi ATTRIBUTE_UNUSED = {
157 16, 16, 0xf0ff, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
160 static const CGEN_IFMT ifmt_mvtachi_a ATTRIBUTE_UNUSED = {
161 16, 16, 0xf0f3, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_OP3) }, { 0 } }
164 static const CGEN_IFMT ifmt_mvtc ATTRIBUTE_UNUSED = {
165 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
168 static const CGEN_IFMT ifmt_nop ATTRIBUTE_UNUSED = {
169 16, 16, 0xffff, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
172 static const CGEN_IFMT ifmt_rac_dsi ATTRIBUTE_UNUSED = {
173 16, 16, 0xf3f2, { { F (F_OP1) }, { F (F_ACCD) }, { F (F_BITS67) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_BIT14) }, { F (F_IMM1) }, { 0 } }
176 static const CGEN_IFMT ifmt_seth ATTRIBUTE_UNUSED = {
177 32, 32, 0xf0ff0000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_HI16) }, { 0 } }
180 static const CGEN_IFMT ifmt_slli ATTRIBUTE_UNUSED = {
181 16, 16, 0xf0e0, { { F (F_OP1) }, { F (F_R1) }, { F (F_SHIFT_OP2) }, { F (F_UIMM5) }, { 0 } }
184 static const CGEN_IFMT ifmt_st_d ATTRIBUTE_UNUSED = {
185 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
188 static const CGEN_IFMT ifmt_trap ATTRIBUTE_UNUSED = {
189 16, 16, 0xfff0, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_UIMM4) }, { 0 } }
192 static const CGEN_IFMT ifmt_satb ATTRIBUTE_UNUSED = {
193 32, 32, 0xf0f0ffff, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
196 static const CGEN_IFMT ifmt_clrpsw ATTRIBUTE_UNUSED = {
197 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_UIMM8) }, { 0 } }
200 static const CGEN_IFMT ifmt_bset ATTRIBUTE_UNUSED = {
201 32, 32, 0xf8f00000, { { F (F_OP1) }, { F (F_BIT4) }, { F (F_UIMM3) }, { F (F_OP2) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
204 static const CGEN_IFMT ifmt_btst ATTRIBUTE_UNUSED = {
205 16, 16, 0xf8f0, { { F (F_OP1) }, { F (F_BIT4) }, { F (F_UIMM3) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
210 #define A(a) (1 << CGEN_INSN_##a)
211 #define OPERAND(op) M32R_OPERAND_##op
212 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
213 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
215 /* The instruction table. */
217 static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] =
219 /* Special null first entry.
220 A `num' value of zero is thus invalid.
221 Also, the special `invalid' insn resides here. */
222 { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
226 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
229 /* add3 $dr,$sr,$hash$slo16 */
232 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (HASH), OP (SLO16), 0 } },
233 & ifmt_add3, { 0x80a00000 }
238 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
241 /* and3 $dr,$sr,$uimm16 */
244 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (UIMM16), 0 } },
245 & ifmt_and3, { 0x80c00000 }
250 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
253 /* or3 $dr,$sr,$hash$ulo16 */
256 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (HASH), OP (ULO16), 0 } },
257 & ifmt_or3, { 0x80e00000 }
262 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
265 /* xor3 $dr,$sr,$uimm16 */
268 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (UIMM16), 0 } },
269 & ifmt_and3, { 0x80d00000 }
271 /* addi $dr,$simm8 */
274 { { MNEM, ' ', OP (DR), ',', OP (SIMM8), 0 } },
275 & ifmt_addi, { 0x4000 }
280 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
283 /* addv3 $dr,$sr,$simm16 */
286 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
287 & ifmt_addv3, { 0x80800000 }
292 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
298 { { MNEM, ' ', OP (DISP8), 0 } },
299 & ifmt_bc8, { 0x7c00 }
304 { { MNEM, ' ', OP (DISP24), 0 } },
305 & ifmt_bc24, { 0xfc000000 }
307 /* beq $src1,$src2,$disp16 */
310 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (DISP16), 0 } },
311 & ifmt_beq, { 0xb0000000 }
313 /* beqz $src2,$disp16 */
316 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
317 & ifmt_beqz, { 0xb0800000 }
319 /* bgez $src2,$disp16 */
322 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
323 & ifmt_beqz, { 0xb0b00000 }
325 /* bgtz $src2,$disp16 */
328 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
329 & ifmt_beqz, { 0xb0d00000 }
331 /* blez $src2,$disp16 */
334 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
335 & ifmt_beqz, { 0xb0c00000 }
337 /* bltz $src2,$disp16 */
340 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
341 & ifmt_beqz, { 0xb0a00000 }
343 /* bnez $src2,$disp16 */
346 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
347 & ifmt_beqz, { 0xb0900000 }
352 { { MNEM, ' ', OP (DISP8), 0 } },
353 & ifmt_bc8, { 0x7e00 }
358 { { MNEM, ' ', OP (DISP24), 0 } },
359 & ifmt_bc24, { 0xfe000000 }
364 { { MNEM, ' ', OP (DISP8), 0 } },
365 & ifmt_bc8, { 0x7800 }
370 { { MNEM, ' ', OP (DISP24), 0 } },
371 & ifmt_bc24, { 0xf8000000 }
376 { { MNEM, ' ', OP (DISP8), 0 } },
377 & ifmt_bc8, { 0x7d00 }
382 { { MNEM, ' ', OP (DISP24), 0 } },
383 & ifmt_bc24, { 0xfd000000 }
385 /* bne $src1,$src2,$disp16 */
388 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (DISP16), 0 } },
389 & ifmt_beq, { 0xb0100000 }
394 { { MNEM, ' ', OP (DISP8), 0 } },
395 & ifmt_bc8, { 0x7f00 }
400 { { MNEM, ' ', OP (DISP24), 0 } },
401 & ifmt_bc24, { 0xff000000 }
406 { { MNEM, ' ', OP (DISP8), 0 } },
407 & ifmt_bc8, { 0x7900 }
412 { { MNEM, ' ', OP (DISP24), 0 } },
413 & ifmt_bc24, { 0xf9000000 }
415 /* cmp $src1,$src2 */
418 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
421 /* cmpi $src2,$simm16 */
424 { { MNEM, ' ', OP (SRC2), ',', OP (SIMM16), 0 } },
425 & ifmt_cmpi, { 0x80400000 }
427 /* cmpu $src1,$src2 */
430 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
433 /* cmpui $src2,$simm16 */
436 { { MNEM, ' ', OP (SRC2), ',', OP (SIMM16), 0 } },
437 & ifmt_cmpi, { 0x80500000 }
439 /* cmpeq $src1,$src2 */
442 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
448 { { MNEM, ' ', OP (SRC2), 0 } },
449 & ifmt_cmpz, { 0x70 }
454 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
455 & ifmt_div, { 0x90000000 }
460 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
461 & ifmt_div, { 0x90100000 }
466 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
467 & ifmt_div, { 0x90200000 }
472 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
473 & ifmt_div, { 0x90300000 }
478 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
479 & ifmt_div, { 0x90200010 }
484 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
485 & ifmt_div, { 0x90300010 }
490 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
491 & ifmt_div, { 0x90200018 }
496 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
497 & ifmt_div, { 0x90300018 }
502 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
503 & ifmt_div, { 0x90100010 }
508 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
509 & ifmt_div, { 0x90000018 }
514 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
515 & ifmt_div, { 0x90100018 }
520 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
521 & ifmt_div, { 0x90000010 }
526 { { MNEM, ' ', OP (SR), 0 } },
527 & ifmt_jc, { 0x1cc0 }
532 { { MNEM, ' ', OP (SR), 0 } },
533 & ifmt_jc, { 0x1dc0 }
538 { { MNEM, ' ', OP (SR), 0 } },
539 & ifmt_jc, { 0x1ec0 }
544 { { MNEM, ' ', OP (SR), 0 } },
545 & ifmt_jc, { 0x1fc0 }
550 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
551 & ifmt_add, { 0x20c0 }
553 /* ld $dr,@($slo16,$sr) */
556 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
557 & ifmt_add3, { 0xa0c00000 }
562 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
563 & ifmt_add, { 0x2080 }
565 /* ldb $dr,@($slo16,$sr) */
568 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
569 & ifmt_add3, { 0xa0800000 }
574 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
575 & ifmt_add, { 0x20a0 }
577 /* ldh $dr,@($slo16,$sr) */
580 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
581 & ifmt_add3, { 0xa0a00000 }
586 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
587 & ifmt_add, { 0x2090 }
589 /* ldub $dr,@($slo16,$sr) */
592 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
593 & ifmt_add3, { 0xa0900000 }
598 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
599 & ifmt_add, { 0x20b0 }
601 /* lduh $dr,@($slo16,$sr) */
604 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
605 & ifmt_add3, { 0xa0b00000 }
610 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), '+', 0 } },
611 & ifmt_add, { 0x20e0 }
613 /* ld24 $dr,$uimm24 */
616 { { MNEM, ' ', OP (DR), ',', OP (UIMM24), 0 } },
617 & ifmt_ld24, { 0xe0000000 }
619 /* ldi8 $dr,$simm8 */
622 { { MNEM, ' ', OP (DR), ',', OP (SIMM8), 0 } },
623 & ifmt_addi, { 0x6000 }
625 /* ldi16 $dr,$hash$slo16 */
628 { { MNEM, ' ', OP (DR), ',', OP (HASH), OP (SLO16), 0 } },
629 & ifmt_ldi16, { 0x90f00000 }
634 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
635 & ifmt_add, { 0x20d0 }
637 /* machi $src1,$src2 */
640 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
641 & ifmt_cmp, { 0x3040 }
643 /* machi $src1,$src2,$acc */
646 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
647 & ifmt_machi_a, { 0x3040 }
649 /* maclo $src1,$src2 */
652 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
653 & ifmt_cmp, { 0x3050 }
655 /* maclo $src1,$src2,$acc */
658 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
659 & ifmt_machi_a, { 0x3050 }
661 /* macwhi $src1,$src2 */
664 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
665 & ifmt_cmp, { 0x3060 }
667 /* macwhi $src1,$src2,$acc */
670 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
671 & ifmt_machi_a, { 0x3060 }
673 /* macwlo $src1,$src2 */
676 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
677 & ifmt_cmp, { 0x3070 }
679 /* macwlo $src1,$src2,$acc */
682 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
683 & ifmt_machi_a, { 0x3070 }
688 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
689 & ifmt_add, { 0x1060 }
691 /* mulhi $src1,$src2 */
694 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
695 & ifmt_cmp, { 0x3000 }
697 /* mulhi $src1,$src2,$acc */
700 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
701 & ifmt_machi_a, { 0x3000 }
703 /* mullo $src1,$src2 */
706 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
707 & ifmt_cmp, { 0x3010 }
709 /* mullo $src1,$src2,$acc */
712 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
713 & ifmt_machi_a, { 0x3010 }
715 /* mulwhi $src1,$src2 */
718 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
719 & ifmt_cmp, { 0x3020 }
721 /* mulwhi $src1,$src2,$acc */
724 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
725 & ifmt_machi_a, { 0x3020 }
727 /* mulwlo $src1,$src2 */
730 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
731 & ifmt_cmp, { 0x3030 }
733 /* mulwlo $src1,$src2,$acc */
736 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
737 & ifmt_machi_a, { 0x3030 }
742 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
743 & ifmt_add, { 0x1080 }
748 { { MNEM, ' ', OP (DR), 0 } },
749 & ifmt_mvfachi, { 0x50f0 }
751 /* mvfachi $dr,$accs */
754 { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } },
755 & ifmt_mvfachi_a, { 0x50f0 }
760 { { MNEM, ' ', OP (DR), 0 } },
761 & ifmt_mvfachi, { 0x50f1 }
763 /* mvfaclo $dr,$accs */
766 { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } },
767 & ifmt_mvfachi_a, { 0x50f1 }
772 { { MNEM, ' ', OP (DR), 0 } },
773 & ifmt_mvfachi, { 0x50f2 }
775 /* mvfacmi $dr,$accs */
778 { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } },
779 & ifmt_mvfachi_a, { 0x50f2 }
784 { { MNEM, ' ', OP (DR), ',', OP (SCR), 0 } },
785 & ifmt_mvfc, { 0x1090 }
790 { { MNEM, ' ', OP (SRC1), 0 } },
791 & ifmt_mvtachi, { 0x5070 }
793 /* mvtachi $src1,$accs */
796 { { MNEM, ' ', OP (SRC1), ',', OP (ACCS), 0 } },
797 & ifmt_mvtachi_a, { 0x5070 }
802 { { MNEM, ' ', OP (SRC1), 0 } },
803 & ifmt_mvtachi, { 0x5071 }
805 /* mvtaclo $src1,$accs */
808 { { MNEM, ' ', OP (SRC1), ',', OP (ACCS), 0 } },
809 & ifmt_mvtachi_a, { 0x5071 }
814 { { MNEM, ' ', OP (SR), ',', OP (DCR), 0 } },
815 & ifmt_mvtc, { 0x10a0 }
820 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
827 & ifmt_nop, { 0x7000 }
832 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
839 & ifmt_nop, { 0x5090 }
841 /* rac $accd,$accs,$imm1 */
844 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), ',', OP (IMM1), 0 } },
845 & ifmt_rac_dsi, { 0x5090 }
851 & ifmt_nop, { 0x5080 }
853 /* rach $accd,$accs,$imm1 */
856 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), ',', OP (IMM1), 0 } },
857 & ifmt_rac_dsi, { 0x5080 }
863 & ifmt_nop, { 0x10d6 }
865 /* seth $dr,$hash$hi16 */
868 { { MNEM, ' ', OP (DR), ',', OP (HASH), OP (HI16), 0 } },
869 & ifmt_seth, { 0xd0c00000 }
874 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
875 & ifmt_add, { 0x1040 }
877 /* sll3 $dr,$sr,$simm16 */
880 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
881 & ifmt_addv3, { 0x90c00000 }
883 /* slli $dr,$uimm5 */
886 { { MNEM, ' ', OP (DR), ',', OP (UIMM5), 0 } },
887 & ifmt_slli, { 0x5040 }
892 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
893 & ifmt_add, { 0x1020 }
895 /* sra3 $dr,$sr,$simm16 */
898 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
899 & ifmt_addv3, { 0x90a00000 }
901 /* srai $dr,$uimm5 */
904 { { MNEM, ' ', OP (DR), ',', OP (UIMM5), 0 } },
905 & ifmt_slli, { 0x5020 }
910 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
911 & ifmt_add, { 0x1000 }
913 /* srl3 $dr,$sr,$simm16 */
916 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
917 & ifmt_addv3, { 0x90800000 }
919 /* srli $dr,$uimm5 */
922 { { MNEM, ' ', OP (DR), ',', OP (UIMM5), 0 } },
923 & ifmt_slli, { 0x5000 }
925 /* st $src1,@$src2 */
928 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
929 & ifmt_cmp, { 0x2040 }
931 /* st $src1,@($slo16,$src2) */
934 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SLO16), ',', OP (SRC2), ')', 0 } },
935 & ifmt_st_d, { 0xa0400000 }
937 /* stb $src1,@$src2 */
940 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
941 & ifmt_cmp, { 0x2000 }
943 /* stb $src1,@($slo16,$src2) */
946 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SLO16), ',', OP (SRC2), ')', 0 } },
947 & ifmt_st_d, { 0xa0000000 }
949 /* sth $src1,@$src2 */
952 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
953 & ifmt_cmp, { 0x2020 }
955 /* sth $src1,@($slo16,$src2) */
958 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SLO16), ',', OP (SRC2), ')', 0 } },
959 & ifmt_st_d, { 0xa0200000 }
961 /* st $src1,@+$src2 */
964 { { MNEM, ' ', OP (SRC1), ',', '@', '+', OP (SRC2), 0 } },
965 & ifmt_cmp, { 0x2060 }
967 /* sth $src1,@$src2+ */
970 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), '+', 0 } },
971 & ifmt_cmp, { 0x2030 }
973 /* stb $src1,@$src2+ */
976 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), '+', 0 } },
977 & ifmt_cmp, { 0x2010 }
979 /* st $src1,@-$src2 */
982 { { MNEM, ' ', OP (SRC1), ',', '@', '-', OP (SRC2), 0 } },
983 & ifmt_cmp, { 0x2070 }
988 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
994 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
1000 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
1001 & ifmt_add, { 0x10 }
1006 { { MNEM, ' ', OP (UIMM4), 0 } },
1007 & ifmt_trap, { 0x10f0 }
1009 /* unlock $src1,@$src2 */
1012 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
1013 & ifmt_cmp, { 0x2050 }
1018 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
1019 & ifmt_satb, { 0x80600300 }
1024 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
1025 & ifmt_satb, { 0x80600200 }
1030 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
1031 & ifmt_satb, { 0x80600000 }
1036 { { MNEM, ' ', OP (SRC2), 0 } },
1037 & ifmt_cmpz, { 0x370 }
1043 & ifmt_nop, { 0x50e4 }
1045 /* macwu1 $src1,$src2 */
1048 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
1049 & ifmt_cmp, { 0x50b0 }
1051 /* msblo $src1,$src2 */
1054 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
1055 & ifmt_cmp, { 0x50d0 }
1057 /* mulwu1 $src1,$src2 */
1060 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
1061 & ifmt_cmp, { 0x50a0 }
1063 /* maclh1 $src1,$src2 */
1066 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
1067 & ifmt_cmp, { 0x50c0 }
1073 & ifmt_nop, { 0x7401 }
1079 & ifmt_nop, { 0x7501 }
1084 { { MNEM, ' ', OP (UIMM8), 0 } },
1085 & ifmt_clrpsw, { 0x7200 }
1090 { { MNEM, ' ', OP (UIMM8), 0 } },
1091 & ifmt_clrpsw, { 0x7100 }
1093 /* bset $uimm3,@($slo16,$sr) */
1096 { { MNEM, ' ', OP (UIMM3), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
1097 & ifmt_bset, { 0xa0600000 }
1099 /* bclr $uimm3,@($slo16,$sr) */
1102 { { MNEM, ' ', OP (UIMM3), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
1103 & ifmt_bset, { 0xa0700000 }
1105 /* btst $uimm3,$sr */
1108 { { MNEM, ' ', OP (UIMM3), ',', OP (SR), 0 } },
1109 & ifmt_btst, { 0xf0 }
1118 /* Formats for ALIAS macro-insns. */
1120 #define F(f) & m32r_cgen_ifld_table[M32R_##f]
1121 static const CGEN_IFMT ifmt_bc8r ATTRIBUTE_UNUSED = {
1122 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
1125 static const CGEN_IFMT ifmt_bc24r ATTRIBUTE_UNUSED = {
1126 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
1129 static const CGEN_IFMT ifmt_bl8r ATTRIBUTE_UNUSED = {
1130 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
1133 static const CGEN_IFMT ifmt_bl24r ATTRIBUTE_UNUSED = {
1134 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
1137 static const CGEN_IFMT ifmt_bcl8r ATTRIBUTE_UNUSED = {
1138 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
1141 static const CGEN_IFMT ifmt_bcl24r ATTRIBUTE_UNUSED = {
1142 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
1145 static const CGEN_IFMT ifmt_bnc8r ATTRIBUTE_UNUSED = {
1146 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
1149 static const CGEN_IFMT ifmt_bnc24r ATTRIBUTE_UNUSED = {
1150 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
1153 static const CGEN_IFMT ifmt_bra8r ATTRIBUTE_UNUSED = {
1154 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
1157 static const CGEN_IFMT ifmt_bra24r ATTRIBUTE_UNUSED = {
1158 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
1161 static const CGEN_IFMT ifmt_bncl8r ATTRIBUTE_UNUSED = {
1162 16, 16, 0xff00, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP8) }, { 0 } }
1165 static const CGEN_IFMT ifmt_bncl24r ATTRIBUTE_UNUSED = {
1166 32, 32, 0xff000000, { { F (F_OP1) }, { F (F_R1) }, { F (F_DISP24) }, { 0 } }
1169 static const CGEN_IFMT ifmt_ld_2 ATTRIBUTE_UNUSED = {
1170 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1173 static const CGEN_IFMT ifmt_ld_d2 ATTRIBUTE_UNUSED = {
1174 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1177 static const CGEN_IFMT ifmt_ldb_2 ATTRIBUTE_UNUSED = {
1178 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1181 static const CGEN_IFMT ifmt_ldb_d2 ATTRIBUTE_UNUSED = {
1182 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1185 static const CGEN_IFMT ifmt_ldh_2 ATTRIBUTE_UNUSED = {
1186 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1189 static const CGEN_IFMT ifmt_ldh_d2 ATTRIBUTE_UNUSED = {
1190 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1193 static const CGEN_IFMT ifmt_ldub_2 ATTRIBUTE_UNUSED = {
1194 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1197 static const CGEN_IFMT ifmt_ldub_d2 ATTRIBUTE_UNUSED = {
1198 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1201 static const CGEN_IFMT ifmt_lduh_2 ATTRIBUTE_UNUSED = {
1202 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1205 static const CGEN_IFMT ifmt_lduh_d2 ATTRIBUTE_UNUSED = {
1206 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1209 static const CGEN_IFMT ifmt_pop ATTRIBUTE_UNUSED = {
1210 16, 16, 0xf0ff, { { F (F_OP1) }, { F (F_R1) }, { F (F_OP2) }, { F (F_R2) }, { 0 } }
1213 static const CGEN_IFMT ifmt_ldi8a ATTRIBUTE_UNUSED = {
1214 16, 16, 0xf000, { { F (F_OP1) }, { F (F_R1) }, { F (F_SIMM8) }, { 0 } }
1217 static const CGEN_IFMT ifmt_ldi16a ATTRIBUTE_UNUSED = {
1218 32, 32, 0xf0ff0000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R2) }, { F (F_R1) }, { F (F_SIMM16) }, { 0 } }
1221 static const CGEN_IFMT ifmt_rac_d ATTRIBUTE_UNUSED = {
1222 16, 16, 0xf3ff, { { F (F_OP1) }, { F (F_ACCD) }, { F (F_BITS67) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_BIT14) }, { F (F_IMM1) }, { 0 } }
1225 static const CGEN_IFMT ifmt_rac_ds ATTRIBUTE_UNUSED = {
1226 16, 16, 0xf3f3, { { F (F_OP1) }, { F (F_ACCD) }, { F (F_BITS67) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_BIT14) }, { F (F_IMM1) }, { 0 } }
1229 static const CGEN_IFMT ifmt_rach_d ATTRIBUTE_UNUSED = {
1230 16, 16, 0xf3ff, { { F (F_OP1) }, { F (F_ACCD) }, { F (F_BITS67) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_BIT14) }, { F (F_IMM1) }, { 0 } }
1233 static const CGEN_IFMT ifmt_rach_ds ATTRIBUTE_UNUSED = {
1234 16, 16, 0xf3f3, { { F (F_OP1) }, { F (F_ACCD) }, { F (F_BITS67) }, { F (F_OP2) }, { F (F_ACCS) }, { F (F_BIT14) }, { F (F_IMM1) }, { 0 } }
1237 static const CGEN_IFMT ifmt_st_2 ATTRIBUTE_UNUSED = {
1238 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1241 static const CGEN_IFMT ifmt_st_d2 ATTRIBUTE_UNUSED = {
1242 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1245 static const CGEN_IFMT ifmt_stb_2 ATTRIBUTE_UNUSED = {
1246 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1249 static const CGEN_IFMT ifmt_stb_d2 ATTRIBUTE_UNUSED = {
1250 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1253 static const CGEN_IFMT ifmt_sth_2 ATTRIBUTE_UNUSED = {
1254 16, 16, 0xf0f0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1257 static const CGEN_IFMT ifmt_sth_d2 ATTRIBUTE_UNUSED = {
1258 32, 32, 0xf0f00000, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
1261 static const CGEN_IFMT ifmt_push ATTRIBUTE_UNUSED = {
1262 16, 16, 0xf0ff, { { F (F_OP1) }, { F (F_OP2) }, { F (F_R1) }, { F (F_R2) }, { 0 } }
1267 /* Each non-simple macro entry points to an array of expansion possibilities. */
1269 #define A(a) (1 << CGEN_INSN_##a)
1270 #define OPERAND(op) M32R_OPERAND_##op
1271 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1272 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1274 /* The macro instruction table. */
1276 static const CGEN_IBASE m32r_cgen_macro_insn_table[] =
1280 -1, "bc8r", "bc", 16,
1281 { 0|A(RELAXABLE)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1285 -1, "bc24r", "bc", 32,
1286 { 0|A(RELAXED)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1290 -1, "bl8r", "bl", 16,
1291 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(UNCOND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1295 -1, "bl24r", "bl", 32,
1296 { 0|A(RELAXED)|A(UNCOND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1300 -1, "bcl8r", "bcl", 16,
1301 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_O, 0 } } } }
1305 -1, "bcl24r", "bcl", 32,
1306 { 0|A(RELAXED)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_NONE, 0 } } } }
1310 -1, "bnc8r", "bnc", 16,
1311 { 0|A(RELAXABLE)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1315 -1, "bnc24r", "bnc", 32,
1316 { 0|A(RELAXED)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1320 -1, "bra8r", "bra", 16,
1321 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(UNCOND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1325 -1, "bra24r", "bra", 32,
1326 { 0|A(RELAXED)|A(UNCOND_CTI)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1330 -1, "bncl8r", "bncl", 16,
1331 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_O, 0 } } } }
1335 -1, "bncl24r", "bncl", 32,
1336 { 0|A(RELAXED)|A(COND_CTI)|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_NONE, 0 } } } }
1340 -1, "ld-2", "ld", 16,
1341 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1343 /* ld $dr,@($sr,$slo16) */
1345 -1, "ld-d2", "ld", 32,
1346 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1348 /* ldb $dr,@($sr) */
1350 -1, "ldb-2", "ldb", 16,
1351 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1353 /* ldb $dr,@($sr,$slo16) */
1355 -1, "ldb-d2", "ldb", 32,
1356 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1358 /* ldh $dr,@($sr) */
1360 -1, "ldh-2", "ldh", 16,
1361 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1363 /* ldh $dr,@($sr,$slo16) */
1365 -1, "ldh-d2", "ldh", 32,
1366 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1368 /* ldub $dr,@($sr) */
1370 -1, "ldub-2", "ldub", 16,
1371 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1373 /* ldub $dr,@($sr,$slo16) */
1375 -1, "ldub-d2", "ldub", 32,
1376 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1378 /* lduh $dr,@($sr) */
1380 -1, "lduh-2", "lduh", 16,
1381 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1383 /* lduh $dr,@($sr,$slo16) */
1385 -1, "lduh-d2", "lduh", 32,
1386 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1390 -1, "pop", "pop", 16,
1391 { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1393 /* ldi $dr,$simm8 */
1395 -1, "ldi8a", "ldi", 16,
1396 { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_OS, 0 } } } }
1398 /* ldi $dr,$hash$slo16 */
1400 -1, "ldi16a", "ldi", 32,
1401 { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1405 -1, "rac-d", "rac", 16,
1406 { 0|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_S, 0 } } } }
1408 /* rac $accd,$accs */
1410 -1, "rac-ds", "rac", 16,
1411 { 0|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_S, 0 } } } }
1415 -1, "rach-d", "rach", 16,
1416 { 0|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_S, 0 } } } }
1418 /* rach $accd,$accs */
1420 -1, "rach-ds", "rach", 16,
1421 { 0|A(ALIAS), { { { (1<<MACH_M32RX)|(1<<MACH_M32R2), 0 } }, { { PIPE_S, 0 } } } }
1423 /* st $src1,@($src2) */
1425 -1, "st-2", "st", 16,
1426 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1428 /* st $src1,@($src2,$slo16) */
1430 -1, "st-d2", "st", 32,
1431 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1433 /* stb $src1,@($src2) */
1435 -1, "stb-2", "stb", 16,
1436 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1438 /* stb $src1,@($src2,$slo16) */
1440 -1, "stb-d2", "stb", 32,
1441 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1443 /* sth $src1,@($src2) */
1445 -1, "sth-2", "sth", 16,
1446 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1448 /* sth $src1,@($src2,$slo16) */
1450 -1, "sth-d2", "sth", 32,
1451 { 0|A(NO_DIS)|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_NONE, 0 } } } }
1455 -1, "push", "push", 16,
1456 { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } }, { { PIPE_O, 0 } } } }
1460 /* The macro instruction opcode table. */
1462 static const CGEN_OPCODE m32r_cgen_macro_insn_opcode_table[] =
1467 { { MNEM, ' ', OP (DISP8), 0 } },
1468 & ifmt_bc8r, { 0x7c00 }
1473 { { MNEM, ' ', OP (DISP24), 0 } },
1474 & ifmt_bc24r, { 0xfc000000 }
1479 { { MNEM, ' ', OP (DISP8), 0 } },
1480 & ifmt_bl8r, { 0x7e00 }
1485 { { MNEM, ' ', OP (DISP24), 0 } },
1486 & ifmt_bl24r, { 0xfe000000 }
1491 { { MNEM, ' ', OP (DISP8), 0 } },
1492 & ifmt_bcl8r, { 0x7800 }
1497 { { MNEM, ' ', OP (DISP24), 0 } },
1498 & ifmt_bcl24r, { 0xf8000000 }
1503 { { MNEM, ' ', OP (DISP8), 0 } },
1504 & ifmt_bnc8r, { 0x7d00 }
1509 { { MNEM, ' ', OP (DISP24), 0 } },
1510 & ifmt_bnc24r, { 0xfd000000 }
1515 { { MNEM, ' ', OP (DISP8), 0 } },
1516 & ifmt_bra8r, { 0x7f00 }
1521 { { MNEM, ' ', OP (DISP24), 0 } },
1522 & ifmt_bra24r, { 0xff000000 }
1527 { { MNEM, ' ', OP (DISP8), 0 } },
1528 & ifmt_bncl8r, { 0x7900 }
1533 { { MNEM, ' ', OP (DISP24), 0 } },
1534 & ifmt_bncl24r, { 0xf9000000 }
1539 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1540 & ifmt_ld_2, { 0x20c0 }
1542 /* ld $dr,@($sr,$slo16) */
1545 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1546 & ifmt_ld_d2, { 0xa0c00000 }
1548 /* ldb $dr,@($sr) */
1551 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1552 & ifmt_ldb_2, { 0x2080 }
1554 /* ldb $dr,@($sr,$slo16) */
1557 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1558 & ifmt_ldb_d2, { 0xa0800000 }
1560 /* ldh $dr,@($sr) */
1563 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1564 & ifmt_ldh_2, { 0x20a0 }
1566 /* ldh $dr,@($sr,$slo16) */
1569 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1570 & ifmt_ldh_d2, { 0xa0a00000 }
1572 /* ldub $dr,@($sr) */
1575 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1576 & ifmt_ldub_2, { 0x2090 }
1578 /* ldub $dr,@($sr,$slo16) */
1581 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1582 & ifmt_ldub_d2, { 0xa0900000 }
1584 /* lduh $dr,@($sr) */
1587 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1588 & ifmt_lduh_2, { 0x20b0 }
1590 /* lduh $dr,@($sr,$slo16) */
1593 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1594 & ifmt_lduh_d2, { 0xa0b00000 }
1599 { { MNEM, ' ', OP (DR), 0 } },
1600 & ifmt_pop, { 0x20ef }
1602 /* ldi $dr,$simm8 */
1605 { { MNEM, ' ', OP (DR), ',', OP (SIMM8), 0 } },
1606 & ifmt_ldi8a, { 0x6000 }
1608 /* ldi $dr,$hash$slo16 */
1611 { { MNEM, ' ', OP (DR), ',', OP (HASH), OP (SLO16), 0 } },
1612 & ifmt_ldi16a, { 0x90f00000 }
1617 { { MNEM, ' ', OP (ACCD), 0 } },
1618 & ifmt_rac_d, { 0x5090 }
1620 /* rac $accd,$accs */
1623 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), 0 } },
1624 & ifmt_rac_ds, { 0x5090 }
1629 { { MNEM, ' ', OP (ACCD), 0 } },
1630 & ifmt_rach_d, { 0x5080 }
1632 /* rach $accd,$accs */
1635 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), 0 } },
1636 & ifmt_rach_ds, { 0x5080 }
1638 /* st $src1,@($src2) */
1641 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ')', 0 } },
1642 & ifmt_st_2, { 0x2040 }
1644 /* st $src1,@($src2,$slo16) */
1647 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ',', OP (SLO16), ')', 0 } },
1648 & ifmt_st_d2, { 0xa0400000 }
1650 /* stb $src1,@($src2) */
1653 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ')', 0 } },
1654 & ifmt_stb_2, { 0x2000 }
1656 /* stb $src1,@($src2,$slo16) */
1659 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ',', OP (SLO16), ')', 0 } },
1660 & ifmt_stb_d2, { 0xa0000000 }
1662 /* sth $src1,@($src2) */
1665 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ')', 0 } },
1666 & ifmt_sth_2, { 0x2020 }
1668 /* sth $src1,@($src2,$slo16) */
1671 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ',', OP (SLO16), ')', 0 } },
1672 & ifmt_sth_d2, { 0xa0200000 }
1677 { { MNEM, ' ', OP (SRC1), 0 } },
1678 & ifmt_push, { 0x207f }
1687 #ifndef CGEN_ASM_HASH_P
1688 #define CGEN_ASM_HASH_P(insn) 1
1691 #ifndef CGEN_DIS_HASH_P
1692 #define CGEN_DIS_HASH_P(insn) 1
1695 /* Return non-zero if INSN is to be added to the hash table.
1696 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
1699 asm_hash_insn_p (const CGEN_INSN *insn ATTRIBUTE_UNUSED)
1701 return CGEN_ASM_HASH_P (insn);
1705 dis_hash_insn_p (const CGEN_INSN *insn)
1707 /* If building the hash table and the NO-DIS attribute is present,
1709 if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
1711 return CGEN_DIS_HASH_P (insn);
1714 #ifndef CGEN_ASM_HASH
1715 #define CGEN_ASM_HASH_SIZE 127
1716 #ifdef CGEN_MNEMONIC_OPERANDS
1717 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
1719 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
1723 /* It doesn't make much sense to provide a default here,
1724 but while this is under development we do.
1725 BUFFER is a pointer to the bytes of the insn, target order.
1726 VALUE is the first base_insn_bitsize bits as an int in host order. */
1728 #ifndef CGEN_DIS_HASH
1729 #define CGEN_DIS_HASH_SIZE 256
1730 #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
1733 /* The result is the hash value of the insn.
1734 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
1737 asm_hash_insn (const char *mnem)
1739 return CGEN_ASM_HASH (mnem);
1742 /* BUF is a pointer to the bytes of the insn, target order.
1743 VALUE is the first base_insn_bitsize bits as an int in host order. */
1746 dis_hash_insn (const char *buf ATTRIBUTE_UNUSED,
1747 CGEN_INSN_INT value ATTRIBUTE_UNUSED)
1749 return CGEN_DIS_HASH (buf, value);
1752 /* Set the recorded length of the insn in the CGEN_FIELDS struct. */
1755 set_fields_bitsize (CGEN_FIELDS *fields, int size)
1757 CGEN_FIELDS_BITSIZE (fields) = size;
1760 /* Function to call before using the operand instance table.
1761 This plugs the opcode entries and macro instructions into the cpu table. */
1764 m32r_cgen_init_opcode_table (CGEN_CPU_DESC cd)
1767 int num_macros = (sizeof (m32r_cgen_macro_insn_table) /
1768 sizeof (m32r_cgen_macro_insn_table[0]));
1769 const CGEN_IBASE *ib = & m32r_cgen_macro_insn_table[0];
1770 const CGEN_OPCODE *oc = & m32r_cgen_macro_insn_opcode_table[0];
1771 CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
1773 /* This test has been added to avoid a warning generated
1774 if memset is called with a third argument of value zero. */
1775 if (num_macros >= 1)
1776 memset (insns, 0, num_macros * sizeof (CGEN_INSN));
1777 for (i = 0; i < num_macros; ++i)
1779 insns[i].base = &ib[i];
1780 insns[i].opcode = &oc[i];
1781 m32r_cgen_build_insn_regex (& insns[i]);
1783 cd->macro_insn_table.init_entries = insns;
1784 cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
1785 cd->macro_insn_table.num_init_entries = num_macros;
1787 oc = & m32r_cgen_insn_opcode_table[0];
1788 insns = (CGEN_INSN *) cd->insn_table.init_entries;
1789 for (i = 0; i < MAX_INSNS; ++i)
1791 insns[i].opcode = &oc[i];
1792 m32r_cgen_build_insn_regex (& insns[i]);
1795 cd->sizeof_fields = sizeof (CGEN_FIELDS);
1796 cd->set_fields_bitsize = set_fields_bitsize;
1798 cd->asm_hash_p = asm_hash_insn_p;
1799 cd->asm_hash = asm_hash_insn;
1800 cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
1802 cd->dis_hash_p = dis_hash_insn_p;
1803 cd->dis_hash = dis_hash_insn;
1804 cd->dis_hash_size = CGEN_DIS_HASH_SIZE;