From 7c26196f5afeb25656f8c013a2ef13faeee25849 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 4 Feb 1998 01:54:47 +0000 Subject: [PATCH] * cgen-opc.c (cgen_set_cpu): Initialize hardware table. * m32r-opc.h, m32r-opc.c, m32r-asm.c, m32r-dis.c: Update. --- opcodes/ChangeLog | 15 + opcodes/m32r-opc.c | 1143 +++++++++++++++++++++++++++++++++++++--------------- opcodes/m32r-opc.h | 293 +++++++++++--- 3 files changed, 1058 insertions(+), 393 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 8cca45a..4bf5a8d 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,18 @@ +Tue Feb 3 17:19:40 1998 Doug Evans + + * cgen-opc.c (cgen_set_cpu): Initialize hardware table. + * m32r-opc.h, m32r-opc.c, m32r-asm.c, m32r-dis.c: Regenerate. + +Mon Feb 2 19:22:15 1998 Steve Haworth + + * tic30-dis.c: New file. + * disassemble.c (disassembler): Add bfd_arch_tic30 case. + * configure.in: Handle bfd_tic30_arch. + * Makefile.am: Rebuild dependencies. + (CFILES): Add tic30-dis.c + (ALL_MACHINES): Add tic30-dis.lo. + * configure, Makefile.in: Rebuild. + start-sanitize-m32rx Mon Feb 2 11:04:08 1998 Nick Clifton diff --git a/opcodes/m32r-opc.c b/opcodes/m32r-opc.c index deebaf3..38ad0de 100644 --- a/opcodes/m32r-opc.c +++ b/opcodes/m32r-opc.c @@ -1,5 +1,7 @@ /* CGEN opcode support for m32r. +This file is machine generated with CGEN. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU Binutils and/or GDB, the GNU debugger. @@ -30,13 +32,28 @@ with this program; if not, write to the Free Software Foundation, Inc., /* Attributes. */ -static const CGEN_ATTR_ENTRY MACH_attr[] = +static const CGEN_ATTR_ENTRY MACH_attr[] = { { "m32r", MACH_M32R }, +/* start-sanitize-m32rx */ + { "m32rx", MACH_M32RX }, +/* end-sanitize-m32rx */ + { "max", MACH_MAX }, + { 0, 0 } +}; + +/* start-sanitize-m32rx */ +static const CGEN_ATTR_ENTRY PIPE_attr[] = +{ + { "NONE", PIPE_NONE }, + { "O", PIPE_O }, + { "S", PIPE_S }, + { "OS", PIPE_OS }, { 0, 0 } }; -const CGEN_ATTR_TABLE m32r_cgen_operand_attr_table[] = +/* end-sanitize-m32rx */ +const CGEN_ATTR_TABLE m32r_cgen_operand_attr_table[] = { { "ABS-ADDR", NULL }, { "FAKE", NULL }, @@ -50,32 +67,22 @@ const CGEN_ATTR_TABLE m32r_cgen_operand_attr_table[] = { 0, 0 } }; -const CGEN_ATTR_TABLE m32r_cgen_insn_attr_table[] = +const CGEN_ATTR_TABLE m32r_cgen_insn_attr_table[] = { + { "MACH", & MACH_attr[0] }, +/* start-sanitize-m32rx */ + { "PIPE", & PIPE_attr[0] }, +/* end-sanitize-m32rx */ { "ALIAS", NULL }, { "COND-CTI", NULL }, { "FILL-SLOT", NULL }, + { "PARALLEL", NULL }, { "RELAX", NULL }, - { "RELAX-BC", NULL }, - { "RELAX-BL", NULL }, - { "RELAX-BNC", NULL }, - { "RELAX-BRA", NULL }, { "RELAXABLE", NULL }, { "UNCOND-CTI", NULL }, { 0, 0 } }; -CGEN_KEYWORD_ENTRY m32r_cgen_opval_mach_entries[] = -{ - { "m32r", MACH_M32R } -}; - -CGEN_KEYWORD m32r_cgen_opval_mach = -{ - & m32r_cgen_opval_mach_entries[0], - 1 -}; - CGEN_KEYWORD_ENTRY m32r_cgen_opval_h_gr_entries[] = { { "fp", 13 }, @@ -127,32 +134,52 @@ CGEN_KEYWORD m32r_cgen_opval_h_cr = 12 }; +/* start-sanitize-m32rx */ +CGEN_KEYWORD_ENTRY m32r_cgen_opval_h_accums_entries[] = +{ + { "a0", 0 }, + { "a1", 1 } +}; -static CGEN_HW_ENTRY m32r_cgen_hw_entries[] = +CGEN_KEYWORD m32r_cgen_opval_h_accums = { - { & m32r_cgen_hw_entries[1], "h-pc", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[2], "h-memory", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[3], "h-sint", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[4], "h-uint", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[5], "h-addr", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[6], "h-iaddr", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[7], "h-hi16", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[8], "h-slo16", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[9], "h-ulo16", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[10], "h-gr", CGEN_ASM_KEYWORD /*FIXME*/, & m32r_cgen_opval_h_gr }, - { & m32r_cgen_hw_entries[11], "h-cr", CGEN_ASM_KEYWORD /*FIXME*/, & m32r_cgen_opval_h_cr }, - { & m32r_cgen_hw_entries[12], "h-accum", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[13], "h-cond", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[14], "h-sm", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[15], "h-bsm", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[16], "h-ie", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[17], "h-bie", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { & m32r_cgen_hw_entries[18], "h-bcond", CGEN_ASM_KEYWORD /*FIXME*/, 0 }, - { NULL, "h-bpc", CGEN_ASM_KEYWORD /*FIXME*/, 0 } + & m32r_cgen_opval_h_accums_entries[0], + 2 }; +/* end-sanitize-m32rx */ + +static CGEN_HW_ENTRY m32r_cgen_hw_entries[] = +{ + { "h-pc", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-memory", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-sint", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-uint", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-addr", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-iaddr", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-hi16", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-slo16", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-ulo16", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-gr", CGEN_ASM_KEYWORD, (PTR) & m32r_cgen_opval_h_gr }, + { "h-cr", CGEN_ASM_KEYWORD, (PTR) & m32r_cgen_opval_h_cr }, + { "h-accum", CGEN_ASM_KEYWORD, (PTR) 0 }, +/* start-sanitize-m32rx */ + { "h-accums", CGEN_ASM_KEYWORD, (PTR) & m32r_cgen_opval_h_accums }, +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + { "h-abort", CGEN_ASM_KEYWORD, (PTR) 0 }, +/* end-sanitize-m32rx */ + { "h-cond", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-sm", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-bsm", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-ie", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-bie", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-bcond", CGEN_ASM_KEYWORD, (PTR) 0 }, + { "h-bpc", CGEN_ASM_KEYWORD, (PTR) 0 }, + { 0 } +}; -const CGEN_OPERAND m32r_cgen_operand_table[CGEN_NUM_OPERANDS] = +const CGEN_OPERAND m32r_cgen_operand_table[MAX_OPERANDS] = { /* pc: program counter */ { "pc", 0, 0, { 0, 0|(1< $dr,$sr */ /* 0 */ { OP, ' ', 130, ',', 129, 0 }, +/* $dr,$sr,#$slo16 */ +/* 1 */ { OP, ' ', 130, ',', 129, ',', '#', 143, 0 }, /* $dr,$sr,$slo16 */ -/* 1 */ { OP, ' ', 130, ',', 129, ',', 141, 0 }, +/* 2 */ { OP, ' ', 130, ',', 129, ',', 143, 0 }, +/* $dr,$sr,#$uimm16 */ +/* 3 */ { OP, ' ', 130, ',', 129, ',', '#', 139, 0 }, /* $dr,$sr,$uimm16 */ -/* 2 */ { OP, ' ', 130, ',', 129, ',', 139, 0 }, +/* 4 */ { OP, ' ', 130, ',', 129, ',', 139, 0 }, +/* $dr,$sr,#$ulo16 */ +/* 5 */ { OP, ' ', 130, ',', 129, ',', '#', 144, 0 }, /* $dr,$sr,$ulo16 */ -/* 3 */ { OP, ' ', 130, ',', 129, ',', 142, 0 }, +/* 6 */ { OP, ' ', 130, ',', 129, ',', 144, 0 }, +/* $dr,#$simm8 */ +/* 7 */ { OP, ' ', 130, ',', '#', 135, 0 }, /* $dr,$simm8 */ -/* 4 */ { OP, ' ', 130, ',', 135, 0 }, +/* 8 */ { OP, ' ', 130, ',', 135, 0 }, +/* $dr,$sr,#$simm16 */ +/* 9 */ { OP, ' ', 130, ',', 129, ',', '#', 136, 0 }, /* $dr,$sr,$simm16 */ -/* 5 */ { OP, ' ', 130, ',', 129, ',', 136, 0 }, +/* 10 */ { OP, ' ', 130, ',', 129, ',', 136, 0 }, /* $disp8 */ -/* 6 */ { OP, ' ', 144, 0 }, +/* 11 */ { OP, ' ', 146, 0 }, /* $disp24 */ -/* 7 */ { OP, ' ', 146, 0 }, +/* 12 */ { OP, ' ', 148, 0 }, /* $src1,$src2,$disp16 */ -/* 8 */ { OP, ' ', 131, ',', 132, ',', 145, 0 }, +/* 13 */ { OP, ' ', 131, ',', 132, ',', 147, 0 }, /* $src2,$disp16 */ -/* 9 */ { OP, ' ', 132, ',', 145, 0 }, +/* 14 */ { OP, ' ', 132, ',', 147, 0 }, /* $src1,$src2 */ -/* 10 */ { OP, ' ', 131, ',', 132, 0 }, +/* 15 */ { OP, ' ', 131, ',', 132, 0 }, +/* $src2,#$simm16 */ +/* 16 */ { OP, ' ', 132, ',', '#', 136, 0 }, /* $src2,$simm16 */ -/* 11 */ { OP, ' ', 132, ',', 136, 0 }, +/* 17 */ { OP, ' ', 132, ',', 136, 0 }, +/* $src2,#$uimm16 */ +/* 18 */ { OP, ' ', 132, ',', '#', 139, 0 }, /* $src2,$uimm16 */ -/* 12 */ { OP, ' ', 132, ',', 139, 0 }, +/* 19 */ { OP, ' ', 132, ',', 139, 0 }, +/* $src2 */ +/* 20 */ { OP, ' ', 132, 0 }, /* $sr */ -/* 13 */ { OP, ' ', 129, 0 }, +/* 21 */ { OP, ' ', 129, 0 }, /* $dr,@$sr */ -/* 14 */ { OP, ' ', 130, ',', '@', 129, 0 }, +/* 22 */ { OP, ' ', 130, ',', '@', 129, 0 }, /* $dr,@($sr) */ -/* 15 */ { OP, ' ', 130, ',', '@', '(', 129, ')', 0 }, +/* 23 */ { OP, ' ', 130, ',', '@', '(', 129, ')', 0 }, /* $dr,@($slo16,$sr) */ -/* 16 */ { OP, ' ', 130, ',', '@', '(', 141, ',', 129, ')', 0 }, +/* 24 */ { OP, ' ', 130, ',', '@', '(', 143, ',', 129, ')', 0 }, /* $dr,@($sr,$slo16) */ -/* 17 */ { OP, ' ', 130, ',', '@', '(', 129, ',', 141, ')', 0 }, +/* 25 */ { OP, ' ', 130, ',', '@', '(', 129, ',', 143, ')', 0 }, /* $dr,@$sr+ */ -/* 18 */ { OP, ' ', 130, ',', '@', 129, '+', 0 }, +/* 26 */ { OP, ' ', 130, ',', '@', 129, '+', 0 }, +/* $dr,#$uimm24 */ +/* 27 */ { OP, ' ', 130, ',', '#', 145, 0 }, /* $dr,$uimm24 */ -/* 19 */ { OP, ' ', 130, ',', 143, 0 }, +/* 28 */ { OP, ' ', 130, ',', 145, 0 }, /* $dr,$slo16 */ -/* 20 */ { OP, ' ', 130, ',', 141, 0 }, +/* 29 */ { OP, ' ', 130, ',', 143, 0 }, +/* $src1,$src2,$acc */ +/* 30 */ { OP, ' ', 131, ',', 132, ',', 141, 0 }, /* $dr */ -/* 21 */ { OP, ' ', 130, 0 }, +/* 31 */ { OP, ' ', 130, 0 }, +/* $dr,$accs */ +/* 32 */ { OP, ' ', 130, ',', 140, 0 }, /* $dr,$scr */ -/* 22 */ { OP, ' ', 130, ',', 133, 0 }, +/* 33 */ { OP, ' ', 130, ',', 133, 0 }, /* $src1 */ -/* 23 */ { OP, ' ', 131, 0 }, +/* 34 */ { OP, ' ', 131, 0 }, +/* $src1,$accs */ +/* 35 */ { OP, ' ', 131, ',', 140, 0 }, /* $sr,$dcr */ -/* 24 */ { OP, ' ', 129, ',', 134, 0 }, +/* 36 */ { OP, ' ', 129, ',', 134, 0 }, /* */ -/* 25 */ { OP, 0 }, +/* 37 */ { OP, 0 }, +/* $accs */ +/* 38 */ { OP, ' ', 140, 0 }, +/* $dr,#$hi16 */ +/* 39 */ { OP, ' ', 130, ',', '#', 142, 0 }, /* $dr,$hi16 */ -/* 26 */ { OP, ' ', 130, ',', 140, 0 }, +/* 40 */ { OP, ' ', 130, ',', 142, 0 }, +/* $dr,#$uimm5 */ +/* 41 */ { OP, ' ', 130, ',', '#', 138, 0 }, /* $dr,$uimm5 */ -/* 27 */ { OP, ' ', 130, ',', 138, 0 }, +/* 42 */ { OP, ' ', 130, ',', 138, 0 }, /* $src1,@$src2 */ -/* 28 */ { OP, ' ', 131, ',', '@', 132, 0 }, +/* 43 */ { OP, ' ', 131, ',', '@', 132, 0 }, /* $src1,@($src2) */ -/* 29 */ { OP, ' ', 131, ',', '@', '(', 132, ')', 0 }, +/* 44 */ { OP, ' ', 131, ',', '@', '(', 132, ')', 0 }, /* $src1,@($slo16,$src2) */ -/* 30 */ { OP, ' ', 131, ',', '@', '(', 141, ',', 132, ')', 0 }, +/* 45 */ { OP, ' ', 131, ',', '@', '(', 143, ',', 132, ')', 0 }, /* $src1,@($src2,$slo16) */ -/* 31 */ { OP, ' ', 131, ',', '@', '(', 132, ',', 141, ')', 0 }, +/* 46 */ { OP, ' ', 131, ',', '@', '(', 132, ',', 143, ')', 0 }, /* $src1,@+$src2 */ -/* 32 */ { OP, ' ', 131, ',', '@', '+', 132, 0 }, +/* 47 */ { OP, ' ', 131, ',', '@', '+', 132, 0 }, /* $src1,@-$src2 */ -/* 33 */ { OP, ' ', 131, ',', '@', '-', 132, 0 }, +/* 48 */ { OP, ' ', 131, ',', '@', '-', 132, 0 }, +/* #$uimm4 */ +/* 49 */ { OP, ' ', '#', 137, 0 }, /* $uimm4 */ -/* 34 */ { OP, ' ', 137, 0 }, +/* 50 */ { OP, ' ', 137, 0 }, +/* $dr,$src2 */ +/* 51 */ { OP, ' ', 130, ',', 132, 0 }, }; #undef OP @@ -304,39 +377,51 @@ static const CGEN_FORMAT format_table[] = /* 11 */ { 32, 32, 0xfff00000 }, /* f-op1.number.f-r1.number.f-op2.number.f-r2.src2.f-uimm16.uimm16. */ /* 12 */ { 32, 32, 0xfff00000 }, +/* f-op1.number.f-r1.number.f-op2.number.f-r2.src2. */ +/* 13 */ { 16, 16, 0xfff0 }, /* f-op1.number.f-r1.dr.f-op2.number.f-r2.sr.f-simm16.number. */ -/* 13 */ { 32, 32, 0xf0f0ffff }, +/* 14 */ { 32, 32, 0xf0f0ffff }, /* f-op1.number.f-r1.number.f-op2.number.f-r2.sr. */ -/* 14 */ { 16, 16, 0xfff0 }, +/* 15 */ { 16, 16, 0xfff0 }, /* f-op1.number.f-r1.dr.f-uimm24.uimm24. */ -/* 15 */ { 32, 32, 0xf0000000 }, +/* 16 */ { 32, 32, 0xf0000000 }, /* f-op1.number.f-r1.dr.f-op2.number.f-r2.number.f-simm16.slo16. */ -/* 16 */ { 32, 32, 0xf0ff0000 }, +/* 17 */ { 32, 32, 0xf0ff0000 }, +/* f-op1.number.f-r1.src1.f-acc.acc.f-op23.number.f-r2.src2. */ +/* 18 */ { 16, 16, 0xf070 }, /* f-op1.number.f-r1.dr.f-op2.number.f-r2.number. */ -/* 17 */ { 16, 16, 0xf0ff }, +/* 19 */ { 16, 16, 0xf0ff }, +/* f-op1.number.f-r1.dr.f-op2.number.f-accs.accs.f-op3.number. */ +/* 20 */ { 16, 16, 0xf0f3 }, /* f-op1.number.f-r1.dr.f-op2.number.f-r2.scr. */ -/* 18 */ { 16, 16, 0xf0f0 }, +/* 21 */ { 16, 16, 0xf0f0 }, /* f-op1.number.f-r1.src1.f-op2.number.f-r2.number. */ -/* 19 */ { 16, 16, 0xf0ff }, +/* 22 */ { 16, 16, 0xf0ff }, +/* f-op1.number.f-r1.src1.f-op2.number.f-accs.accs.f-op3.number. */ +/* 23 */ { 16, 16, 0xf0f3 }, /* f-op1.number.f-r1.dcr.f-op2.number.f-r2.sr. */ -/* 20 */ { 16, 16, 0xf0f0 }, +/* 24 */ { 16, 16, 0xf0f0 }, /* f-op1.number.f-r1.number.f-op2.number.f-r2.number. */ -/* 21 */ { 16, 16, 0xffff }, +/* 25 */ { 16, 16, 0xffff }, +/* f-op1.number.f-r1.number.f-op2.number.f-accs.accs.f-op3.number. */ +/* 26 */ { 16, 16, 0xfff3 }, /* f-op1.number.f-r1.dr.f-op2.number.f-r2.number.f-hi16.hi16. */ -/* 22 */ { 32, 32, 0xf0ff0000 }, +/* 27 */ { 32, 32, 0xf0ff0000 }, /* f-op1.number.f-r1.dr.f-shift-op2.number.f-uimm5.uimm5. */ -/* 23 */ { 16, 16, 0xf0e0 }, +/* 28 */ { 16, 16, 0xf0e0 }, /* f-op1.number.f-r1.src1.f-op2.number.f-r2.src2.f-simm16.slo16. */ -/* 24 */ { 32, 32, 0xf0f00000 }, +/* 29 */ { 32, 32, 0xf0f00000 }, /* f-op1.number.f-r1.number.f-op2.number.f-uimm4.uimm4. */ -/* 25 */ { 16, 16, 0xfff0 }, +/* 30 */ { 16, 16, 0xfff0 }, +/* f-op1.number.f-r1.dr.f-op2.number.f-r2.src2.f-uimm16.number. */ +/* 31 */ { 32, 32, 0xf0f0ffff }, }; #define A(a) (1 << CGEN_CAT3 (CGEN_INSN,_,a)) #define SYN(n) (& syntax_table[n]) #define FMT(n) (& format_table[n]) -const CGEN_INSN m32r_cgen_insn_table_entries[CGEN_NUM_INSNS] = +const CGEN_INSN m32r_cgen_insn_table_entries[MAX_INSNS] = { /* null first entry, end of all hash chains */ { { 0 }, 0 }, @@ -344,764 +429,1150 @@ const CGEN_INSN m32r_cgen_insn_table_entries[CGEN_NUM_INSNS] = { { 1, 1, 1, 1 }, "add", "add", SYN (0), FMT (0), 0xa0, - { 0, 0, { 0 } } + { 2, 0|A(PARALLEL), { (1<f_uimm16 = * valuep; break; +/* start-sanitize-m32rx */ + case M32R_OPERAND_ACCS : + fields->f_accs = * valuep; + break; +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + case M32R_OPERAND_ACC : + fields->f_acc = * valuep; + break; +/* end-sanitize-m32rx */ case M32R_OPERAND_HI16 : fields->f_hi16 = * valuep; break; @@ -1264,6 +1745,16 @@ m32r_cgen_get_operand (opindex, fields) case M32R_OPERAND_UIMM16 : value = fields->f_uimm16; break; +/* start-sanitize-m32rx */ + case M32R_OPERAND_ACCS : + value = fields->f_accs; + break; +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + case M32R_OPERAND_ACC : + value = fields->f_acc; + break; +/* end-sanitize-m32rx */ case M32R_OPERAND_HI16 : value = fields->f_hi16; break; diff --git a/opcodes/m32r-opc.h b/opcodes/m32r-opc.h index 62b3f6c..79b1415 100644 --- a/opcodes/m32r-opc.h +++ b/opcodes/m32r-opc.h @@ -1,5 +1,7 @@ /* Instruction description for m32r. +This file is machine generated with CGEN. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU Binutils and/or GDB, the GNU debugger. @@ -30,6 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc., /* Selected cpu families. */ #define HAVE_CPU_M32R +/* start-sanitize-m32rx */ +#define HAVE_CPU_M32RX +/* end-sanitize-m32rx */ #define CGEN_WORD_BITSIZE 32 #define CGEN_DEFAULT_INSN_BITSIZE 32 @@ -40,14 +45,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #define CGEN_MAX_INSN_SIZE (CGEN_MAX_INSN_BITSIZE / 8) #define CGEN_INT_INSN -/* +1 because the first entry is reserved (null) */ -#define CGEN_NUM_INSNS (127 + 1) -#define CGEN_NUM_OPERANDS (21) - -/* Number of non-boolean attributes. */ -#define CGEN_MAX_INSN_ATTRS 0 -#define CGEN_MAX_OPERAND_ATTRS 0 - /* FIXME: Need to compute CGEN_MAX_SYNTAX_BYTES. */ /* CGEN_MNEMONIC_OPERANDS is defined if mnemonics have operands. @@ -55,102 +52,250 @@ with this program; if not, write to the Free Software Foundation, Inc., we can't hash on everything up to the space. */ #define CGEN_MNEMONIC_OPERANDS -/* Number of architecture variants. */ -#define MAX_MACHS 1 - /* Enums. */ /* Enum declaration for insn format enums. */ typedef enum insn_op1 { - OP1_0 = 0, OP1_1 = 1, OP1_2 = 2, OP1_3 = 3, - OP1_4 = 4, OP1_5 = 5, OP1_6 = 6, OP1_7 = 7, - OP1_8 = 8, OP1_9 = 9, OP1_10 = 10, OP1_11 = 11, - OP1_12 = 12, OP1_13 = 13, OP1_14 = 14, OP1_15 = 15 + OP1_0, OP1_1, OP1_2, OP1_3 + , OP1_4, OP1_5, OP1_6, OP1_7 + , OP1_8, OP1_9, OP1_10, OP1_11 + , OP1_12, OP1_13, OP1_14, OP1_15 } INSN_OP1; /* Enum declaration for op2 enums. */ typedef enum insn_op2 { - OP2_0 = 0, OP2_1 = 1, OP2_2 = 2, OP2_3 = 3, - OP2_4 = 4, OP2_5 = 5, OP2_6 = 6, OP2_7 = 7, - OP2_8 = 8, OP2_9 = 9, OP2_10 = 10, OP2_11 = 11, - OP2_12 = 12, OP2_13 = 13, OP2_14 = 14, OP2_15 = 15 + OP2_0, OP2_1, OP2_2, OP2_3 + , OP2_4, OP2_5, OP2_6, OP2_7 + , OP2_8, OP2_9, OP2_10, OP2_11 + , OP2_12, OP2_13, OP2_14, OP2_15 } INSN_OP2; /* Enum declaration for m32r operand types. */ typedef enum cgen_operand_type { - M32R_OPERAND_PC = 0, M32R_OPERAND_SR = 1, M32R_OPERAND_DR = 2, M32R_OPERAND_SRC1 = 3, - M32R_OPERAND_SRC2 = 4, M32R_OPERAND_SCR = 5, M32R_OPERAND_DCR = 6, M32R_OPERAND_SIMM8 = 7, - M32R_OPERAND_SIMM16 = 8, M32R_OPERAND_UIMM4 = 9, M32R_OPERAND_UIMM5 = 10, M32R_OPERAND_UIMM16 = 11, - M32R_OPERAND_HI16 = 12, M32R_OPERAND_SLO16 = 13, M32R_OPERAND_ULO16 = 14, M32R_OPERAND_UIMM24 = 15, - M32R_OPERAND_DISP8 = 16, M32R_OPERAND_DISP16 = 17, M32R_OPERAND_DISP24 = 18, M32R_OPERAND_CONDBIT = 19, - M32R_OPERAND_ACCUM = 20 + M32R_OPERAND_PC, M32R_OPERAND_SR, M32R_OPERAND_DR, M32R_OPERAND_SRC1 + , M32R_OPERAND_SRC2, M32R_OPERAND_SCR, M32R_OPERAND_DCR, M32R_OPERAND_SIMM8 + , M32R_OPERAND_SIMM16, M32R_OPERAND_UIMM4, M32R_OPERAND_UIMM5, M32R_OPERAND_UIMM16 +/* start-sanitize-m32rx */ + , M32R_OPERAND_ACCS +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_OPERAND_ACC +/* end-sanitize-m32rx */ + , M32R_OPERAND_HI16, M32R_OPERAND_SLO16, M32R_OPERAND_ULO16, M32R_OPERAND_UIMM24 + , M32R_OPERAND_DISP8, M32R_OPERAND_DISP16, M32R_OPERAND_DISP24, M32R_OPERAND_CONDBIT + , M32R_OPERAND_ACCUM +/* start-sanitize-m32rx */ + , M32R_OPERAND_ABORT_PARALLEL_EXECUTION +/* end-sanitize-m32rx */ + , M32R_OPERAND_MAX } CGEN_OPERAND_TYPE; /* Non-boolean attributes. */ /* Enum declaration for machine type selection. */ typedef enum mach_attr { - MACH_M32R = 0 + MACH_M32R +/* start-sanitize-m32rx */ + , MACH_M32RX +/* end-sanitize-m32rx */ + , MACH_MAX } MACH_ATTR; +/* start-sanitize-m32rx */ +/* Enum declaration for parallel execution pipeline selection. */ +typedef enum pipe_attr { + PIPE_NONE, PIPE_O, PIPE_S, PIPE_OS +} PIPE_ATTR; + +/* end-sanitize-m32rx */ +/* Number of architecture variants. */ +#define MAX_MACHS ((int) MACH_MAX) + +/* Number of operands. */ +#define MAX_OPERANDS ((int) M32R_OPERAND_MAX) + /* Operand and instruction attribute indices. */ /* Enum declaration for cgen_operand attrs. */ typedef enum cgen_operand_attr { - CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_FAKE, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_PC, - CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_RELAX, CGEN_OPERAND_RELOC, CGEN_OPERAND_SIGN_OPT, - CGEN_OPERAND_UNSIGNED + CGEN_OPERAND_ABS_ADDR, CGEN_OPERAND_FAKE, CGEN_OPERAND_NEGATIVE, CGEN_OPERAND_PC + , CGEN_OPERAND_PCREL_ADDR, CGEN_OPERAND_RELAX, CGEN_OPERAND_RELOC, CGEN_OPERAND_SIGN_OPT + , CGEN_OPERAND_UNSIGNED } CGEN_OPERAND_ATTR; +/* Number of non-boolean elements in cgen_operand. */ +#define CGEN_OPERAND_MAX_ATTRS ((int) CGEN_OPERAND_ABS_ADDR) + /* Enum declaration for cgen_insn attrs. */ typedef enum cgen_insn_attr { - CGEN_INSN_ALIAS, CGEN_INSN_COND_CTI, CGEN_INSN_FILL_SLOT, CGEN_INSN_RELAX, - CGEN_INSN_RELAX_BC, CGEN_INSN_RELAX_BL, CGEN_INSN_RELAX_BNC, CGEN_INSN_RELAX_BRA, - CGEN_INSN_RELAXABLE, CGEN_INSN_UNCOND_CTI + CGEN_INSN_MACH +/* start-sanitize-m32rx */ + , CGEN_INSN_PIPE +/* end-sanitize-m32rx */ + , CGEN_INSN_ALIAS, CGEN_INSN_COND_CTI, CGEN_INSN_FILL_SLOT, CGEN_INSN_PARALLEL + , CGEN_INSN_RELAX, CGEN_INSN_RELAXABLE, CGEN_INSN_UNCOND_CTI } CGEN_INSN_ATTR; +/* Number of non-boolean elements in cgen_insn. */ +#define CGEN_INSN_MAX_ATTRS ((int) CGEN_INSN_ALIAS) + /* Insn types are used by the simulator. */ /* Enum declaration for m32r instruction types. */ typedef enum cgen_insn_type { - M32R_INSN_ILLEGAL, M32R_INSN_ADD, M32R_INSN_ADD3, M32R_INSN_AND, - M32R_INSN_AND3, M32R_INSN_OR, M32R_INSN_OR3, M32R_INSN_XOR, - M32R_INSN_XOR3, M32R_INSN_ADDI, M32R_INSN_ADDV, M32R_INSN_ADDV3, - M32R_INSN_ADDX, M32R_INSN_BC8, M32R_INSN_BC8_S, M32R_INSN_BC24, - M32R_INSN_BC24_L, M32R_INSN_BEQ, M32R_INSN_BEQZ, M32R_INSN_BGEZ, - M32R_INSN_BGTZ, M32R_INSN_BLEZ, M32R_INSN_BLTZ, M32R_INSN_BNEZ, - M32R_INSN_BL8, M32R_INSN_BL8_S, M32R_INSN_BL24, M32R_INSN_BL24_L, - M32R_INSN_BNC8, M32R_INSN_BNC8_S, M32R_INSN_BNC24, M32R_INSN_BNC24_L, - M32R_INSN_BNE, M32R_INSN_BRA8, M32R_INSN_BRA8_S, M32R_INSN_BRA24, - M32R_INSN_BRA24_L, M32R_INSN_CMP, M32R_INSN_CMPI, M32R_INSN_CMPU, - M32R_INSN_CMPUI, M32R_INSN_DIV, M32R_INSN_DIVU, M32R_INSN_REM, - M32R_INSN_REMU, M32R_INSN_JL, M32R_INSN_JMP, M32R_INSN_LD, - M32R_INSN_LD_2, M32R_INSN_LD_D, M32R_INSN_LD_D2, M32R_INSN_LDB, - M32R_INSN_LDB_2, M32R_INSN_LDB_D, M32R_INSN_LDB_D2, M32R_INSN_LDH, - M32R_INSN_LDH_2, M32R_INSN_LDH_D, M32R_INSN_LDH_D2, M32R_INSN_LDUB, - M32R_INSN_LDUB_2, M32R_INSN_LDUB_D, M32R_INSN_LDUB_D2, M32R_INSN_LDUH, - M32R_INSN_LDUH_2, M32R_INSN_LDUH_D, M32R_INSN_LDUH_D2, M32R_INSN_LD_PLUS, - M32R_INSN_LD24, M32R_INSN_LDI8, M32R_INSN_LDI8A, M32R_INSN_LDI16, - M32R_INSN_LDI16A, M32R_INSN_LOCK, M32R_INSN_MACHI, M32R_INSN_MACLO, - M32R_INSN_MACWHI, M32R_INSN_MACWLO, M32R_INSN_MUL, M32R_INSN_MULHI, - M32R_INSN_MULLO, M32R_INSN_MULWHI, M32R_INSN_MULWLO, M32R_INSN_MV, - M32R_INSN_MVFACHI, M32R_INSN_MVFACLO, M32R_INSN_MVFACMI, M32R_INSN_MVFC, - M32R_INSN_MVTACHI, M32R_INSN_MVTACLO, M32R_INSN_MVTC, M32R_INSN_NEG, - M32R_INSN_NOP, M32R_INSN_NOT, M32R_INSN_RAC, M32R_INSN_RACH, - M32R_INSN_RTE, M32R_INSN_SETH, M32R_INSN_SLL, M32R_INSN_SLL3, - M32R_INSN_SLLI, M32R_INSN_SRA, M32R_INSN_SRA3, M32R_INSN_SRAI, - M32R_INSN_SRL, M32R_INSN_SRL3, M32R_INSN_SRLI, M32R_INSN_ST, - M32R_INSN_ST_2, M32R_INSN_ST_D, M32R_INSN_ST_D2, M32R_INSN_STB, - M32R_INSN_STB_2, M32R_INSN_STB_D, M32R_INSN_STB_D2, M32R_INSN_STH, - M32R_INSN_STH_2, M32R_INSN_STH_D, M32R_INSN_STH_D2, M32R_INSN_ST_PLUS, - M32R_INSN_ST_MINUS, M32R_INSN_SUB, M32R_INSN_SUBV, M32R_INSN_SUBX, - M32R_INSN_TRAP, M32R_INSN_UNLOCK, M32R_INSN_PUSH, M32R_INSN_POP, - M32R_INSN_MAX + M32R_INSN_ILLEGAL, M32R_INSN_ADD, M32R_INSN_ADD3, M32R_INSN_ADD3_A + , M32R_INSN_AND, M32R_INSN_AND3, M32R_INSN_AND3_A, M32R_INSN_OR + , M32R_INSN_OR3, M32R_INSN_OR3_A, M32R_INSN_XOR, M32R_INSN_XOR3 + , M32R_INSN_XOR3_A, M32R_INSN_ADDI, M32R_INSN_ADDI_A, M32R_INSN_ADDV + , M32R_INSN_ADDV3, M32R_INSN_ADDV3_A, M32R_INSN_ADDX, M32R_INSN_BC8 + , M32R_INSN_BC8_S, M32R_INSN_BC24, M32R_INSN_BC24_L, M32R_INSN_BEQ + , M32R_INSN_BEQZ, M32R_INSN_BGEZ, M32R_INSN_BGTZ, M32R_INSN_BLEZ + , M32R_INSN_BLTZ, M32R_INSN_BNEZ, M32R_INSN_BL8, M32R_INSN_BL8_S + , M32R_INSN_BL24, M32R_INSN_BL24_L +/* start-sanitize-m32rx */ + , M32R_INSN_BCL8 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_BCL8_S +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_BCL24 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_BCL24_L +/* end-sanitize-m32rx */ + , M32R_INSN_BNC8, M32R_INSN_BNC8_S, M32R_INSN_BNC24, M32R_INSN_BNC24_L + , M32R_INSN_BNE, M32R_INSN_BRA8, M32R_INSN_BRA8_S, M32R_INSN_BRA24 + , M32R_INSN_BRA24_L +/* start-sanitize-m32rx */ + , M32R_INSN_BNCL8 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_BNCL8_S +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_BNCL24 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_BNCL24_L +/* end-sanitize-m32rx */ + , M32R_INSN_CMP, M32R_INSN_CMPI, M32R_INSN_CMPI_A, M32R_INSN_CMPU + , M32R_INSN_CMPUI, M32R_INSN_CMPUI_A +/* start-sanitize-m32rx */ + , M32R_INSN_CMPEQ +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_CMPZ +/* end-sanitize-m32rx */ + , M32R_INSN_DIV, M32R_INSN_DIVU, M32R_INSN_REM, M32R_INSN_REMU +/* start-sanitize-m32rx */ + , M32R_INSN_JC +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_JNC +/* end-sanitize-m32rx */ + , M32R_INSN_JL, M32R_INSN_JMP, M32R_INSN_LD, M32R_INSN_LD_2 + , M32R_INSN_LD_D, M32R_INSN_LD_D2, M32R_INSN_LDB, M32R_INSN_LDB_2 + , M32R_INSN_LDB_D, M32R_INSN_LDB_D2, M32R_INSN_LDH, M32R_INSN_LDH_2 + , M32R_INSN_LDH_D, M32R_INSN_LDH_D2, M32R_INSN_LDUB, M32R_INSN_LDUB_2 + , M32R_INSN_LDUB_D, M32R_INSN_LDUB_D2, M32R_INSN_LDUH, M32R_INSN_LDUH_2 + , M32R_INSN_LDUH_D, M32R_INSN_LDUH_D2, M32R_INSN_LD_PLUS, M32R_INSN_LD24 + , M32R_INSN_LD24_A, M32R_INSN_LDI8, M32R_INSN_LDI8_A, M32R_INSN_LDI8A + , M32R_INSN_LDI8A_A, M32R_INSN_LDI16, M32R_INSN_LDI16A, M32R_INSN_LOCK + , M32R_INSN_MACHI +/* start-sanitize-m32rx */ + , M32R_INSN_MACHI_A +/* end-sanitize-m32rx */ + , M32R_INSN_MACLO +/* start-sanitize-m32rx */ + , M32R_INSN_MACLO_A +/* end-sanitize-m32rx */ + , M32R_INSN_MACWHI, M32R_INSN_MACWLO, M32R_INSN_MUL, M32R_INSN_MULHI +/* start-sanitize-m32rx */ + , M32R_INSN_MULHI_A +/* end-sanitize-m32rx */ + , M32R_INSN_MULLO +/* start-sanitize-m32rx */ + , M32R_INSN_MULLO_A +/* end-sanitize-m32rx */ + , M32R_INSN_MULWHI, M32R_INSN_MULWLO, M32R_INSN_MV, M32R_INSN_MVFACHI +/* start-sanitize-m32rx */ + , M32R_INSN_MVFACHI_A +/* end-sanitize-m32rx */ + , M32R_INSN_MVFACLO +/* start-sanitize-m32rx */ + , M32R_INSN_MVFACLO_A +/* end-sanitize-m32rx */ + , M32R_INSN_MVFACMI +/* start-sanitize-m32rx */ + , M32R_INSN_MVFACMI_A +/* end-sanitize-m32rx */ + , M32R_INSN_MVFC, M32R_INSN_MVTACHI +/* start-sanitize-m32rx */ + , M32R_INSN_MVTACHI_A +/* end-sanitize-m32rx */ + , M32R_INSN_MVTACLO +/* start-sanitize-m32rx */ + , M32R_INSN_MVTACLO_A +/* end-sanitize-m32rx */ + , M32R_INSN_MVTC, M32R_INSN_NEG, M32R_INSN_NOP, M32R_INSN_NOT + , M32R_INSN_RAC +/* start-sanitize-m32rx */ + , M32R_INSN_RAC_A +/* end-sanitize-m32rx */ + , M32R_INSN_RACH +/* start-sanitize-m32rx */ + , M32R_INSN_RACH_A +/* end-sanitize-m32rx */ + , M32R_INSN_RTE, M32R_INSN_SETH, M32R_INSN_SETH_A, M32R_INSN_SLL + , M32R_INSN_SLL3, M32R_INSN_SLL3_A, M32R_INSN_SLLI, M32R_INSN_SLLI_A + , M32R_INSN_SRA, M32R_INSN_SRA3, M32R_INSN_SRA3_A, M32R_INSN_SRAI + , M32R_INSN_SRAI_A, M32R_INSN_SRL, M32R_INSN_SRL3, M32R_INSN_SRL3_A + , M32R_INSN_SRLI, M32R_INSN_SRLI_A, M32R_INSN_ST, M32R_INSN_ST_2 + , M32R_INSN_ST_D, M32R_INSN_ST_D2, M32R_INSN_STB, M32R_INSN_STB_2 + , M32R_INSN_STB_D, M32R_INSN_STB_D2, M32R_INSN_STH, M32R_INSN_STH_2 + , M32R_INSN_STH_D, M32R_INSN_STH_D2, M32R_INSN_ST_PLUS, M32R_INSN_ST_MINUS + , M32R_INSN_SUB, M32R_INSN_SUBV, M32R_INSN_SUBX, M32R_INSN_TRAP + , M32R_INSN_TRAP_A, M32R_INSN_UNLOCK, M32R_INSN_PUSH, M32R_INSN_POP +/* start-sanitize-m32rx */ + , M32R_INSN_SATB +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_SATH +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_SAT +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_PCMPBZ +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_SADD +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_MACWU1 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_MSBLO +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_MULWU1 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_MACHL1 +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_SC +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + , M32R_INSN_SNC +/* end-sanitize-m32rx */ + , M32R_INSN_MAX } CGEN_INSN_TYPE; /* Index of `illegal' insn place holder. */ #define CGEN_INSN_ILLEGAL M32R_INSN_ILLEGAL /* Total number of insns in table. */ -#define CGEN_MAX_INSNS ((int) M32R_INSN_MAX) +#define MAX_INSNS ((int) M32R_INSN_MAX) /* cgen.h uses things we just defined. */ #include "opcode/cgen.h" @@ -175,6 +320,18 @@ typedef struct cgen_fields long f_disp8; long f_disp16; long f_disp24; +/* start-sanitize-m32rx */ + long f_op23; +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + long f_op3; +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + long f_acc; +/* end-sanitize-m32rx */ +/* start-sanitize-m32rx */ + long f_accs; +/* end-sanitize-m32rx */ int length; } CGEN_FIELDS; @@ -182,9 +339,11 @@ typedef struct cgen_fields extern const CGEN_ATTR_TABLE m32r_cgen_operand_attr_table[]; extern const CGEN_ATTR_TABLE m32r_cgen_insn_attr_table[]; -extern CGEN_KEYWORD m32r_cgen_opval_mach; extern CGEN_KEYWORD m32r_cgen_opval_h_gr; extern CGEN_KEYWORD m32r_cgen_opval_h_cr; +/* start-sanitize-m32rx */ +extern CGEN_KEYWORD m32r_cgen_opval_h_accums; +/* end-sanitize-m32rx */ #define CGEN_INIT_PARSE() \ {\ -- 2.7.4