1 /* Instruction opcode table for m32r.
3 THIS FILE IS MACHINE GENERATED WITH CGEN.
5 Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
7 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2, or (at your option)
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc.,
21 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 #include "m32r-desc.h"
32 /* The hash functions are recorded here to help keep assembler code out of
33 the disassembler and vice versa. */
35 static int asm_hash_insn_p PARAMS ((const CGEN_INSN *));
36 static unsigned int asm_hash_insn PARAMS ((const char *));
37 static int dis_hash_insn_p PARAMS ((const CGEN_INSN *));
38 static unsigned int dis_hash_insn PARAMS ((const char *, CGEN_INSN_INT));
40 /* Instruction formats. */
42 #define F(f) & m32r_cgen_ifld_table[CONCAT2 (M32R_,f)]
44 static const CGEN_IFMT ifmt_empty = {
48 static const CGEN_IFMT ifmt_add = {
49 16, 16, 0xf0f0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
52 static const CGEN_IFMT ifmt_add3 = {
53 32, 32, 0xf0f00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 }
56 static const CGEN_IFMT ifmt_and3 = {
57 32, 32, 0xf0f00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_UIMM16), 0 }
60 static const CGEN_IFMT ifmt_or3 = {
61 32, 32, 0xf0f00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_UIMM16), 0 }
64 static const CGEN_IFMT ifmt_addi = {
65 16, 16, 0xf000, { F (F_OP1), F (F_R1), F (F_SIMM8), 0 }
68 static const CGEN_IFMT ifmt_addv3 = {
69 32, 32, 0xf0f00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 }
72 static const CGEN_IFMT ifmt_bc8 = {
73 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
76 static const CGEN_IFMT ifmt_bc24 = {
77 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
80 static const CGEN_IFMT ifmt_beq = {
81 32, 32, 0xf0f00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_DISP16), 0 }
84 static const CGEN_IFMT ifmt_beqz = {
85 32, 32, 0xfff00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_DISP16), 0 }
88 static const CGEN_IFMT ifmt_cmp = {
89 16, 16, 0xf0f0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
92 static const CGEN_IFMT ifmt_cmpi = {
93 32, 32, 0xfff00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 }
96 static const CGEN_IFMT ifmt_cmpz = {
97 16, 16, 0xfff0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
100 static const CGEN_IFMT ifmt_div = {
101 32, 32, 0xf0f0ffff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 }
104 static const CGEN_IFMT ifmt_jc = {
105 16, 16, 0xfff0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
108 static const CGEN_IFMT ifmt_ld24 = {
109 32, 32, 0xf0000000, { F (F_OP1), F (F_R1), F (F_UIMM24), 0 }
112 static const CGEN_IFMT ifmt_ldi16 = {
113 32, 32, 0xf0ff0000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 }
116 static const CGEN_IFMT ifmt_machi_a = {
117 16, 16, 0xf070, { F (F_OP1), F (F_R1), F (F_ACC), F (F_OP23), F (F_R2), 0 }
120 static const CGEN_IFMT ifmt_mvfachi = {
121 16, 16, 0xf0ff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
124 static const CGEN_IFMT ifmt_mvfachi_a = {
125 16, 16, 0xf0f3, { F (F_OP1), F (F_R1), F (F_OP2), F (F_ACCS), F (F_OP3), 0 }
128 static const CGEN_IFMT ifmt_mvfc = {
129 16, 16, 0xf0f0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
132 static const CGEN_IFMT ifmt_mvtachi = {
133 16, 16, 0xf0ff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
136 static const CGEN_IFMT ifmt_mvtachi_a = {
137 16, 16, 0xf0f3, { F (F_OP1), F (F_R1), F (F_OP2), F (F_ACCS), F (F_OP3), 0 }
140 static const CGEN_IFMT ifmt_mvtc = {
141 16, 16, 0xf0f0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
144 static const CGEN_IFMT ifmt_nop = {
145 16, 16, 0xffff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
148 static const CGEN_IFMT ifmt_rac_dsi = {
149 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 }
152 static const CGEN_IFMT ifmt_seth = {
153 32, 32, 0xf0ff0000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_HI16), 0 }
156 static const CGEN_IFMT ifmt_slli = {
157 16, 16, 0xf0e0, { F (F_OP1), F (F_R1), F (F_SHIFT_OP2), F (F_UIMM5), 0 }
160 static const CGEN_IFMT ifmt_st_d = {
161 32, 32, 0xf0f00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 }
164 static const CGEN_IFMT ifmt_trap = {
165 16, 16, 0xfff0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_UIMM4), 0 }
168 static const CGEN_IFMT ifmt_satb = {
169 32, 32, 0xf0f0ffff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_UIMM16), 0 }
174 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
175 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
176 #define OPERAND(op) CONCAT2 (M32R_OPERAND_,op)
177 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
179 /* The instruction table. */
181 static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] =
183 /* Special null first entry.
184 A `num' value of zero is thus invalid.
185 Also, the special `invalid' insn resides here. */
190 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
193 /* add3 $dr,$sr,$hash$slo16 */
196 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (HASH), OP (SLO16), 0 } },
197 & ifmt_add3, { 0x80a00000 }
202 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
205 /* and3 $dr,$sr,$uimm16 */
208 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (UIMM16), 0 } },
209 & ifmt_and3, { 0x80c00000 }
214 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
217 /* or3 $dr,$sr,$hash$ulo16 */
220 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (HASH), OP (ULO16), 0 } },
221 & ifmt_or3, { 0x80e00000 }
226 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
229 /* xor3 $dr,$sr,$uimm16 */
232 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (UIMM16), 0 } },
233 & ifmt_and3, { 0x80d00000 }
235 /* addi $dr,$simm8 */
238 { { MNEM, ' ', OP (DR), ',', OP (SIMM8), 0 } },
239 & ifmt_addi, { 0x4000 }
244 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
247 /* addv3 $dr,$sr,$simm16 */
250 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
251 & ifmt_addv3, { 0x80800000 }
256 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
262 { { MNEM, ' ', OP (DISP8), 0 } },
263 & ifmt_bc8, { 0x7c00 }
268 { { MNEM, ' ', OP (DISP24), 0 } },
269 & ifmt_bc24, { 0xfc000000 }
271 /* beq $src1,$src2,$disp16 */
274 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (DISP16), 0 } },
275 & ifmt_beq, { 0xb0000000 }
277 /* beqz $src2,$disp16 */
280 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
281 & ifmt_beqz, { 0xb0800000 }
283 /* bgez $src2,$disp16 */
286 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
287 & ifmt_beqz, { 0xb0b00000 }
289 /* bgtz $src2,$disp16 */
292 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
293 & ifmt_beqz, { 0xb0d00000 }
295 /* blez $src2,$disp16 */
298 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
299 & ifmt_beqz, { 0xb0c00000 }
301 /* bltz $src2,$disp16 */
304 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
305 & ifmt_beqz, { 0xb0a00000 }
307 /* bnez $src2,$disp16 */
310 { { MNEM, ' ', OP (SRC2), ',', OP (DISP16), 0 } },
311 & ifmt_beqz, { 0xb0900000 }
316 { { MNEM, ' ', OP (DISP8), 0 } },
317 & ifmt_bc8, { 0x7e00 }
322 { { MNEM, ' ', OP (DISP24), 0 } },
323 & ifmt_bc24, { 0xfe000000 }
328 { { MNEM, ' ', OP (DISP8), 0 } },
329 & ifmt_bc8, { 0x7800 }
334 { { MNEM, ' ', OP (DISP24), 0 } },
335 & ifmt_bc24, { 0xf8000000 }
340 { { MNEM, ' ', OP (DISP8), 0 } },
341 & ifmt_bc8, { 0x7d00 }
346 { { MNEM, ' ', OP (DISP24), 0 } },
347 & ifmt_bc24, { 0xfd000000 }
349 /* bne $src1,$src2,$disp16 */
352 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (DISP16), 0 } },
353 & ifmt_beq, { 0xb0100000 }
358 { { MNEM, ' ', OP (DISP8), 0 } },
359 & ifmt_bc8, { 0x7f00 }
364 { { MNEM, ' ', OP (DISP24), 0 } },
365 & ifmt_bc24, { 0xff000000 }
370 { { MNEM, ' ', OP (DISP8), 0 } },
371 & ifmt_bc8, { 0x7900 }
376 { { MNEM, ' ', OP (DISP24), 0 } },
377 & ifmt_bc24, { 0xf9000000 }
379 /* cmp $src1,$src2 */
382 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
385 /* cmpi $src2,$simm16 */
388 { { MNEM, ' ', OP (SRC2), ',', OP (SIMM16), 0 } },
389 & ifmt_cmpi, { 0x80400000 }
391 /* cmpu $src1,$src2 */
394 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
397 /* cmpui $src2,$simm16 */
400 { { MNEM, ' ', OP (SRC2), ',', OP (SIMM16), 0 } },
401 & ifmt_cmpi, { 0x80500000 }
403 /* cmpeq $src1,$src2 */
406 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
412 { { MNEM, ' ', OP (SRC2), 0 } },
413 & ifmt_cmpz, { 0x70 }
418 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
419 & ifmt_div, { 0x90000000 }
424 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
425 & ifmt_div, { 0x90100000 }
430 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
431 & ifmt_div, { 0x90200000 }
436 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
437 & ifmt_div, { 0x90300000 }
442 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
443 & ifmt_div, { 0x90000010 }
448 { { MNEM, ' ', OP (SR), 0 } },
449 & ifmt_jc, { 0x1cc0 }
454 { { MNEM, ' ', OP (SR), 0 } },
455 & ifmt_jc, { 0x1dc0 }
460 { { MNEM, ' ', OP (SR), 0 } },
461 & ifmt_jc, { 0x1ec0 }
466 { { MNEM, ' ', OP (SR), 0 } },
467 & ifmt_jc, { 0x1fc0 }
472 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
473 & ifmt_add, { 0x20c0 }
475 /* ld $dr,@($slo16,$sr) */
478 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
479 & ifmt_add3, { 0xa0c00000 }
484 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
485 & ifmt_add, { 0x2080 }
487 /* ldb $dr,@($slo16,$sr) */
490 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
491 & ifmt_add3, { 0xa0800000 }
496 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
497 & ifmt_add, { 0x20a0 }
499 /* ldh $dr,@($slo16,$sr) */
502 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
503 & ifmt_add3, { 0xa0a00000 }
508 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
509 & ifmt_add, { 0x2090 }
511 /* ldub $dr,@($slo16,$sr) */
514 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
515 & ifmt_add3, { 0xa0900000 }
520 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
521 & ifmt_add, { 0x20b0 }
523 /* lduh $dr,@($slo16,$sr) */
526 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SLO16), ',', OP (SR), ')', 0 } },
527 & ifmt_add3, { 0xa0b00000 }
532 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), '+', 0 } },
533 & ifmt_add, { 0x20e0 }
535 /* ld24 $dr,$uimm24 */
538 { { MNEM, ' ', OP (DR), ',', OP (UIMM24), 0 } },
539 & ifmt_ld24, { 0xe0000000 }
541 /* ldi8 $dr,$simm8 */
544 { { MNEM, ' ', OP (DR), ',', OP (SIMM8), 0 } },
545 & ifmt_addi, { 0x6000 }
547 /* ldi16 $dr,$hash$slo16 */
550 { { MNEM, ' ', OP (DR), ',', OP (HASH), OP (SLO16), 0 } },
551 & ifmt_ldi16, { 0x90f00000 }
556 { { MNEM, ' ', OP (DR), ',', '@', OP (SR), 0 } },
557 & ifmt_add, { 0x20d0 }
559 /* machi $src1,$src2 */
562 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
563 & ifmt_cmp, { 0x3040 }
565 /* machi $src1,$src2,$acc */
568 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
569 & ifmt_machi_a, { 0x3040 }
571 /* maclo $src1,$src2 */
574 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
575 & ifmt_cmp, { 0x3050 }
577 /* maclo $src1,$src2,$acc */
580 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
581 & ifmt_machi_a, { 0x3050 }
583 /* macwhi $src1,$src2 */
586 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
587 & ifmt_cmp, { 0x3060 }
589 /* macwhi $src1,$src2,$acc */
592 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
593 & ifmt_machi_a, { 0x3060 }
595 /* macwlo $src1,$src2 */
598 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
599 & ifmt_cmp, { 0x3070 }
601 /* macwlo $src1,$src2,$acc */
604 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
605 & ifmt_machi_a, { 0x3070 }
610 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
611 & ifmt_add, { 0x1060 }
613 /* mulhi $src1,$src2 */
616 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
617 & ifmt_cmp, { 0x3000 }
619 /* mulhi $src1,$src2,$acc */
622 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
623 & ifmt_machi_a, { 0x3000 }
625 /* mullo $src1,$src2 */
628 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
629 & ifmt_cmp, { 0x3010 }
631 /* mullo $src1,$src2,$acc */
634 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
635 & ifmt_machi_a, { 0x3010 }
637 /* mulwhi $src1,$src2 */
640 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
641 & ifmt_cmp, { 0x3020 }
643 /* mulwhi $src1,$src2,$acc */
646 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
647 & ifmt_machi_a, { 0x3020 }
649 /* mulwlo $src1,$src2 */
652 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
653 & ifmt_cmp, { 0x3030 }
655 /* mulwlo $src1,$src2,$acc */
658 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } },
659 & ifmt_machi_a, { 0x3030 }
664 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
665 & ifmt_add, { 0x1080 }
670 { { MNEM, ' ', OP (DR), 0 } },
671 & ifmt_mvfachi, { 0x50f0 }
673 /* mvfachi $dr,$accs */
676 { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } },
677 & ifmt_mvfachi_a, { 0x50f0 }
682 { { MNEM, ' ', OP (DR), 0 } },
683 & ifmt_mvfachi, { 0x50f1 }
685 /* mvfaclo $dr,$accs */
688 { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } },
689 & ifmt_mvfachi_a, { 0x50f1 }
694 { { MNEM, ' ', OP (DR), 0 } },
695 & ifmt_mvfachi, { 0x50f2 }
697 /* mvfacmi $dr,$accs */
700 { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } },
701 & ifmt_mvfachi_a, { 0x50f2 }
706 { { MNEM, ' ', OP (DR), ',', OP (SCR), 0 } },
707 & ifmt_mvfc, { 0x1090 }
712 { { MNEM, ' ', OP (SRC1), 0 } },
713 & ifmt_mvtachi, { 0x5070 }
715 /* mvtachi $src1,$accs */
718 { { MNEM, ' ', OP (SRC1), ',', OP (ACCS), 0 } },
719 & ifmt_mvtachi_a, { 0x5070 }
724 { { MNEM, ' ', OP (SRC1), 0 } },
725 & ifmt_mvtachi, { 0x5071 }
727 /* mvtaclo $src1,$accs */
730 { { MNEM, ' ', OP (SRC1), ',', OP (ACCS), 0 } },
731 & ifmt_mvtachi_a, { 0x5071 }
736 { { MNEM, ' ', OP (SR), ',', OP (DCR), 0 } },
737 & ifmt_mvtc, { 0x10a0 }
742 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
749 & ifmt_nop, { 0x7000 }
754 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
761 & ifmt_nop, { 0x5090 }
763 /* rac $accd,$accs,$imm1 */
766 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), ',', OP (IMM1), 0 } },
767 & ifmt_rac_dsi, { 0x5090 }
773 & ifmt_nop, { 0x5080 }
775 /* rach $accd,$accs,$imm1 */
778 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), ',', OP (IMM1), 0 } },
779 & ifmt_rac_dsi, { 0x5080 }
785 & ifmt_nop, { 0x10d6 }
787 /* seth $dr,$hash$hi16 */
790 { { MNEM, ' ', OP (DR), ',', OP (HASH), OP (HI16), 0 } },
791 & ifmt_seth, { 0xd0c00000 }
796 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
797 & ifmt_add, { 0x1040 }
799 /* sll3 $dr,$sr,$simm16 */
802 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
803 & ifmt_addv3, { 0x90c00000 }
805 /* slli $dr,$uimm5 */
808 { { MNEM, ' ', OP (DR), ',', OP (UIMM5), 0 } },
809 & ifmt_slli, { 0x5040 }
814 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
815 & ifmt_add, { 0x1020 }
817 /* sra3 $dr,$sr,$simm16 */
820 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
821 & ifmt_addv3, { 0x90a00000 }
823 /* srai $dr,$uimm5 */
826 { { MNEM, ' ', OP (DR), ',', OP (UIMM5), 0 } },
827 & ifmt_slli, { 0x5020 }
832 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
833 & ifmt_add, { 0x1000 }
835 /* srl3 $dr,$sr,$simm16 */
838 { { MNEM, ' ', OP (DR), ',', OP (SR), ',', OP (SIMM16), 0 } },
839 & ifmt_addv3, { 0x90800000 }
841 /* srli $dr,$uimm5 */
844 { { MNEM, ' ', OP (DR), ',', OP (UIMM5), 0 } },
845 & ifmt_slli, { 0x5000 }
847 /* st $src1,@$src2 */
850 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
851 & ifmt_cmp, { 0x2040 }
853 /* st $src1,@($slo16,$src2) */
856 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SLO16), ',', OP (SRC2), ')', 0 } },
857 & ifmt_st_d, { 0xa0400000 }
859 /* stb $src1,@$src2 */
862 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
863 & ifmt_cmp, { 0x2000 }
865 /* stb $src1,@($slo16,$src2) */
868 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SLO16), ',', OP (SRC2), ')', 0 } },
869 & ifmt_st_d, { 0xa0000000 }
871 /* sth $src1,@$src2 */
874 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
875 & ifmt_cmp, { 0x2020 }
877 /* sth $src1,@($slo16,$src2) */
880 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SLO16), ',', OP (SRC2), ')', 0 } },
881 & ifmt_st_d, { 0xa0200000 }
883 /* st $src1,@+$src2 */
886 { { MNEM, ' ', OP (SRC1), ',', '@', '+', OP (SRC2), 0 } },
887 & ifmt_cmp, { 0x2060 }
889 /* st $src1,@-$src2 */
892 { { MNEM, ' ', OP (SRC1), ',', '@', '-', OP (SRC2), 0 } },
893 & ifmt_cmp, { 0x2070 }
898 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
904 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
910 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
916 { { MNEM, ' ', OP (UIMM4), 0 } },
917 & ifmt_trap, { 0x10f0 }
919 /* unlock $src1,@$src2 */
922 { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } },
923 & ifmt_cmp, { 0x2050 }
928 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
929 & ifmt_satb, { 0x80600300 }
934 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
935 & ifmt_satb, { 0x80600200 }
940 { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } },
941 & ifmt_satb, { 0x80600000 }
946 { { MNEM, ' ', OP (SRC2), 0 } },
947 & ifmt_cmpz, { 0x370 }
953 & ifmt_nop, { 0x50e4 }
955 /* macwu1 $src1,$src2 */
958 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
959 & ifmt_cmp, { 0x50b0 }
961 /* msblo $src1,$src2 */
964 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
965 & ifmt_cmp, { 0x50d0 }
967 /* mulwu1 $src1,$src2 */
970 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
971 & ifmt_cmp, { 0x50a0 }
973 /* maclh1 $src1,$src2 */
976 { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } },
977 & ifmt_cmp, { 0x50c0 }
983 & ifmt_nop, { 0x7401 }
989 & ifmt_nop, { 0x7501 }
998 /* Formats for ALIAS macro-insns. */
1000 #define F(f) & m32r_cgen_ifld_table[CONCAT2 (M32R_,f)]
1002 static const CGEN_IFMT ifmt_bc8r = {
1003 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
1006 static const CGEN_IFMT ifmt_bc24r = {
1007 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
1010 static const CGEN_IFMT ifmt_bl8r = {
1011 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
1014 static const CGEN_IFMT ifmt_bl24r = {
1015 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
1018 static const CGEN_IFMT ifmt_bcl8r = {
1019 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
1022 static const CGEN_IFMT ifmt_bcl24r = {
1023 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
1026 static const CGEN_IFMT ifmt_bnc8r = {
1027 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
1030 static const CGEN_IFMT ifmt_bnc24r = {
1031 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
1034 static const CGEN_IFMT ifmt_bra8r = {
1035 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
1038 static const CGEN_IFMT ifmt_bra24r = {
1039 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
1042 static const CGEN_IFMT ifmt_bncl8r = {
1043 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 }
1046 static const CGEN_IFMT ifmt_bncl24r = {
1047 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 }
1050 static const CGEN_IFMT ifmt_ld_2 = {
1051 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1054 static const CGEN_IFMT ifmt_ld_d2 = {
1055 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1058 static const CGEN_IFMT ifmt_ldb_2 = {
1059 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1062 static const CGEN_IFMT ifmt_ldb_d2 = {
1063 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1066 static const CGEN_IFMT ifmt_ldh_2 = {
1067 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1070 static const CGEN_IFMT ifmt_ldh_d2 = {
1071 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1074 static const CGEN_IFMT ifmt_ldub_2 = {
1075 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1078 static const CGEN_IFMT ifmt_ldub_d2 = {
1079 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1082 static const CGEN_IFMT ifmt_lduh_2 = {
1083 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1086 static const CGEN_IFMT ifmt_lduh_d2 = {
1087 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1090 static const CGEN_IFMT ifmt_pop = {
1091 16, 16, 0xf0ff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 }
1094 static const CGEN_IFMT ifmt_ldi8a = {
1095 16, 16, 0xf000, { F (F_OP1), F (F_R1), F (F_SIMM8), 0 }
1098 static const CGEN_IFMT ifmt_ldi16a = {
1099 32, 32, 0xf0ff0000, { F (F_OP1), F (F_OP2), F (F_R2), F (F_R1), F (F_SIMM16), 0 }
1102 static const CGEN_IFMT ifmt_rac_d = {
1103 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 }
1106 static const CGEN_IFMT ifmt_rac_ds = {
1107 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 }
1110 static const CGEN_IFMT ifmt_rach_d = {
1111 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 }
1114 static const CGEN_IFMT ifmt_rach_ds = {
1115 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 }
1118 static const CGEN_IFMT ifmt_st_2 = {
1119 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1122 static const CGEN_IFMT ifmt_st_d2 = {
1123 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1126 static const CGEN_IFMT ifmt_stb_2 = {
1127 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1130 static const CGEN_IFMT ifmt_stb_d2 = {
1131 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1134 static const CGEN_IFMT ifmt_sth_2 = {
1135 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1138 static const CGEN_IFMT ifmt_sth_d2 = {
1139 32, 32, 0xf0f00000, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), F (F_SIMM16), 0 }
1142 static const CGEN_IFMT ifmt_push = {
1143 16, 16, 0xf0ff, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 }
1148 /* Each non-simple macro entry points to an array of expansion possibilities. */
1150 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
1151 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1152 #define OPERAND(op) CONCAT2 (M32R_OPERAND_,op)
1153 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1155 /* The macro instruction table. */
1157 static const CGEN_IBASE m32r_cgen_macro_insn_table[] =
1161 -1, "bc8r", "bc", 16,
1162 { 0|A(RELAXABLE)|A(COND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1166 -1, "bc24r", "bc", 32,
1167 { 0|A(RELAX)|A(COND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1171 -1, "bl8r", "bl", 16,
1172 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(UNCOND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1176 -1, "bl24r", "bl", 32,
1177 { 0|A(RELAX)|A(UNCOND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1181 -1, "bcl8r", "bcl", 16,
1182 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(COND_CTI)|A(ALIAS), { (1<<MACH_M32RX), PIPE_O } }
1186 -1, "bcl24r", "bcl", 32,
1187 { 0|A(RELAX)|A(COND_CTI)|A(ALIAS), { (1<<MACH_M32RX), PIPE_NONE } }
1191 -1, "bnc8r", "bnc", 16,
1192 { 0|A(RELAXABLE)|A(COND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1196 -1, "bnc24r", "bnc", 32,
1197 { 0|A(RELAX)|A(COND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1201 -1, "bra8r", "bra", 16,
1202 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(UNCOND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1206 -1, "bra24r", "bra", 32,
1207 { 0|A(RELAX)|A(UNCOND_CTI)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1211 -1, "bncl8r", "bncl", 16,
1212 { 0|A(RELAXABLE)|A(FILL_SLOT)|A(COND_CTI)|A(ALIAS), { (1<<MACH_M32RX), PIPE_O } }
1216 -1, "bncl24r", "bncl", 32,
1217 { 0|A(RELAX)|A(COND_CTI)|A(ALIAS), { (1<<MACH_M32RX), PIPE_NONE } }
1221 -1, "ld-2", "ld", 16,
1222 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1224 /* ld $dr,@($sr,$slo16) */
1226 -1, "ld-d2", "ld", 32,
1227 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1229 /* ldb $dr,@($sr) */
1231 -1, "ldb-2", "ldb", 16,
1232 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1234 /* ldb $dr,@($sr,$slo16) */
1236 -1, "ldb-d2", "ldb", 32,
1237 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1239 /* ldh $dr,@($sr) */
1241 -1, "ldh-2", "ldh", 16,
1242 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1244 /* ldh $dr,@($sr,$slo16) */
1246 -1, "ldh-d2", "ldh", 32,
1247 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1249 /* ldub $dr,@($sr) */
1251 -1, "ldub-2", "ldub", 16,
1252 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1254 /* ldub $dr,@($sr,$slo16) */
1256 -1, "ldub-d2", "ldub", 32,
1257 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1259 /* lduh $dr,@($sr) */
1261 -1, "lduh-2", "lduh", 16,
1262 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1264 /* lduh $dr,@($sr,$slo16) */
1266 -1, "lduh-d2", "lduh", 32,
1267 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1271 -1, "pop", "pop", 16,
1272 { 0|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1274 /* ldi $dr,$simm8 */
1276 -1, "ldi8a", "ldi", 16,
1277 { 0|A(ALIAS), { (1<<MACH_BASE), PIPE_OS } }
1279 /* ldi $dr,$hash$slo16 */
1281 -1, "ldi16a", "ldi", 32,
1282 { 0|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1286 -1, "rac-d", "rac", 16,
1287 { 0|A(ALIAS), { (1<<MACH_M32RX), PIPE_S } }
1289 /* rac $accd,$accs */
1291 -1, "rac-ds", "rac", 16,
1292 { 0|A(ALIAS), { (1<<MACH_M32RX), PIPE_S } }
1296 -1, "rach-d", "rach", 16,
1297 { 0|A(ALIAS), { (1<<MACH_M32RX), PIPE_S } }
1299 /* rach $accd,$accs */
1301 -1, "rach-ds", "rach", 16,
1302 { 0|A(ALIAS), { (1<<MACH_M32RX), PIPE_S } }
1304 /* st $src1,@($src2) */
1306 -1, "st-2", "st", 16,
1307 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1309 /* st $src1,@($src2,$slo16) */
1311 -1, "st-d2", "st", 32,
1312 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1314 /* stb $src1,@($src2) */
1316 -1, "stb-2", "stb", 16,
1317 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1319 /* stb $src1,@($src2,$slo16) */
1321 -1, "stb-d2", "stb", 32,
1322 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1324 /* sth $src1,@($src2) */
1326 -1, "sth-2", "sth", 16,
1327 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_O } }
1329 /* sth $src1,@($src2,$slo16) */
1331 -1, "sth-d2", "sth", 32,
1332 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1336 -1, "push", "push", 16,
1337 { 0|A(ALIAS), { (1<<MACH_BASE), PIPE_NONE } }
1341 /* The macro instruction opcode table. */
1343 static const CGEN_OPCODE m32r_cgen_macro_insn_opcode_table[] =
1348 { { MNEM, ' ', OP (DISP8), 0 } },
1349 & ifmt_bc8r, { 0x7c00 }
1354 { { MNEM, ' ', OP (DISP24), 0 } },
1355 & ifmt_bc24r, { 0xfc000000 }
1360 { { MNEM, ' ', OP (DISP8), 0 } },
1361 & ifmt_bl8r, { 0x7e00 }
1366 { { MNEM, ' ', OP (DISP24), 0 } },
1367 & ifmt_bl24r, { 0xfe000000 }
1372 { { MNEM, ' ', OP (DISP8), 0 } },
1373 & ifmt_bcl8r, { 0x7800 }
1378 { { MNEM, ' ', OP (DISP24), 0 } },
1379 & ifmt_bcl24r, { 0xf8000000 }
1384 { { MNEM, ' ', OP (DISP8), 0 } },
1385 & ifmt_bnc8r, { 0x7d00 }
1390 { { MNEM, ' ', OP (DISP24), 0 } },
1391 & ifmt_bnc24r, { 0xfd000000 }
1396 { { MNEM, ' ', OP (DISP8), 0 } },
1397 & ifmt_bra8r, { 0x7f00 }
1402 { { MNEM, ' ', OP (DISP24), 0 } },
1403 & ifmt_bra24r, { 0xff000000 }
1408 { { MNEM, ' ', OP (DISP8), 0 } },
1409 & ifmt_bncl8r, { 0x7900 }
1414 { { MNEM, ' ', OP (DISP24), 0 } },
1415 & ifmt_bncl24r, { 0xf9000000 }
1420 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1421 & ifmt_ld_2, { 0x20c0 }
1423 /* ld $dr,@($sr,$slo16) */
1426 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1427 & ifmt_ld_d2, { 0xa0c00000 }
1429 /* ldb $dr,@($sr) */
1432 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1433 & ifmt_ldb_2, { 0x2080 }
1435 /* ldb $dr,@($sr,$slo16) */
1438 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1439 & ifmt_ldb_d2, { 0xa0800000 }
1441 /* ldh $dr,@($sr) */
1444 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1445 & ifmt_ldh_2, { 0x20a0 }
1447 /* ldh $dr,@($sr,$slo16) */
1450 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1451 & ifmt_ldh_d2, { 0xa0a00000 }
1453 /* ldub $dr,@($sr) */
1456 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1457 & ifmt_ldub_2, { 0x2090 }
1459 /* ldub $dr,@($sr,$slo16) */
1462 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1463 & ifmt_ldub_d2, { 0xa0900000 }
1465 /* lduh $dr,@($sr) */
1468 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ')', 0 } },
1469 & ifmt_lduh_2, { 0x20b0 }
1471 /* lduh $dr,@($sr,$slo16) */
1474 { { MNEM, ' ', OP (DR), ',', '@', '(', OP (SR), ',', OP (SLO16), ')', 0 } },
1475 & ifmt_lduh_d2, { 0xa0b00000 }
1480 { { MNEM, ' ', OP (DR), 0 } },
1481 & ifmt_pop, { 0x20ef }
1483 /* ldi $dr,$simm8 */
1486 { { MNEM, ' ', OP (DR), ',', OP (SIMM8), 0 } },
1487 & ifmt_ldi8a, { 0x6000 }
1489 /* ldi $dr,$hash$slo16 */
1492 { { MNEM, ' ', OP (DR), ',', OP (HASH), OP (SLO16), 0 } },
1493 & ifmt_ldi16a, { 0x90f00000 }
1498 { { MNEM, ' ', OP (ACCD), 0 } },
1499 & ifmt_rac_d, { 0x5090 }
1501 /* rac $accd,$accs */
1504 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), 0 } },
1505 & ifmt_rac_ds, { 0x5090 }
1510 { { MNEM, ' ', OP (ACCD), 0 } },
1511 & ifmt_rach_d, { 0x5080 }
1513 /* rach $accd,$accs */
1516 { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), 0 } },
1517 & ifmt_rach_ds, { 0x5080 }
1519 /* st $src1,@($src2) */
1522 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ')', 0 } },
1523 & ifmt_st_2, { 0x2040 }
1525 /* st $src1,@($src2,$slo16) */
1528 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ',', OP (SLO16), ')', 0 } },
1529 & ifmt_st_d2, { 0xa0400000 }
1531 /* stb $src1,@($src2) */
1534 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ')', 0 } },
1535 & ifmt_stb_2, { 0x2000 }
1537 /* stb $src1,@($src2,$slo16) */
1540 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ',', OP (SLO16), ')', 0 } },
1541 & ifmt_stb_d2, { 0xa0000000 }
1543 /* sth $src1,@($src2) */
1546 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ')', 0 } },
1547 & ifmt_sth_2, { 0x2020 }
1549 /* sth $src1,@($src2,$slo16) */
1552 { { MNEM, ' ', OP (SRC1), ',', '@', '(', OP (SRC2), ',', OP (SLO16), ')', 0 } },
1553 & ifmt_sth_d2, { 0xa0200000 }
1558 { { MNEM, ' ', OP (SRC1), 0 } },
1559 & ifmt_push, { 0x207f }
1568 #ifndef CGEN_ASM_HASH_P
1569 #define CGEN_ASM_HASH_P(insn) 1
1572 #ifndef CGEN_DIS_HASH_P
1573 #define CGEN_DIS_HASH_P(insn) 1
1576 /* Return non-zero if INSN is to be added to the hash table.
1577 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
1580 asm_hash_insn_p (insn)
1581 const CGEN_INSN *insn;
1583 return CGEN_ASM_HASH_P (insn);
1587 dis_hash_insn_p (insn)
1588 const CGEN_INSN *insn;
1590 /* If building the hash table and the NO-DIS attribute is present,
1592 if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
1594 return CGEN_DIS_HASH_P (insn);
1597 #ifndef CGEN_ASM_HASH
1598 #define CGEN_ASM_HASH_SIZE 127
1599 #ifdef CGEN_MNEMONIC_OPERANDS
1600 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
1602 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
1606 /* It doesn't make much sense to provide a default here,
1607 but while this is under development we do.
1608 BUFFER is a pointer to the bytes of the insn, target order.
1609 VALUE is the first base_insn_bitsize bits as an int in host order. */
1611 #ifndef CGEN_DIS_HASH
1612 #define CGEN_DIS_HASH_SIZE 256
1613 #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
1616 /* The result is the hash value of the insn.
1617 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
1620 asm_hash_insn (mnem)
1623 return CGEN_ASM_HASH (mnem);
1626 /* BUF is a pointer to the bytes of the insn, target order.
1627 VALUE is the first base_insn_bitsize bits as an int in host order. */
1630 dis_hash_insn (buf, value)
1632 CGEN_INSN_INT value;
1634 return CGEN_DIS_HASH (buf, value);
1637 /* Set the recorded length of the insn in the CGEN_FIELDS struct. */
1640 set_fields_bitsize (fields, size)
1641 CGEN_FIELDS *fields;
1644 CGEN_FIELDS_BITSIZE (fields) = size;
1647 /* Function to call before using the operand instance table.
1648 This plugs the opcode entries and macro instructions into the cpu table. */
1651 m32r_cgen_init_opcode_table (cd)
1655 int num_macros = (sizeof (m32r_cgen_macro_insn_table) /
1656 sizeof (m32r_cgen_macro_insn_table[0]));
1657 const CGEN_IBASE *ib = & m32r_cgen_macro_insn_table[0];
1658 const CGEN_OPCODE *oc = & m32r_cgen_macro_insn_opcode_table[0];
1659 CGEN_INSN *insns = (CGEN_INSN *) xmalloc (num_macros * sizeof (CGEN_INSN));
1660 memset (insns, 0, num_macros * sizeof (CGEN_INSN));
1661 for (i = 0; i < num_macros; ++i)
1663 insns[i].base = &ib[i];
1664 insns[i].opcode = &oc[i];
1666 cd->macro_insn_table.init_entries = insns;
1667 cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
1668 cd->macro_insn_table.num_init_entries = num_macros;
1670 oc = & m32r_cgen_insn_opcode_table[0];
1671 insns = (CGEN_INSN *) cd->insn_table.init_entries;
1672 for (i = 0; i < MAX_INSNS; ++i)
1673 insns[i].opcode = &oc[i];
1675 cd->sizeof_fields = sizeof (CGEN_FIELDS);
1676 cd->set_fields_bitsize = set_fields_bitsize;
1678 cd->asm_hash_p = asm_hash_insn_p;
1679 cd->asm_hash = asm_hash_insn;
1680 cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
1682 cd->dis_hash_p = dis_hash_insn_p;
1683 cd->dis_hash = dis_hash_insn;
1684 cd->dis_hash_size = CGEN_DIS_HASH_SIZE;