1 /* Instruction opcode table for fr30.
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 "fr30-desc.h"
31 #include "libiberty.h"
33 /* The hash functions are recorded here to help keep assembler code out of
34 the disassembler and vice versa. */
36 static int asm_hash_insn_p PARAMS ((const CGEN_INSN *));
37 static unsigned int asm_hash_insn PARAMS ((const char *));
38 static int dis_hash_insn_p PARAMS ((const CGEN_INSN *));
39 static unsigned int dis_hash_insn PARAMS ((const char *, CGEN_INSN_INT));
41 /* Instruction formats. */
43 #define F(f) & fr30_cgen_ifld_table[CONCAT2 (FR30_,f)]
45 static const CGEN_IFMT ifmt_empty = {
49 static const CGEN_IFMT ifmt_add = {
50 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_RJ) }, { F (F_RI) }, { 0 } }
53 static const CGEN_IFMT ifmt_addi = {
54 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_U4) }, { F (F_RI) }, { 0 } }
57 static const CGEN_IFMT ifmt_add2 = {
58 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_M4) }, { F (F_RI) }, { 0 } }
61 static const CGEN_IFMT ifmt_div0s = {
62 16, 16, 0xfff0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RI) }, { 0 } }
65 static const CGEN_IFMT ifmt_div3 = {
66 16, 16, 0xffff, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_OP4) }, { 0 } }
69 static const CGEN_IFMT ifmt_ldi8 = {
70 16, 16, 0xf000, { { F (F_OP1) }, { F (F_I8) }, { F (F_RI) }, { 0 } }
73 static const CGEN_IFMT ifmt_ldi20 = {
74 16, 32, 0xff00, { { F (F_OP1) }, { F (F_I20) }, { F (F_OP2) }, { F (F_RI) }, { 0 } }
77 static const CGEN_IFMT ifmt_ldi32 = {
78 16, 48, 0xfff0, { { F (F_OP1) }, { F (F_I32) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RI) }, { 0 } }
81 static const CGEN_IFMT ifmt_ldr14 = {
82 16, 16, 0xf000, { { F (F_OP1) }, { F (F_DISP10) }, { F (F_RI) }, { 0 } }
85 static const CGEN_IFMT ifmt_ldr14uh = {
86 16, 16, 0xf000, { { F (F_OP1) }, { F (F_DISP9) }, { F (F_RI) }, { 0 } }
89 static const CGEN_IFMT ifmt_ldr14ub = {
90 16, 16, 0xf000, { { F (F_OP1) }, { F (F_DISP8) }, { F (F_RI) }, { 0 } }
93 static const CGEN_IFMT ifmt_ldr15 = {
94 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_UDISP6) }, { F (F_RI) }, { 0 } }
97 static const CGEN_IFMT ifmt_ldr15dr = {
98 16, 16, 0xfff0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RS2) }, { 0 } }
101 static const CGEN_IFMT ifmt_movdr = {
102 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_RS1) }, { F (F_RI) }, { 0 } }
105 static const CGEN_IFMT ifmt_call = {
106 16, 16, 0xf800, { { F (F_OP1) }, { F (F_OP5) }, { F (F_REL12) }, { 0 } }
109 static const CGEN_IFMT ifmt_int = {
110 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_U8) }, { 0 } }
113 static const CGEN_IFMT ifmt_brad = {
114 16, 16, 0xff00, { { F (F_OP1) }, { F (F_CC) }, { F (F_REL9) }, { 0 } }
117 static const CGEN_IFMT ifmt_dmovr13 = {
118 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_DIR10) }, { 0 } }
121 static const CGEN_IFMT ifmt_dmovr13h = {
122 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_DIR9) }, { 0 } }
125 static const CGEN_IFMT ifmt_dmovr13b = {
126 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_DIR8) }, { 0 } }
129 static const CGEN_IFMT ifmt_copop = {
130 16, 32, 0xfff0, { { F (F_OP1) }, { F (F_CCC) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_CRJ) }, { F (F_U4C) }, { F (F_CRI) }, { 0 } }
133 static const CGEN_IFMT ifmt_copld = {
134 16, 32, 0xfff0, { { F (F_OP1) }, { F (F_CCC) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RJC) }, { F (F_U4C) }, { F (F_CRI) }, { 0 } }
137 static const CGEN_IFMT ifmt_copst = {
138 16, 32, 0xfff0, { { F (F_OP1) }, { F (F_CCC) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_CRJ) }, { F (F_U4C) }, { F (F_RIC) }, { 0 } }
141 static const CGEN_IFMT ifmt_addsp = {
142 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_S10) }, { 0 } }
145 static const CGEN_IFMT ifmt_ldm0 = {
146 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_REGLIST_LOW_LD) }, { 0 } }
149 static const CGEN_IFMT ifmt_ldm1 = {
150 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_REGLIST_HI_LD) }, { 0 } }
153 static const CGEN_IFMT ifmt_stm0 = {
154 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_REGLIST_LOW_ST) }, { 0 } }
157 static const CGEN_IFMT ifmt_stm1 = {
158 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_REGLIST_HI_ST) }, { 0 } }
161 static const CGEN_IFMT ifmt_enter = {
162 16, 16, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_U10) }, { 0 } }
167 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
168 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
169 #define OPERAND(op) CONCAT2 (FR30_OPERAND_,op)
170 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
172 /* The instruction table. */
174 static const CGEN_OPCODE fr30_cgen_insn_opcode_table[MAX_INSNS] =
176 /* Special null first entry.
177 A `num' value of zero is thus invalid.
178 Also, the special `invalid' insn resides here. */
179 { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
183 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
184 & ifmt_add, { 0xa600 }
189 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
190 & ifmt_addi, { 0xa400 }
195 { { MNEM, ' ', OP (M4), ',', OP (RI), 0 } },
196 & ifmt_add2, { 0xa500 }
201 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
202 & ifmt_add, { 0xa700 }
207 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
208 & ifmt_add, { 0xa200 }
213 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
214 & ifmt_addi, { 0xa000 }
219 { { MNEM, ' ', OP (M4), ',', OP (RI), 0 } },
220 & ifmt_add2, { 0xa100 }
225 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
226 & ifmt_add, { 0xac00 }
231 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
232 & ifmt_add, { 0xad00 }
237 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
238 & ifmt_add, { 0xae00 }
243 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
244 & ifmt_add, { 0xaa00 }
249 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
250 & ifmt_addi, { 0xa800 }
255 { { MNEM, ' ', OP (M4), ',', OP (RI), 0 } },
256 & ifmt_add2, { 0xa900 }
261 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
262 & ifmt_add, { 0x8200 }
267 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
268 & ifmt_add, { 0x9200 }
273 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
274 & ifmt_add, { 0x9a00 }
279 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
280 & ifmt_add, { 0x8400 }
285 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
286 & ifmt_add, { 0x8500 }
291 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
292 & ifmt_add, { 0x8600 }
297 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
298 & ifmt_add, { 0x9400 }
303 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
304 & ifmt_add, { 0x9500 }
309 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
310 & ifmt_add, { 0x9600 }
315 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
316 & ifmt_add, { 0x9c00 }
321 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
322 & ifmt_add, { 0x9d00 }
327 { { MNEM, ' ', OP (RJ), ',', '@', OP (RI), 0 } },
328 & ifmt_add, { 0x9e00 }
333 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
334 & ifmt_addi, { 0x8000 }
339 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
340 & ifmt_addi, { 0x9000 }
345 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
346 & ifmt_addi, { 0x9800 }
351 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
352 & ifmt_addi, { 0x8100 }
357 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
358 & ifmt_addi, { 0x9100 }
363 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
364 & ifmt_addi, { 0x9900 }
369 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
370 & ifmt_addi, { 0x8800 }
375 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), 0 } },
376 & ifmt_addi, { 0x8900 }
381 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
382 & ifmt_add, { 0xaf00 }
387 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
388 & ifmt_add, { 0xab00 }
393 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
394 & ifmt_add, { 0xbf00 }
399 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
400 & ifmt_add, { 0xbb00 }
405 { { MNEM, ' ', OP (RI), 0 } },
406 & ifmt_div0s, { 0x9740 }
411 { { MNEM, ' ', OP (RI), 0 } },
412 & ifmt_div0s, { 0x9750 }
417 { { MNEM, ' ', OP (RI), 0 } },
418 & ifmt_div0s, { 0x9760 }
423 { { MNEM, ' ', OP (RI), 0 } },
424 & ifmt_div0s, { 0x9770 }
430 & ifmt_div3, { 0x9f60 }
436 & ifmt_div3, { 0x9f70 }
441 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
442 & ifmt_add, { 0xb600 }
447 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
448 & ifmt_addi, { 0xb400 }
453 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
454 & ifmt_addi, { 0xb500 }
459 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
460 & ifmt_add, { 0xb200 }
465 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
466 & ifmt_addi, { 0xb000 }
471 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
472 & ifmt_addi, { 0xb100 }
477 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
478 & ifmt_add, { 0xba00 }
483 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
484 & ifmt_addi, { 0xb800 }
489 { { MNEM, ' ', OP (U4), ',', OP (RI), 0 } },
490 & ifmt_addi, { 0xb900 }
495 { { MNEM, ' ', OP (I8), ',', OP (RI), 0 } },
496 & ifmt_ldi8, { 0xc000 }
498 /* ldi:20 $i20,$Ri */
501 { { MNEM, ' ', OP (I20), ',', OP (RI), 0 } },
502 & ifmt_ldi20, { 0x9b00 }
504 /* ldi:32 $i32,$Ri */
507 { { MNEM, ' ', OP (I32), ',', OP (RI), 0 } },
508 & ifmt_ldi32, { 0x9f80 }
513 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
514 & ifmt_add, { 0x400 }
519 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
520 & ifmt_add, { 0x500 }
525 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
526 & ifmt_add, { 0x600 }
528 /* ld @($R13,$Rj),$Ri */
531 { { MNEM, ' ', '@', '(', OP (R13), ',', OP (RJ), ')', ',', OP (RI), 0 } },
534 /* lduh @($R13,$Rj),$Ri */
537 { { MNEM, ' ', '@', '(', OP (R13), ',', OP (RJ), ')', ',', OP (RI), 0 } },
538 & ifmt_add, { 0x100 }
540 /* ldub @($R13,$Rj),$Ri */
543 { { MNEM, ' ', '@', '(', OP (R13), ',', OP (RJ), ')', ',', OP (RI), 0 } },
544 & ifmt_add, { 0x200 }
546 /* ld @($R14,$disp10),$Ri */
549 { { MNEM, ' ', '@', '(', OP (R14), ',', OP (DISP10), ')', ',', OP (RI), 0 } },
550 & ifmt_ldr14, { 0x2000 }
552 /* lduh @($R14,$disp9),$Ri */
555 { { MNEM, ' ', '@', '(', OP (R14), ',', OP (DISP9), ')', ',', OP (RI), 0 } },
556 & ifmt_ldr14uh, { 0x4000 }
558 /* ldub @($R14,$disp8),$Ri */
561 { { MNEM, ' ', '@', '(', OP (R14), ',', OP (DISP8), ')', ',', OP (RI), 0 } },
562 & ifmt_ldr14ub, { 0x6000 }
564 /* ld @($R15,$udisp6),$Ri */
567 { { MNEM, ' ', '@', '(', OP (R15), ',', OP (UDISP6), ')', ',', OP (RI), 0 } },
568 & ifmt_ldr15, { 0x300 }
573 { { MNEM, ' ', '@', OP (R15), '+', ',', OP (RI), 0 } },
574 & ifmt_div0s, { 0x700 }
579 { { MNEM, ' ', '@', OP (R15), '+', ',', OP (RS2), 0 } },
580 & ifmt_ldr15dr, { 0x780 }
585 { { MNEM, ' ', '@', OP (R15), '+', ',', OP (PS), 0 } },
586 & ifmt_div3, { 0x790 }
591 { { MNEM, ' ', OP (RI), ',', '@', OP (RJ), 0 } },
592 & ifmt_add, { 0x1400 }
597 { { MNEM, ' ', OP (RI), ',', '@', OP (RJ), 0 } },
598 & ifmt_add, { 0x1500 }
603 { { MNEM, ' ', OP (RI), ',', '@', OP (RJ), 0 } },
604 & ifmt_add, { 0x1600 }
606 /* st $Ri,@($R13,$Rj) */
609 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R13), ',', OP (RJ), ')', 0 } },
610 & ifmt_add, { 0x1000 }
612 /* sth $Ri,@($R13,$Rj) */
615 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R13), ',', OP (RJ), ')', 0 } },
616 & ifmt_add, { 0x1100 }
618 /* stb $Ri,@($R13,$Rj) */
621 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R13), ',', OP (RJ), ')', 0 } },
622 & ifmt_add, { 0x1200 }
624 /* st $Ri,@($R14,$disp10) */
627 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R14), ',', OP (DISP10), ')', 0 } },
628 & ifmt_ldr14, { 0x3000 }
630 /* sth $Ri,@($R14,$disp9) */
633 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R14), ',', OP (DISP9), ')', 0 } },
634 & ifmt_ldr14uh, { 0x5000 }
636 /* stb $Ri,@($R14,$disp8) */
639 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R14), ',', OP (DISP8), ')', 0 } },
640 & ifmt_ldr14ub, { 0x7000 }
642 /* st $Ri,@($R15,$udisp6) */
645 { { MNEM, ' ', OP (RI), ',', '@', '(', OP (R15), ',', OP (UDISP6), ')', 0 } },
646 & ifmt_ldr15, { 0x1300 }
651 { { MNEM, ' ', OP (RI), ',', '@', '-', OP (R15), 0 } },
652 & ifmt_div0s, { 0x1700 }
657 { { MNEM, ' ', OP (RS2), ',', '@', '-', OP (R15), 0 } },
658 & ifmt_ldr15dr, { 0x1780 }
663 { { MNEM, ' ', OP (PS), ',', '@', '-', OP (R15), 0 } },
664 & ifmt_div3, { 0x1790 }
669 { { MNEM, ' ', OP (RJ), ',', OP (RI), 0 } },
670 & ifmt_add, { 0x8b00 }
675 { { MNEM, ' ', OP (RS1), ',', OP (RI), 0 } },
676 & ifmt_movdr, { 0xb700 }
681 { { MNEM, ' ', OP (PS), ',', OP (RI), 0 } },
682 & ifmt_div0s, { 0x1710 }
687 { { MNEM, ' ', OP (RI), ',', OP (RS1), 0 } },
688 & ifmt_movdr, { 0xb300 }
693 { { MNEM, ' ', OP (RI), ',', OP (PS), 0 } },
694 & ifmt_div0s, { 0x710 }
699 { { MNEM, ' ', '@', OP (RI), 0 } },
700 & ifmt_div0s, { 0x9700 }
705 { { MNEM, ' ', '@', OP (RI), 0 } },
706 & ifmt_div0s, { 0x9f00 }
711 { { MNEM, ' ', '@', OP (RI), 0 } },
712 & ifmt_div0s, { 0x9710 }
717 { { MNEM, ' ', '@', OP (RI), 0 } },
718 & ifmt_div0s, { 0x9f10 }
723 { { MNEM, ' ', OP (LABEL12), 0 } },
724 & ifmt_call, { 0xd000 }
726 /* call:d $label12 */
729 { { MNEM, ' ', OP (LABEL12), 0 } },
730 & ifmt_call, { 0xd800 }
736 & ifmt_div3, { 0x9720 }
742 & ifmt_div3, { 0x9f20 }
747 { { MNEM, ' ', OP (U8), 0 } },
748 & ifmt_int, { 0x1f00 }
754 & ifmt_div3, { 0x9f30 }
760 & ifmt_div3, { 0x9730 }
765 { { MNEM, ' ', OP (LABEL9), 0 } },
766 & ifmt_brad, { 0xf000 }
771 { { MNEM, ' ', OP (LABEL9), 0 } },
772 & ifmt_brad, { 0xe000 }
777 { { MNEM, ' ', OP (LABEL9), 0 } },
778 & ifmt_brad, { 0xf100 }
783 { { MNEM, ' ', OP (LABEL9), 0 } },
784 & ifmt_brad, { 0xe100 }
789 { { MNEM, ' ', OP (LABEL9), 0 } },
790 & ifmt_brad, { 0xf200 }
795 { { MNEM, ' ', OP (LABEL9), 0 } },
796 & ifmt_brad, { 0xe200 }
801 { { MNEM, ' ', OP (LABEL9), 0 } },
802 & ifmt_brad, { 0xf300 }
807 { { MNEM, ' ', OP (LABEL9), 0 } },
808 & ifmt_brad, { 0xe300 }
813 { { MNEM, ' ', OP (LABEL9), 0 } },
814 & ifmt_brad, { 0xf400 }
819 { { MNEM, ' ', OP (LABEL9), 0 } },
820 & ifmt_brad, { 0xe400 }
825 { { MNEM, ' ', OP (LABEL9), 0 } },
826 & ifmt_brad, { 0xf500 }
831 { { MNEM, ' ', OP (LABEL9), 0 } },
832 & ifmt_brad, { 0xe500 }
837 { { MNEM, ' ', OP (LABEL9), 0 } },
838 & ifmt_brad, { 0xf600 }
843 { { MNEM, ' ', OP (LABEL9), 0 } },
844 & ifmt_brad, { 0xe600 }
849 { { MNEM, ' ', OP (LABEL9), 0 } },
850 & ifmt_brad, { 0xf700 }
855 { { MNEM, ' ', OP (LABEL9), 0 } },
856 & ifmt_brad, { 0xe700 }
861 { { MNEM, ' ', OP (LABEL9), 0 } },
862 & ifmt_brad, { 0xf800 }
867 { { MNEM, ' ', OP (LABEL9), 0 } },
868 & ifmt_brad, { 0xe800 }
873 { { MNEM, ' ', OP (LABEL9), 0 } },
874 & ifmt_brad, { 0xf900 }
879 { { MNEM, ' ', OP (LABEL9), 0 } },
880 & ifmt_brad, { 0xe900 }
885 { { MNEM, ' ', OP (LABEL9), 0 } },
886 & ifmt_brad, { 0xfa00 }
891 { { MNEM, ' ', OP (LABEL9), 0 } },
892 & ifmt_brad, { 0xea00 }
897 { { MNEM, ' ', OP (LABEL9), 0 } },
898 & ifmt_brad, { 0xfb00 }
903 { { MNEM, ' ', OP (LABEL9), 0 } },
904 & ifmt_brad, { 0xeb00 }
909 { { MNEM, ' ', OP (LABEL9), 0 } },
910 & ifmt_brad, { 0xfc00 }
915 { { MNEM, ' ', OP (LABEL9), 0 } },
916 & ifmt_brad, { 0xec00 }
921 { { MNEM, ' ', OP (LABEL9), 0 } },
922 & ifmt_brad, { 0xfd00 }
927 { { MNEM, ' ', OP (LABEL9), 0 } },
928 & ifmt_brad, { 0xed00 }
933 { { MNEM, ' ', OP (LABEL9), 0 } },
934 & ifmt_brad, { 0xfe00 }
939 { { MNEM, ' ', OP (LABEL9), 0 } },
940 & ifmt_brad, { 0xee00 }
945 { { MNEM, ' ', OP (LABEL9), 0 } },
946 & ifmt_brad, { 0xff00 }
951 { { MNEM, ' ', OP (LABEL9), 0 } },
952 & ifmt_brad, { 0xef00 }
954 /* dmov $R13,@$dir10 */
957 { { MNEM, ' ', OP (R13), ',', '@', OP (DIR10), 0 } },
958 & ifmt_dmovr13, { 0x1800 }
960 /* dmovh $R13,@$dir9 */
963 { { MNEM, ' ', OP (R13), ',', '@', OP (DIR9), 0 } },
964 & ifmt_dmovr13h, { 0x1900 }
966 /* dmovb $R13,@$dir8 */
969 { { MNEM, ' ', OP (R13), ',', '@', OP (DIR8), 0 } },
970 & ifmt_dmovr13b, { 0x1a00 }
972 /* dmov @$R13+,@$dir10 */
975 { { MNEM, ' ', '@', OP (R13), '+', ',', '@', OP (DIR10), 0 } },
976 & ifmt_dmovr13, { 0x1c00 }
978 /* dmovh @$R13+,@$dir9 */
981 { { MNEM, ' ', '@', OP (R13), '+', ',', '@', OP (DIR9), 0 } },
982 & ifmt_dmovr13h, { 0x1d00 }
984 /* dmovb @$R13+,@$dir8 */
987 { { MNEM, ' ', '@', OP (R13), '+', ',', '@', OP (DIR8), 0 } },
988 & ifmt_dmovr13b, { 0x1e00 }
990 /* dmov @$R15+,@$dir10 */
993 { { MNEM, ' ', '@', OP (R15), '+', ',', '@', OP (DIR10), 0 } },
994 & ifmt_dmovr13, { 0x1b00 }
996 /* dmov @$dir10,$R13 */
999 { { MNEM, ' ', '@', OP (DIR10), ',', OP (R13), 0 } },
1000 & ifmt_dmovr13, { 0x800 }
1002 /* dmovh @$dir9,$R13 */
1005 { { MNEM, ' ', '@', OP (DIR9), ',', OP (R13), 0 } },
1006 & ifmt_dmovr13h, { 0x900 }
1008 /* dmovb @$dir8,$R13 */
1011 { { MNEM, ' ', '@', OP (DIR8), ',', OP (R13), 0 } },
1012 & ifmt_dmovr13b, { 0xa00 }
1014 /* dmov @$dir10,@$R13+ */
1017 { { MNEM, ' ', '@', OP (DIR10), ',', '@', OP (R13), '+', 0 } },
1018 & ifmt_dmovr13, { 0xc00 }
1020 /* dmovh @$dir9,@$R13+ */
1023 { { MNEM, ' ', '@', OP (DIR9), ',', '@', OP (R13), '+', 0 } },
1024 & ifmt_dmovr13h, { 0xd00 }
1026 /* dmovb @$dir8,@$R13+ */
1029 { { MNEM, ' ', '@', OP (DIR8), ',', '@', OP (R13), '+', 0 } },
1030 & ifmt_dmovr13b, { 0xe00 }
1032 /* dmov @$dir10,@-$R15 */
1035 { { MNEM, ' ', '@', OP (DIR10), ',', '@', '-', OP (R15), 0 } },
1036 & ifmt_dmovr13, { 0xb00 }
1038 /* ldres @$Ri+,$u4 */
1041 { { MNEM, ' ', '@', OP (RI), '+', ',', OP (U4), 0 } },
1042 & ifmt_addi, { 0xbc00 }
1044 /* stres $u4,@$Ri+ */
1047 { { MNEM, ' ', OP (U4), ',', '@', OP (RI), '+', 0 } },
1048 & ifmt_addi, { 0xbd00 }
1050 /* copop $u4c,$ccc,$CRj,$CRi */
1053 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (CRJ), ',', OP (CRI), 0 } },
1054 & ifmt_copop, { 0x9fc0 }
1056 /* copld $u4c,$ccc,$Rjc,$CRi */
1059 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (RJC), ',', OP (CRI), 0 } },
1060 & ifmt_copld, { 0x9fd0 }
1062 /* copst $u4c,$ccc,$CRj,$Ric */
1065 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (CRJ), ',', OP (RIC), 0 } },
1066 & ifmt_copst, { 0x9fe0 }
1068 /* copsv $u4c,$ccc,$CRj,$Ric */
1071 { { MNEM, ' ', OP (U4C), ',', OP (CCC), ',', OP (CRJ), ',', OP (RIC), 0 } },
1072 & ifmt_copst, { 0x9ff0 }
1078 & ifmt_div3, { 0x9fa0 }
1083 { { MNEM, ' ', OP (U8), 0 } },
1084 & ifmt_int, { 0x8300 }
1089 { { MNEM, ' ', OP (U8), 0 } },
1090 & ifmt_int, { 0x9300 }
1095 { { MNEM, ' ', OP (U8), 0 } },
1096 & ifmt_int, { 0x8700 }
1101 { { MNEM, ' ', OP (S10), 0 } },
1102 & ifmt_addsp, { 0xa300 }
1107 { { MNEM, ' ', OP (RI), 0 } },
1108 & ifmt_div0s, { 0x9780 }
1113 { { MNEM, ' ', OP (RI), 0 } },
1114 & ifmt_div0s, { 0x9790 }
1119 { { MNEM, ' ', OP (RI), 0 } },
1120 & ifmt_div0s, { 0x97a0 }
1125 { { MNEM, ' ', OP (RI), 0 } },
1126 & ifmt_div0s, { 0x97b0 }
1128 /* ldm0 ($reglist_low_ld) */
1131 { { MNEM, ' ', '(', OP (REGLIST_LOW_LD), ')', 0 } },
1132 & ifmt_ldm0, { 0x8c00 }
1134 /* ldm1 ($reglist_hi_ld) */
1137 { { MNEM, ' ', '(', OP (REGLIST_HI_LD), ')', 0 } },
1138 & ifmt_ldm1, { 0x8d00 }
1140 /* stm0 ($reglist_low_st) */
1143 { { MNEM, ' ', '(', OP (REGLIST_LOW_ST), ')', 0 } },
1144 & ifmt_stm0, { 0x8e00 }
1146 /* stm1 ($reglist_hi_st) */
1149 { { MNEM, ' ', '(', OP (REGLIST_HI_ST), ')', 0 } },
1150 & ifmt_stm1, { 0x8f00 }
1155 { { MNEM, ' ', OP (U10), 0 } },
1156 & ifmt_enter, { 0xf00 }
1162 & ifmt_div3, { 0x9f90 }
1167 { { MNEM, ' ', '@', OP (RJ), ',', OP (RI), 0 } },
1168 & ifmt_add, { 0x8a00 }
1177 /* Formats for ALIAS macro-insns. */
1179 #define F(f) & fr30_cgen_ifld_table[CONCAT2 (FR30_,f)]
1181 static const CGEN_IFMT ifmt_ldi8m = {
1182 16, 16, 0xf000, { { F (F_OP1) }, { F (F_I8) }, { F (F_RI) }, { 0 } }
1185 static const CGEN_IFMT ifmt_ldi20m = {
1186 16, 32, 0xff00, { { F (F_OP1) }, { F (F_OP2) }, { F (F_RI) }, { F (F_I20) }, { 0 } }
1189 static const CGEN_IFMT ifmt_ldi32m = {
1190 16, 48, 0xfff0, { { F (F_OP1) }, { F (F_OP2) }, { F (F_OP3) }, { F (F_RI) }, { F (F_I32) }, { 0 } }
1195 /* Each non-simple macro entry points to an array of expansion possibilities. */
1197 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
1198 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1199 #define OPERAND(op) CONCAT2 (FR30_OPERAND_,op)
1200 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1202 /* The macro instruction table. */
1204 static const CGEN_IBASE fr30_cgen_macro_insn_table[] =
1208 -1, "ldi8m", "ldi8", 16,
1209 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
1211 /* ldi20 $i20,$Ri */
1213 -1, "ldi20m", "ldi20", 32,
1214 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
1216 /* ldi32 $i32,$Ri */
1218 -1, "ldi32m", "ldi32", 48,
1219 { 0|A(NO_DIS)|A(ALIAS), { (1<<MACH_BASE) } }
1223 /* The macro instruction opcode table. */
1225 static const CGEN_OPCODE fr30_cgen_macro_insn_opcode_table[] =
1230 { { MNEM, ' ', OP (I8), ',', OP (RI), 0 } },
1231 & ifmt_ldi8m, { 0xc000 }
1233 /* ldi20 $i20,$Ri */
1236 { { MNEM, ' ', OP (I20), ',', OP (RI), 0 } },
1237 & ifmt_ldi20m, { 0x9b00 }
1239 /* ldi32 $i32,$Ri */
1242 { { MNEM, ' ', OP (I32), ',', OP (RI), 0 } },
1243 & ifmt_ldi32m, { 0x9f80 }
1252 #ifndef CGEN_ASM_HASH_P
1253 #define CGEN_ASM_HASH_P(insn) 1
1256 #ifndef CGEN_DIS_HASH_P
1257 #define CGEN_DIS_HASH_P(insn) 1
1260 /* Return non-zero if INSN is to be added to the hash table.
1261 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
1264 asm_hash_insn_p (insn)
1265 const CGEN_INSN *insn;
1267 return CGEN_ASM_HASH_P (insn);
1271 dis_hash_insn_p (insn)
1272 const CGEN_INSN *insn;
1274 /* If building the hash table and the NO-DIS attribute is present,
1276 if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
1278 return CGEN_DIS_HASH_P (insn);
1281 #ifndef CGEN_ASM_HASH
1282 #define CGEN_ASM_HASH_SIZE 127
1283 #ifdef CGEN_MNEMONIC_OPERANDS
1284 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
1286 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
1290 /* It doesn't make much sense to provide a default here,
1291 but while this is under development we do.
1292 BUFFER is a pointer to the bytes of the insn, target order.
1293 VALUE is the first base_insn_bitsize bits as an int in host order. */
1295 #ifndef CGEN_DIS_HASH
1296 #define CGEN_DIS_HASH_SIZE 256
1297 #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
1300 /* The result is the hash value of the insn.
1301 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
1304 asm_hash_insn (mnem)
1307 return CGEN_ASM_HASH (mnem);
1310 /* BUF is a pointer to the bytes of the insn, target order.
1311 VALUE is the first base_insn_bitsize bits as an int in host order. */
1314 dis_hash_insn (buf, value)
1316 CGEN_INSN_INT value;
1318 return CGEN_DIS_HASH (buf, value);
1321 /* Set the recorded length of the insn in the CGEN_FIELDS struct. */
1324 set_fields_bitsize (fields, size)
1325 CGEN_FIELDS *fields;
1328 CGEN_FIELDS_BITSIZE (fields) = size;
1331 /* Function to call before using the operand instance table.
1332 This plugs the opcode entries and macro instructions into the cpu table. */
1335 fr30_cgen_init_opcode_table (cd)
1339 int num_macros = (sizeof (fr30_cgen_macro_insn_table) /
1340 sizeof (fr30_cgen_macro_insn_table[0]));
1341 const CGEN_IBASE *ib = & fr30_cgen_macro_insn_table[0];
1342 const CGEN_OPCODE *oc = & fr30_cgen_macro_insn_opcode_table[0];
1343 CGEN_INSN *insns = (CGEN_INSN *) xmalloc (num_macros * sizeof (CGEN_INSN));
1344 memset (insns, 0, num_macros * sizeof (CGEN_INSN));
1345 for (i = 0; i < num_macros; ++i)
1347 insns[i].base = &ib[i];
1348 insns[i].opcode = &oc[i];
1350 cd->macro_insn_table.init_entries = insns;
1351 cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
1352 cd->macro_insn_table.num_init_entries = num_macros;
1354 oc = & fr30_cgen_insn_opcode_table[0];
1355 insns = (CGEN_INSN *) cd->insn_table.init_entries;
1356 for (i = 0; i < MAX_INSNS; ++i)
1357 insns[i].opcode = &oc[i];
1359 cd->sizeof_fields = sizeof (CGEN_FIELDS);
1360 cd->set_fields_bitsize = set_fields_bitsize;
1362 cd->asm_hash_p = asm_hash_insn_p;
1363 cd->asm_hash = asm_hash_insn;
1364 cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
1366 cd->dis_hash_p = dis_hash_insn_p;
1367 cd->dis_hash = dis_hash_insn;
1368 cd->dis_hash_size = CGEN_DIS_HASH_SIZE;