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"
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) & m32r_cgen_ifld_table[CONCAT2 (M32R_,f)]
45 static const CGEN_IFMT ifmt_empty
= {
49 static const CGEN_IFMT ifmt_add
= {
50 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
53 static const CGEN_IFMT ifmt_add3
= {
54 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
57 static const CGEN_IFMT ifmt_and3
= {
58 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_UIMM16
) }, { 0 } }
61 static const CGEN_IFMT ifmt_or3
= {
62 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_UIMM16
) }, { 0 } }
65 static const CGEN_IFMT ifmt_addi
= {
66 16, 16, 0xf000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_SIMM8
) }, { 0 } }
69 static const CGEN_IFMT ifmt_addv3
= {
70 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
73 static const CGEN_IFMT ifmt_bc8
= {
74 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
77 static const CGEN_IFMT ifmt_bc24
= {
78 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
81 static const CGEN_IFMT ifmt_beq
= {
82 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_DISP16
) }, { 0 } }
85 static const CGEN_IFMT ifmt_beqz
= {
86 32, 32, 0xfff00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_DISP16
) }, { 0 } }
89 static const CGEN_IFMT ifmt_cmp
= {
90 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
93 static const CGEN_IFMT ifmt_cmpi
= {
94 32, 32, 0xfff00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
97 static const CGEN_IFMT ifmt_cmpz
= {
98 16, 16, 0xfff0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
101 static const CGEN_IFMT ifmt_div
= {
102 32, 32, 0xf0f0ffff, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
105 static const CGEN_IFMT ifmt_jc
= {
106 16, 16, 0xfff0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
109 static const CGEN_IFMT ifmt_ld24
= {
110 32, 32, 0xf0000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_UIMM24
) }, { 0 } }
113 static const CGEN_IFMT ifmt_ldi16
= {
114 32, 32, 0xf0ff0000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
117 static const CGEN_IFMT ifmt_machi_a
= {
118 16, 16, 0xf070, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_ACC
) }, { F (F_OP23
) }, { F (F_R2
) }, { 0 } }
121 static const CGEN_IFMT ifmt_mvfachi
= {
122 16, 16, 0xf0ff, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
125 static const CGEN_IFMT ifmt_mvfachi_a
= {
126 16, 16, 0xf0f3, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_ACCS
) }, { F (F_OP3
) }, { 0 } }
129 static const CGEN_IFMT ifmt_mvfc
= {
130 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
133 static const CGEN_IFMT ifmt_mvtachi
= {
134 16, 16, 0xf0ff, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
137 static const CGEN_IFMT ifmt_mvtachi_a
= {
138 16, 16, 0xf0f3, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_ACCS
) }, { F (F_OP3
) }, { 0 } }
141 static const CGEN_IFMT ifmt_mvtc
= {
142 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
145 static const CGEN_IFMT ifmt_nop
= {
146 16, 16, 0xffff, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
149 static const CGEN_IFMT ifmt_rac_dsi
= {
150 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 } }
153 static const CGEN_IFMT ifmt_seth
= {
154 32, 32, 0xf0ff0000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_HI16
) }, { 0 } }
157 static const CGEN_IFMT ifmt_slli
= {
158 16, 16, 0xf0e0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_SHIFT_OP2
) }, { F (F_UIMM5
) }, { 0 } }
161 static const CGEN_IFMT ifmt_st_d
= {
162 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
165 static const CGEN_IFMT ifmt_trap
= {
166 16, 16, 0xfff0, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_UIMM4
) }, { 0 } }
169 static const CGEN_IFMT ifmt_satb
= {
170 32, 32, 0xf0f0ffff, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_UIMM16
) }, { 0 } }
175 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
176 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
177 #define OPERAND(op) CONCAT2 (M32R_OPERAND_,op)
178 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
180 /* The instruction table. */
182 static const CGEN_OPCODE m32r_cgen_insn_opcode_table
[MAX_INSNS
] =
184 /* Special null first entry.
185 A `num' value of zero is thus invalid.
186 Also, the special `invalid' insn resides here. */
187 { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
191 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
194 /* add3 $dr,$sr,$hash$slo16 */
197 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (HASH
), OP (SLO16
), 0 } },
198 & ifmt_add3
, { 0x80a00000 }
203 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
206 /* and3 $dr,$sr,$uimm16 */
209 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (UIMM16
), 0 } },
210 & ifmt_and3
, { 0x80c00000 }
215 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
218 /* or3 $dr,$sr,$hash$ulo16 */
221 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (HASH
), OP (ULO16
), 0 } },
222 & ifmt_or3
, { 0x80e00000 }
227 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
230 /* xor3 $dr,$sr,$uimm16 */
233 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (UIMM16
), 0 } },
234 & ifmt_and3
, { 0x80d00000 }
236 /* addi $dr,$simm8 */
239 { { MNEM
, ' ', OP (DR
), ',', OP (SIMM8
), 0 } },
240 & ifmt_addi
, { 0x4000 }
245 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
248 /* addv3 $dr,$sr,$simm16 */
251 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (SIMM16
), 0 } },
252 & ifmt_addv3
, { 0x80800000 }
257 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
263 { { MNEM
, ' ', OP (DISP8
), 0 } },
264 & ifmt_bc8
, { 0x7c00 }
269 { { MNEM
, ' ', OP (DISP24
), 0 } },
270 & ifmt_bc24
, { 0xfc000000 }
272 /* beq $src1,$src2,$disp16 */
275 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (DISP16
), 0 } },
276 & ifmt_beq
, { 0xb0000000 }
278 /* beqz $src2,$disp16 */
281 { { MNEM
, ' ', OP (SRC2
), ',', OP (DISP16
), 0 } },
282 & ifmt_beqz
, { 0xb0800000 }
284 /* bgez $src2,$disp16 */
287 { { MNEM
, ' ', OP (SRC2
), ',', OP (DISP16
), 0 } },
288 & ifmt_beqz
, { 0xb0b00000 }
290 /* bgtz $src2,$disp16 */
293 { { MNEM
, ' ', OP (SRC2
), ',', OP (DISP16
), 0 } },
294 & ifmt_beqz
, { 0xb0d00000 }
296 /* blez $src2,$disp16 */
299 { { MNEM
, ' ', OP (SRC2
), ',', OP (DISP16
), 0 } },
300 & ifmt_beqz
, { 0xb0c00000 }
302 /* bltz $src2,$disp16 */
305 { { MNEM
, ' ', OP (SRC2
), ',', OP (DISP16
), 0 } },
306 & ifmt_beqz
, { 0xb0a00000 }
308 /* bnez $src2,$disp16 */
311 { { MNEM
, ' ', OP (SRC2
), ',', OP (DISP16
), 0 } },
312 & ifmt_beqz
, { 0xb0900000 }
317 { { MNEM
, ' ', OP (DISP8
), 0 } },
318 & ifmt_bc8
, { 0x7e00 }
323 { { MNEM
, ' ', OP (DISP24
), 0 } },
324 & ifmt_bc24
, { 0xfe000000 }
329 { { MNEM
, ' ', OP (DISP8
), 0 } },
330 & ifmt_bc8
, { 0x7800 }
335 { { MNEM
, ' ', OP (DISP24
), 0 } },
336 & ifmt_bc24
, { 0xf8000000 }
341 { { MNEM
, ' ', OP (DISP8
), 0 } },
342 & ifmt_bc8
, { 0x7d00 }
347 { { MNEM
, ' ', OP (DISP24
), 0 } },
348 & ifmt_bc24
, { 0xfd000000 }
350 /* bne $src1,$src2,$disp16 */
353 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (DISP16
), 0 } },
354 & ifmt_beq
, { 0xb0100000 }
359 { { MNEM
, ' ', OP (DISP8
), 0 } },
360 & ifmt_bc8
, { 0x7f00 }
365 { { MNEM
, ' ', OP (DISP24
), 0 } },
366 & ifmt_bc24
, { 0xff000000 }
371 { { MNEM
, ' ', OP (DISP8
), 0 } },
372 & ifmt_bc8
, { 0x7900 }
377 { { MNEM
, ' ', OP (DISP24
), 0 } },
378 & ifmt_bc24
, { 0xf9000000 }
380 /* cmp $src1,$src2 */
383 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
386 /* cmpi $src2,$simm16 */
389 { { MNEM
, ' ', OP (SRC2
), ',', OP (SIMM16
), 0 } },
390 & ifmt_cmpi
, { 0x80400000 }
392 /* cmpu $src1,$src2 */
395 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
398 /* cmpui $src2,$simm16 */
401 { { MNEM
, ' ', OP (SRC2
), ',', OP (SIMM16
), 0 } },
402 & ifmt_cmpi
, { 0x80500000 }
404 /* cmpeq $src1,$src2 */
407 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
413 { { MNEM
, ' ', OP (SRC2
), 0 } },
414 & ifmt_cmpz
, { 0x70 }
419 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
420 & ifmt_div
, { 0x90000000 }
425 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
426 & ifmt_div
, { 0x90100000 }
431 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
432 & ifmt_div
, { 0x90200000 }
437 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
438 & ifmt_div
, { 0x90300000 }
443 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
444 & ifmt_div
, { 0x90000010 }
449 { { MNEM
, ' ', OP (SR
), 0 } },
450 & ifmt_jc
, { 0x1cc0 }
455 { { MNEM
, ' ', OP (SR
), 0 } },
456 & ifmt_jc
, { 0x1dc0 }
461 { { MNEM
, ' ', OP (SR
), 0 } },
462 & ifmt_jc
, { 0x1ec0 }
467 { { MNEM
, ' ', OP (SR
), 0 } },
468 & ifmt_jc
, { 0x1fc0 }
473 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), 0 } },
474 & ifmt_add
, { 0x20c0 }
476 /* ld $dr,@($slo16,$sr) */
479 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SLO16
), ',', OP (SR
), ')', 0 } },
480 & ifmt_add3
, { 0xa0c00000 }
485 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), 0 } },
486 & ifmt_add
, { 0x2080 }
488 /* ldb $dr,@($slo16,$sr) */
491 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SLO16
), ',', OP (SR
), ')', 0 } },
492 & ifmt_add3
, { 0xa0800000 }
497 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), 0 } },
498 & ifmt_add
, { 0x20a0 }
500 /* ldh $dr,@($slo16,$sr) */
503 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SLO16
), ',', OP (SR
), ')', 0 } },
504 & ifmt_add3
, { 0xa0a00000 }
509 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), 0 } },
510 & ifmt_add
, { 0x2090 }
512 /* ldub $dr,@($slo16,$sr) */
515 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SLO16
), ',', OP (SR
), ')', 0 } },
516 & ifmt_add3
, { 0xa0900000 }
521 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), 0 } },
522 & ifmt_add
, { 0x20b0 }
524 /* lduh $dr,@($slo16,$sr) */
527 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SLO16
), ',', OP (SR
), ')', 0 } },
528 & ifmt_add3
, { 0xa0b00000 }
533 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), '+', 0 } },
534 & ifmt_add
, { 0x20e0 }
536 /* ld24 $dr,$uimm24 */
539 { { MNEM
, ' ', OP (DR
), ',', OP (UIMM24
), 0 } },
540 & ifmt_ld24
, { 0xe0000000 }
542 /* ldi8 $dr,$simm8 */
545 { { MNEM
, ' ', OP (DR
), ',', OP (SIMM8
), 0 } },
546 & ifmt_addi
, { 0x6000 }
548 /* ldi16 $dr,$hash$slo16 */
551 { { MNEM
, ' ', OP (DR
), ',', OP (HASH
), OP (SLO16
), 0 } },
552 & ifmt_ldi16
, { 0x90f00000 }
557 { { MNEM
, ' ', OP (DR
), ',', '@', OP (SR
), 0 } },
558 & ifmt_add
, { 0x20d0 }
560 /* machi $src1,$src2 */
563 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
564 & ifmt_cmp
, { 0x3040 }
566 /* machi $src1,$src2,$acc */
569 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
570 & ifmt_machi_a
, { 0x3040 }
572 /* maclo $src1,$src2 */
575 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
576 & ifmt_cmp
, { 0x3050 }
578 /* maclo $src1,$src2,$acc */
581 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
582 & ifmt_machi_a
, { 0x3050 }
584 /* macwhi $src1,$src2 */
587 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
588 & ifmt_cmp
, { 0x3060 }
590 /* macwhi $src1,$src2,$acc */
593 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
594 & ifmt_machi_a
, { 0x3060 }
596 /* macwlo $src1,$src2 */
599 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
600 & ifmt_cmp
, { 0x3070 }
602 /* macwlo $src1,$src2,$acc */
605 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
606 & ifmt_machi_a
, { 0x3070 }
611 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
612 & ifmt_add
, { 0x1060 }
614 /* mulhi $src1,$src2 */
617 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
618 & ifmt_cmp
, { 0x3000 }
620 /* mulhi $src1,$src2,$acc */
623 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
624 & ifmt_machi_a
, { 0x3000 }
626 /* mullo $src1,$src2 */
629 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
630 & ifmt_cmp
, { 0x3010 }
632 /* mullo $src1,$src2,$acc */
635 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
636 & ifmt_machi_a
, { 0x3010 }
638 /* mulwhi $src1,$src2 */
641 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
642 & ifmt_cmp
, { 0x3020 }
644 /* mulwhi $src1,$src2,$acc */
647 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
648 & ifmt_machi_a
, { 0x3020 }
650 /* mulwlo $src1,$src2 */
653 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
654 & ifmt_cmp
, { 0x3030 }
656 /* mulwlo $src1,$src2,$acc */
659 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), ',', OP (ACC
), 0 } },
660 & ifmt_machi_a
, { 0x3030 }
665 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
666 & ifmt_add
, { 0x1080 }
671 { { MNEM
, ' ', OP (DR
), 0 } },
672 & ifmt_mvfachi
, { 0x50f0 }
674 /* mvfachi $dr,$accs */
677 { { MNEM
, ' ', OP (DR
), ',', OP (ACCS
), 0 } },
678 & ifmt_mvfachi_a
, { 0x50f0 }
683 { { MNEM
, ' ', OP (DR
), 0 } },
684 & ifmt_mvfachi
, { 0x50f1 }
686 /* mvfaclo $dr,$accs */
689 { { MNEM
, ' ', OP (DR
), ',', OP (ACCS
), 0 } },
690 & ifmt_mvfachi_a
, { 0x50f1 }
695 { { MNEM
, ' ', OP (DR
), 0 } },
696 & ifmt_mvfachi
, { 0x50f2 }
698 /* mvfacmi $dr,$accs */
701 { { MNEM
, ' ', OP (DR
), ',', OP (ACCS
), 0 } },
702 & ifmt_mvfachi_a
, { 0x50f2 }
707 { { MNEM
, ' ', OP (DR
), ',', OP (SCR
), 0 } },
708 & ifmt_mvfc
, { 0x1090 }
713 { { MNEM
, ' ', OP (SRC1
), 0 } },
714 & ifmt_mvtachi
, { 0x5070 }
716 /* mvtachi $src1,$accs */
719 { { MNEM
, ' ', OP (SRC1
), ',', OP (ACCS
), 0 } },
720 & ifmt_mvtachi_a
, { 0x5070 }
725 { { MNEM
, ' ', OP (SRC1
), 0 } },
726 & ifmt_mvtachi
, { 0x5071 }
728 /* mvtaclo $src1,$accs */
731 { { MNEM
, ' ', OP (SRC1
), ',', OP (ACCS
), 0 } },
732 & ifmt_mvtachi_a
, { 0x5071 }
737 { { MNEM
, ' ', OP (SR
), ',', OP (DCR
), 0 } },
738 & ifmt_mvtc
, { 0x10a0 }
743 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
750 & ifmt_nop
, { 0x7000 }
755 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
762 & ifmt_nop
, { 0x5090 }
764 /* rac $accd,$accs,$imm1 */
767 { { MNEM
, ' ', OP (ACCD
), ',', OP (ACCS
), ',', OP (IMM1
), 0 } },
768 & ifmt_rac_dsi
, { 0x5090 }
774 & ifmt_nop
, { 0x5080 }
776 /* rach $accd,$accs,$imm1 */
779 { { MNEM
, ' ', OP (ACCD
), ',', OP (ACCS
), ',', OP (IMM1
), 0 } },
780 & ifmt_rac_dsi
, { 0x5080 }
786 & ifmt_nop
, { 0x10d6 }
788 /* seth $dr,$hash$hi16 */
791 { { MNEM
, ' ', OP (DR
), ',', OP (HASH
), OP (HI16
), 0 } },
792 & ifmt_seth
, { 0xd0c00000 }
797 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
798 & ifmt_add
, { 0x1040 }
800 /* sll3 $dr,$sr,$simm16 */
803 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (SIMM16
), 0 } },
804 & ifmt_addv3
, { 0x90c00000 }
806 /* slli $dr,$uimm5 */
809 { { MNEM
, ' ', OP (DR
), ',', OP (UIMM5
), 0 } },
810 & ifmt_slli
, { 0x5040 }
815 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
816 & ifmt_add
, { 0x1020 }
818 /* sra3 $dr,$sr,$simm16 */
821 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (SIMM16
), 0 } },
822 & ifmt_addv3
, { 0x90a00000 }
824 /* srai $dr,$uimm5 */
827 { { MNEM
, ' ', OP (DR
), ',', OP (UIMM5
), 0 } },
828 & ifmt_slli
, { 0x5020 }
833 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
834 & ifmt_add
, { 0x1000 }
836 /* srl3 $dr,$sr,$simm16 */
839 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), ',', OP (SIMM16
), 0 } },
840 & ifmt_addv3
, { 0x90800000 }
842 /* srli $dr,$uimm5 */
845 { { MNEM
, ' ', OP (DR
), ',', OP (UIMM5
), 0 } },
846 & ifmt_slli
, { 0x5000 }
848 /* st $src1,@$src2 */
851 { { MNEM
, ' ', OP (SRC1
), ',', '@', OP (SRC2
), 0 } },
852 & ifmt_cmp
, { 0x2040 }
854 /* st $src1,@($slo16,$src2) */
857 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SLO16
), ',', OP (SRC2
), ')', 0 } },
858 & ifmt_st_d
, { 0xa0400000 }
860 /* stb $src1,@$src2 */
863 { { MNEM
, ' ', OP (SRC1
), ',', '@', OP (SRC2
), 0 } },
864 & ifmt_cmp
, { 0x2000 }
866 /* stb $src1,@($slo16,$src2) */
869 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SLO16
), ',', OP (SRC2
), ')', 0 } },
870 & ifmt_st_d
, { 0xa0000000 }
872 /* sth $src1,@$src2 */
875 { { MNEM
, ' ', OP (SRC1
), ',', '@', OP (SRC2
), 0 } },
876 & ifmt_cmp
, { 0x2020 }
878 /* sth $src1,@($slo16,$src2) */
881 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SLO16
), ',', OP (SRC2
), ')', 0 } },
882 & ifmt_st_d
, { 0xa0200000 }
884 /* st $src1,@+$src2 */
887 { { MNEM
, ' ', OP (SRC1
), ',', '@', '+', OP (SRC2
), 0 } },
888 & ifmt_cmp
, { 0x2060 }
890 /* st $src1,@-$src2 */
893 { { MNEM
, ' ', OP (SRC1
), ',', '@', '-', OP (SRC2
), 0 } },
894 & ifmt_cmp
, { 0x2070 }
899 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
905 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
911 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
917 { { MNEM
, ' ', OP (UIMM4
), 0 } },
918 & ifmt_trap
, { 0x10f0 }
920 /* unlock $src1,@$src2 */
923 { { MNEM
, ' ', OP (SRC1
), ',', '@', OP (SRC2
), 0 } },
924 & ifmt_cmp
, { 0x2050 }
929 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
930 & ifmt_satb
, { 0x80600300 }
935 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
936 & ifmt_satb
, { 0x80600200 }
941 { { MNEM
, ' ', OP (DR
), ',', OP (SR
), 0 } },
942 & ifmt_satb
, { 0x80600000 }
947 { { MNEM
, ' ', OP (SRC2
), 0 } },
948 & ifmt_cmpz
, { 0x370 }
954 & ifmt_nop
, { 0x50e4 }
956 /* macwu1 $src1,$src2 */
959 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
960 & ifmt_cmp
, { 0x50b0 }
962 /* msblo $src1,$src2 */
965 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
966 & ifmt_cmp
, { 0x50d0 }
968 /* mulwu1 $src1,$src2 */
971 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
972 & ifmt_cmp
, { 0x50a0 }
974 /* maclh1 $src1,$src2 */
977 { { MNEM
, ' ', OP (SRC1
), ',', OP (SRC2
), 0 } },
978 & ifmt_cmp
, { 0x50c0 }
984 & ifmt_nop
, { 0x7401 }
990 & ifmt_nop
, { 0x7501 }
999 /* Formats for ALIAS macro-insns. */
1001 #define F(f) & m32r_cgen_ifld_table[CONCAT2 (M32R_,f)]
1003 static const CGEN_IFMT ifmt_bc8r
= {
1004 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
1007 static const CGEN_IFMT ifmt_bc24r
= {
1008 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
1011 static const CGEN_IFMT ifmt_bl8r
= {
1012 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
1015 static const CGEN_IFMT ifmt_bl24r
= {
1016 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
1019 static const CGEN_IFMT ifmt_bcl8r
= {
1020 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
1023 static const CGEN_IFMT ifmt_bcl24r
= {
1024 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
1027 static const CGEN_IFMT ifmt_bnc8r
= {
1028 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
1031 static const CGEN_IFMT ifmt_bnc24r
= {
1032 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
1035 static const CGEN_IFMT ifmt_bra8r
= {
1036 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
1039 static const CGEN_IFMT ifmt_bra24r
= {
1040 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
1043 static const CGEN_IFMT ifmt_bncl8r
= {
1044 16, 16, 0xff00, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP8
) }, { 0 } }
1047 static const CGEN_IFMT ifmt_bncl24r
= {
1048 32, 32, 0xff000000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_DISP24
) }, { 0 } }
1051 static const CGEN_IFMT ifmt_ld_2
= {
1052 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1055 static const CGEN_IFMT ifmt_ld_d2
= {
1056 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1059 static const CGEN_IFMT ifmt_ldb_2
= {
1060 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1063 static const CGEN_IFMT ifmt_ldb_d2
= {
1064 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1067 static const CGEN_IFMT ifmt_ldh_2
= {
1068 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1071 static const CGEN_IFMT ifmt_ldh_d2
= {
1072 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1075 static const CGEN_IFMT ifmt_ldub_2
= {
1076 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1079 static const CGEN_IFMT ifmt_ldub_d2
= {
1080 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1083 static const CGEN_IFMT ifmt_lduh_2
= {
1084 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1087 static const CGEN_IFMT ifmt_lduh_d2
= {
1088 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1091 static const CGEN_IFMT ifmt_pop
= {
1092 16, 16, 0xf0ff, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_OP2
) }, { F (F_R2
) }, { 0 } }
1095 static const CGEN_IFMT ifmt_ldi8a
= {
1096 16, 16, 0xf000, { { F (F_OP1
) }, { F (F_R1
) }, { F (F_SIMM8
) }, { 0 } }
1099 static const CGEN_IFMT ifmt_ldi16a
= {
1100 32, 32, 0xf0ff0000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R2
) }, { F (F_R1
) }, { F (F_SIMM16
) }, { 0 } }
1103 static const CGEN_IFMT ifmt_rac_d
= {
1104 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 } }
1107 static const CGEN_IFMT ifmt_rac_ds
= {
1108 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 } }
1111 static const CGEN_IFMT ifmt_rach_d
= {
1112 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 } }
1115 static const CGEN_IFMT ifmt_rach_ds
= {
1116 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 } }
1119 static const CGEN_IFMT ifmt_st_2
= {
1120 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1123 static const CGEN_IFMT ifmt_st_d2
= {
1124 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1127 static const CGEN_IFMT ifmt_stb_2
= {
1128 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1131 static const CGEN_IFMT ifmt_stb_d2
= {
1132 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1135 static const CGEN_IFMT ifmt_sth_2
= {
1136 16, 16, 0xf0f0, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1139 static const CGEN_IFMT ifmt_sth_d2
= {
1140 32, 32, 0xf0f00000, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { F (F_SIMM16
) }, { 0 } }
1143 static const CGEN_IFMT ifmt_push
= {
1144 16, 16, 0xf0ff, { { F (F_OP1
) }, { F (F_OP2
) }, { F (F_R1
) }, { F (F_R2
) }, { 0 } }
1149 /* Each non-simple macro entry points to an array of expansion possibilities. */
1151 #define A(a) (1 << CONCAT2 (CGEN_INSN_,a))
1152 #define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
1153 #define OPERAND(op) CONCAT2 (M32R_OPERAND_,op)
1154 #define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
1156 /* The macro instruction table. */
1158 static const CGEN_IBASE m32r_cgen_macro_insn_table
[] =
1162 -1, "bc8r", "bc", 16,
1163 { 0|A(RELAXABLE
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1167 -1, "bc24r", "bc", 32,
1168 { 0|A(RELAX
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1172 -1, "bl8r", "bl", 16,
1173 { 0|A(RELAXABLE
)|A(FILL_SLOT
)|A(UNCOND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1177 -1, "bl24r", "bl", 32,
1178 { 0|A(RELAX
)|A(UNCOND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1182 -1, "bcl8r", "bcl", 16,
1183 { 0|A(RELAXABLE
)|A(FILL_SLOT
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_O
} }
1187 -1, "bcl24r", "bcl", 32,
1188 { 0|A(RELAX
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_NONE
} }
1192 -1, "bnc8r", "bnc", 16,
1193 { 0|A(RELAXABLE
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1197 -1, "bnc24r", "bnc", 32,
1198 { 0|A(RELAX
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1202 -1, "bra8r", "bra", 16,
1203 { 0|A(RELAXABLE
)|A(FILL_SLOT
)|A(UNCOND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1207 -1, "bra24r", "bra", 32,
1208 { 0|A(RELAX
)|A(UNCOND_CTI
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1212 -1, "bncl8r", "bncl", 16,
1213 { 0|A(RELAXABLE
)|A(FILL_SLOT
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_O
} }
1217 -1, "bncl24r", "bncl", 32,
1218 { 0|A(RELAX
)|A(COND_CTI
)|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_NONE
} }
1222 -1, "ld-2", "ld", 16,
1223 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1225 /* ld $dr,@($sr,$slo16) */
1227 -1, "ld-d2", "ld", 32,
1228 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1230 /* ldb $dr,@($sr) */
1232 -1, "ldb-2", "ldb", 16,
1233 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1235 /* ldb $dr,@($sr,$slo16) */
1237 -1, "ldb-d2", "ldb", 32,
1238 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1240 /* ldh $dr,@($sr) */
1242 -1, "ldh-2", "ldh", 16,
1243 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1245 /* ldh $dr,@($sr,$slo16) */
1247 -1, "ldh-d2", "ldh", 32,
1248 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1250 /* ldub $dr,@($sr) */
1252 -1, "ldub-2", "ldub", 16,
1253 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1255 /* ldub $dr,@($sr,$slo16) */
1257 -1, "ldub-d2", "ldub", 32,
1258 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1260 /* lduh $dr,@($sr) */
1262 -1, "lduh-2", "lduh", 16,
1263 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1265 /* lduh $dr,@($sr,$slo16) */
1267 -1, "lduh-d2", "lduh", 32,
1268 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1272 -1, "pop", "pop", 16,
1273 { 0|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1275 /* ldi $dr,$simm8 */
1277 -1, "ldi8a", "ldi", 16,
1278 { 0|A(ALIAS
), { (1<<MACH_BASE
), PIPE_OS
} }
1280 /* ldi $dr,$hash$slo16 */
1282 -1, "ldi16a", "ldi", 32,
1283 { 0|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1287 -1, "rac-d", "rac", 16,
1288 { 0|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_S
} }
1290 /* rac $accd,$accs */
1292 -1, "rac-ds", "rac", 16,
1293 { 0|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_S
} }
1297 -1, "rach-d", "rach", 16,
1298 { 0|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_S
} }
1300 /* rach $accd,$accs */
1302 -1, "rach-ds", "rach", 16,
1303 { 0|A(ALIAS
), { (1<<MACH_M32RX
), PIPE_S
} }
1305 /* st $src1,@($src2) */
1307 -1, "st-2", "st", 16,
1308 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1310 /* st $src1,@($src2,$slo16) */
1312 -1, "st-d2", "st", 32,
1313 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1315 /* stb $src1,@($src2) */
1317 -1, "stb-2", "stb", 16,
1318 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1320 /* stb $src1,@($src2,$slo16) */
1322 -1, "stb-d2", "stb", 32,
1323 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1325 /* sth $src1,@($src2) */
1327 -1, "sth-2", "sth", 16,
1328 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_O
} }
1330 /* sth $src1,@($src2,$slo16) */
1332 -1, "sth-d2", "sth", 32,
1333 { 0|A(NO_DIS
)|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1337 -1, "push", "push", 16,
1338 { 0|A(ALIAS
), { (1<<MACH_BASE
), PIPE_NONE
} }
1342 /* The macro instruction opcode table. */
1344 static const CGEN_OPCODE m32r_cgen_macro_insn_opcode_table
[] =
1349 { { MNEM
, ' ', OP (DISP8
), 0 } },
1350 & ifmt_bc8r
, { 0x7c00 }
1355 { { MNEM
, ' ', OP (DISP24
), 0 } },
1356 & ifmt_bc24r
, { 0xfc000000 }
1361 { { MNEM
, ' ', OP (DISP8
), 0 } },
1362 & ifmt_bl8r
, { 0x7e00 }
1367 { { MNEM
, ' ', OP (DISP24
), 0 } },
1368 & ifmt_bl24r
, { 0xfe000000 }
1373 { { MNEM
, ' ', OP (DISP8
), 0 } },
1374 & ifmt_bcl8r
, { 0x7800 }
1379 { { MNEM
, ' ', OP (DISP24
), 0 } },
1380 & ifmt_bcl24r
, { 0xf8000000 }
1385 { { MNEM
, ' ', OP (DISP8
), 0 } },
1386 & ifmt_bnc8r
, { 0x7d00 }
1391 { { MNEM
, ' ', OP (DISP24
), 0 } },
1392 & ifmt_bnc24r
, { 0xfd000000 }
1397 { { MNEM
, ' ', OP (DISP8
), 0 } },
1398 & ifmt_bra8r
, { 0x7f00 }
1403 { { MNEM
, ' ', OP (DISP24
), 0 } },
1404 & ifmt_bra24r
, { 0xff000000 }
1409 { { MNEM
, ' ', OP (DISP8
), 0 } },
1410 & ifmt_bncl8r
, { 0x7900 }
1415 { { MNEM
, ' ', OP (DISP24
), 0 } },
1416 & ifmt_bncl24r
, { 0xf9000000 }
1421 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ')', 0 } },
1422 & ifmt_ld_2
, { 0x20c0 }
1424 /* ld $dr,@($sr,$slo16) */
1427 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ',', OP (SLO16
), ')', 0 } },
1428 & ifmt_ld_d2
, { 0xa0c00000 }
1430 /* ldb $dr,@($sr) */
1433 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ')', 0 } },
1434 & ifmt_ldb_2
, { 0x2080 }
1436 /* ldb $dr,@($sr,$slo16) */
1439 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ',', OP (SLO16
), ')', 0 } },
1440 & ifmt_ldb_d2
, { 0xa0800000 }
1442 /* ldh $dr,@($sr) */
1445 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ')', 0 } },
1446 & ifmt_ldh_2
, { 0x20a0 }
1448 /* ldh $dr,@($sr,$slo16) */
1451 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ',', OP (SLO16
), ')', 0 } },
1452 & ifmt_ldh_d2
, { 0xa0a00000 }
1454 /* ldub $dr,@($sr) */
1457 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ')', 0 } },
1458 & ifmt_ldub_2
, { 0x2090 }
1460 /* ldub $dr,@($sr,$slo16) */
1463 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ',', OP (SLO16
), ')', 0 } },
1464 & ifmt_ldub_d2
, { 0xa0900000 }
1466 /* lduh $dr,@($sr) */
1469 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ')', 0 } },
1470 & ifmt_lduh_2
, { 0x20b0 }
1472 /* lduh $dr,@($sr,$slo16) */
1475 { { MNEM
, ' ', OP (DR
), ',', '@', '(', OP (SR
), ',', OP (SLO16
), ')', 0 } },
1476 & ifmt_lduh_d2
, { 0xa0b00000 }
1481 { { MNEM
, ' ', OP (DR
), 0 } },
1482 & ifmt_pop
, { 0x20ef }
1484 /* ldi $dr,$simm8 */
1487 { { MNEM
, ' ', OP (DR
), ',', OP (SIMM8
), 0 } },
1488 & ifmt_ldi8a
, { 0x6000 }
1490 /* ldi $dr,$hash$slo16 */
1493 { { MNEM
, ' ', OP (DR
), ',', OP (HASH
), OP (SLO16
), 0 } },
1494 & ifmt_ldi16a
, { 0x90f00000 }
1499 { { MNEM
, ' ', OP (ACCD
), 0 } },
1500 & ifmt_rac_d
, { 0x5090 }
1502 /* rac $accd,$accs */
1505 { { MNEM
, ' ', OP (ACCD
), ',', OP (ACCS
), 0 } },
1506 & ifmt_rac_ds
, { 0x5090 }
1511 { { MNEM
, ' ', OP (ACCD
), 0 } },
1512 & ifmt_rach_d
, { 0x5080 }
1514 /* rach $accd,$accs */
1517 { { MNEM
, ' ', OP (ACCD
), ',', OP (ACCS
), 0 } },
1518 & ifmt_rach_ds
, { 0x5080 }
1520 /* st $src1,@($src2) */
1523 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SRC2
), ')', 0 } },
1524 & ifmt_st_2
, { 0x2040 }
1526 /* st $src1,@($src2,$slo16) */
1529 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SRC2
), ',', OP (SLO16
), ')', 0 } },
1530 & ifmt_st_d2
, { 0xa0400000 }
1532 /* stb $src1,@($src2) */
1535 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SRC2
), ')', 0 } },
1536 & ifmt_stb_2
, { 0x2000 }
1538 /* stb $src1,@($src2,$slo16) */
1541 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SRC2
), ',', OP (SLO16
), ')', 0 } },
1542 & ifmt_stb_d2
, { 0xa0000000 }
1544 /* sth $src1,@($src2) */
1547 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SRC2
), ')', 0 } },
1548 & ifmt_sth_2
, { 0x2020 }
1550 /* sth $src1,@($src2,$slo16) */
1553 { { MNEM
, ' ', OP (SRC1
), ',', '@', '(', OP (SRC2
), ',', OP (SLO16
), ')', 0 } },
1554 & ifmt_sth_d2
, { 0xa0200000 }
1559 { { MNEM
, ' ', OP (SRC1
), 0 } },
1560 & ifmt_push
, { 0x207f }
1569 #ifndef CGEN_ASM_HASH_P
1570 #define CGEN_ASM_HASH_P(insn) 1
1573 #ifndef CGEN_DIS_HASH_P
1574 #define CGEN_DIS_HASH_P(insn) 1
1577 /* Return non-zero if INSN is to be added to the hash table.
1578 Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file. */
1581 asm_hash_insn_p (insn
)
1582 const CGEN_INSN
*insn
;
1584 return CGEN_ASM_HASH_P (insn
);
1588 dis_hash_insn_p (insn
)
1589 const CGEN_INSN
*insn
;
1591 /* If building the hash table and the NO-DIS attribute is present,
1593 if (CGEN_INSN_ATTR_VALUE (insn
, CGEN_INSN_NO_DIS
))
1595 return CGEN_DIS_HASH_P (insn
);
1598 #ifndef CGEN_ASM_HASH
1599 #define CGEN_ASM_HASH_SIZE 127
1600 #ifdef CGEN_MNEMONIC_OPERANDS
1601 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
1603 #define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
1607 /* It doesn't make much sense to provide a default here,
1608 but while this is under development we do.
1609 BUFFER is a pointer to the bytes of the insn, target order.
1610 VALUE is the first base_insn_bitsize bits as an int in host order. */
1612 #ifndef CGEN_DIS_HASH
1613 #define CGEN_DIS_HASH_SIZE 256
1614 #define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
1617 /* The result is the hash value of the insn.
1618 Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file. */
1621 asm_hash_insn (mnem
)
1624 return CGEN_ASM_HASH (mnem
);
1627 /* BUF is a pointer to the bytes of the insn, target order.
1628 VALUE is the first base_insn_bitsize bits as an int in host order. */
1631 dis_hash_insn (buf
, value
)
1633 CGEN_INSN_INT value
;
1635 return CGEN_DIS_HASH (buf
, value
);
1638 /* Set the recorded length of the insn in the CGEN_FIELDS struct. */
1641 set_fields_bitsize (fields
, size
)
1642 CGEN_FIELDS
*fields
;
1645 CGEN_FIELDS_BITSIZE (fields
) = size
;
1648 /* Function to call before using the operand instance table.
1649 This plugs the opcode entries and macro instructions into the cpu table. */
1652 m32r_cgen_init_opcode_table (cd
)
1656 int num_macros
= (sizeof (m32r_cgen_macro_insn_table
) /
1657 sizeof (m32r_cgen_macro_insn_table
[0]));
1658 const CGEN_IBASE
*ib
= & m32r_cgen_macro_insn_table
[0];
1659 const CGEN_OPCODE
*oc
= & m32r_cgen_macro_insn_opcode_table
[0];
1660 CGEN_INSN
*insns
= (CGEN_INSN
*) xmalloc (num_macros
* sizeof (CGEN_INSN
));
1661 memset (insns
, 0, num_macros
* sizeof (CGEN_INSN
));
1662 for (i
= 0; i
< num_macros
; ++i
)
1664 insns
[i
].base
= &ib
[i
];
1665 insns
[i
].opcode
= &oc
[i
];
1667 cd
->macro_insn_table
.init_entries
= insns
;
1668 cd
->macro_insn_table
.entry_size
= sizeof (CGEN_IBASE
);
1669 cd
->macro_insn_table
.num_init_entries
= num_macros
;
1671 oc
= & m32r_cgen_insn_opcode_table
[0];
1672 insns
= (CGEN_INSN
*) cd
->insn_table
.init_entries
;
1673 for (i
= 0; i
< MAX_INSNS
; ++i
)
1674 insns
[i
].opcode
= &oc
[i
];
1676 cd
->sizeof_fields
= sizeof (CGEN_FIELDS
);
1677 cd
->set_fields_bitsize
= set_fields_bitsize
;
1679 cd
->asm_hash_p
= asm_hash_insn_p
;
1680 cd
->asm_hash
= asm_hash_insn
;
1681 cd
->asm_hash_size
= CGEN_ASM_HASH_SIZE
;
1683 cd
->dis_hash_p
= dis_hash_insn_p
;
1684 cd
->dis_hash
= dis_hash_insn
;
1685 cd
->dis_hash_size
= CGEN_DIS_HASH_SIZE
;