From 1fa60b5dde8d6e82e4c8589c1b76b4b8a8730f22 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 5 Oct 1999 00:05:52 +0000 Subject: [PATCH] * fr30-asm.c,fr30-desc.h: Rebuild. * m32r-asm.c,m32r-desc.c,m32r-desc.h: Rebuild. Add m32rx support. * m32r-dis.c,m32r-ibld.c,m32r-opc.c,m32r-opc.h,m32r-opinst.c: Ditto. --- opcodes/ChangeLog | 6 + opcodes/fr30-asm.c | 13 +- opcodes/fr30-desc.h | 1 + opcodes/m32r-asm.c | 25 ++- opcodes/m32r-desc.c | 419 ++++++++++++++++++++++++++++++++---------- opcodes/m32r-desc.h | 21 ++- opcodes/m32r-dis.c | 12 ++ opcodes/m32r-ibld.c | 81 ++++++++ opcodes/m32r-opc.c | 416 +++++++++++++++++++++++++++++++++++++---- opcodes/m32r-opc.h | 53 +++--- opcodes/m32r-opinst.c | 141 ++++++++++++++ 11 files changed, 1024 insertions(+), 164 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index d0ae03368f..1e2e55cc0b 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +1999-10-04 Doug Evans + + * fr30-asm.c,fr30-desc.h: Rebuild. + * m32r-asm.c,m32r-desc.c,m32r-desc.h: Rebuild. Add m32rx support. + * m32r-dis.c,m32r-ibld.c,m32r-opc.c,m32r-opc.h,m32r-opinst.c: Ditto. + 1999-09-29 Nick Clifton * sh-opc.h: Fix bit patterns for several load and store diff --git a/opcodes/fr30-asm.c b/opcodes/fr30-asm.c index b9f80107a3..6038dbba91 100644 --- a/opcodes/fr30-asm.c +++ b/opcodes/fr30-asm.c @@ -364,9 +364,14 @@ parse_insn_normal (cd, insn, strp, fields) p = CGEN_INSN_MNEMONIC (insn); while (*p && tolower (*p) == tolower (*str)) ++p, ++str; - - if (* p || (* str && !isspace (* str))) + + if (* p) + return _("unrecognized instruction"); + +#ifndef CGEN_MNEMONIC_OPERANDS + if (* str && !isspace (* str)) return _("unrecognized instruction"); +#endif CGEN_INIT_PARSE (cd); cgen_init_parse_operand (cd); @@ -389,6 +394,10 @@ parse_insn_normal (cd, insn, strp, fields) /* Non operand chars must match exactly. */ if (CGEN_SYNTAX_CHAR_P (* syn)) { + /* FIXME: While we allow for non-GAS callers above, we assume the + first char after the mnemonic part is a space. */ + /* FIXME: We also take inappropriate advantage of the fact that + GAS's input scrubber will remove extraneous blanks. */ if (*str == CGEN_SYNTAX_CHAR (* syn)) { #ifdef CGEN_MNEMONIC_OPERANDS diff --git a/opcodes/fr30-desc.h b/opcodes/fr30-desc.h index a1ff45ea02..97e29cd1bd 100644 --- a/opcodes/fr30-desc.h +++ b/opcodes/fr30-desc.h @@ -49,6 +49,7 @@ with this program; if not, write to the Free Software Foundation, Inc., e.g. In "b,a foo" the ",a" is an operand. If mnemonics have operands we can't hash on everything up to the space. */ #define CGEN_MNEMONIC_OPERANDS + /* Maximum number of operands any insn or macro-insn has. */ #define CGEN_MAX_INSN_OPERANDS 16 diff --git a/opcodes/m32r-asm.c b/opcodes/m32r-asm.c index 0d67c92da9..2d3bd96e72 100644 --- a/opcodes/m32r-asm.c +++ b/opcodes/m32r-asm.c @@ -222,6 +222,15 @@ m32r_cgen_parse_operand (cd, opindex, strp, fields) switch (opindex) { + case M32R_OPERAND_ACC : + errmsg = cgen_parse_keyword (cd, strp, & m32r_cgen_opval_h_accums, & fields->f_acc); + break; + case M32R_OPERAND_ACCD : + errmsg = cgen_parse_keyword (cd, strp, & m32r_cgen_opval_h_accums, & fields->f_accd); + break; + case M32R_OPERAND_ACCS : + errmsg = cgen_parse_keyword (cd, strp, & m32r_cgen_opval_h_accums, & fields->f_accs); + break; case M32R_OPERAND_DCR : errmsg = cgen_parse_keyword (cd, strp, & m32r_cgen_opval_cr_names, & fields->f_r1); break; @@ -255,6 +264,9 @@ m32r_cgen_parse_operand (cd, opindex, strp, fields) case M32R_OPERAND_HI16 : errmsg = parse_hi16 (cd, strp, M32R_OPERAND_HI16, &fields->f_hi16); break; + case M32R_OPERAND_IMM1 : + errmsg = cgen_parse_unsigned_integer (cd, strp, M32R_OPERAND_IMM1, &fields->f_imm1); + break; case M32R_OPERAND_SCR : errmsg = cgen_parse_keyword (cd, strp, & m32r_cgen_opval_cr_names, & fields->f_r2); break; @@ -360,9 +372,14 @@ parse_insn_normal (cd, insn, strp, fields) p = CGEN_INSN_MNEMONIC (insn); while (*p && tolower (*p) == tolower (*str)) ++p, ++str; - - if (* p || (* str && !isspace (* str))) + + if (* p) + return _("unrecognized instruction"); + +#ifndef CGEN_MNEMONIC_OPERANDS + if (* str && !isspace (* str)) return _("unrecognized instruction"); +#endif CGEN_INIT_PARSE (cd); cgen_init_parse_operand (cd); @@ -385,6 +402,10 @@ parse_insn_normal (cd, insn, strp, fields) /* Non operand chars must match exactly. */ if (CGEN_SYNTAX_CHAR_P (* syn)) { + /* FIXME: While we allow for non-GAS callers above, we assume the + first char after the mnemonic part is a space. */ + /* FIXME: We also take inappropriate advantage of the fact that + GAS's input scrubber will remove extraneous blanks. */ if (*str == CGEN_SYNTAX_CHAR (* syn)) { #ifdef CGEN_MNEMONIC_OPERANDS diff --git a/opcodes/m32r-desc.c b/opcodes/m32r-desc.c index 9cb5462502..ee1cfa9e8b 100644 --- a/opcodes/m32r-desc.c +++ b/opcodes/m32r-desc.c @@ -46,6 +46,7 @@ static const CGEN_ATTR_ENTRY MACH_attr[] = { { "base", MACH_BASE }, { "m32r", MACH_M32R }, + { "m32rx", MACH_M32RX }, { "max", MACH_MAX }, { 0, 0 } }; @@ -57,6 +58,15 @@ static const CGEN_ATTR_ENTRY ISA_attr[] = { 0, 0 } }; +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_ifield_attr_table[] = { { "MACH", & MACH_attr[0] }, @@ -99,6 +109,7 @@ const CGEN_ATTR_TABLE m32r_cgen_operand_attr_table[] = const CGEN_ATTR_TABLE m32r_cgen_insn_attr_table[] = { { "MACH", & MACH_attr[0] }, + { "PIPE", & PIPE_attr[0] }, { "ALIAS", &bool_attr[0], &bool_attr[0] }, { "VIRTUAL", &bool_attr[0], &bool_attr[0] }, { "UNCOND-CTI", &bool_attr[0], &bool_attr[0] }, @@ -110,6 +121,7 @@ const CGEN_ATTR_TABLE m32r_cgen_insn_attr_table[] = { "NO-DIS", &bool_attr[0], &bool_attr[0] }, { "PBB", &bool_attr[0], &bool_attr[0] }, { "FILL-SLOT", &bool_attr[0], &bool_attr[0] }, + { "SPECIAL", &bool_attr[0], &bool_attr[0] }, { 0, 0, 0 } }; @@ -124,6 +136,7 @@ static const CGEN_ISA m32r_cgen_isa_table[] = { static const CGEN_MACH m32r_cgen_mach_table[] = { { "m32r", "m32r", MACH_M32R }, + { "m32rx", "m32rx", MACH_M32RX }, { 0 } }; @@ -189,6 +202,18 @@ CGEN_KEYWORD m32r_cgen_opval_cr_names = 23 }; +static CGEN_KEYWORD_ENTRY m32r_cgen_opval_h_accums_entries[] = +{ + { "a0", 0 }, + { "a1", 1 } +}; + +CGEN_KEYWORD m32r_cgen_opval_h_accums = +{ + & m32r_cgen_opval_h_accums_entries[0], + 2 +}; + /* The hardware table. */ @@ -209,6 +234,7 @@ const CGEN_HW_ENTRY m32r_cgen_hw_table[] = { "h-gr", HW_H_GR, CGEN_ASM_KEYWORD, (PTR) & m32r_cgen_opval_gr_names, { 0|A(CACHE_ADDR)|A(PROFILE), { (1<f_acc, 0); + break; + case M32R_OPERAND_ACCD : + print_keyword (cd, info, & m32r_cgen_opval_h_accums, fields->f_accd, 0); + break; + case M32R_OPERAND_ACCS : + print_keyword (cd, info, & m32r_cgen_opval_h_accums, fields->f_accs, 0); + break; case M32R_OPERAND_DCR : print_keyword (cd, info, & m32r_cgen_opval_cr_names, fields->f_r1, 0); break; @@ -185,6 +194,9 @@ m32r_cgen_print_operand (cd, opindex, xinfo, fields, attrs, pc, length) case M32R_OPERAND_HI16 : print_normal (cd, info, fields->f_hi16, 0|(1<f_imm1, 0|(1<f_r2, 0); break; diff --git a/opcodes/m32r-ibld.c b/opcodes/m32r-ibld.c index 5b78547795..48dc73fcbc 100644 --- a/opcodes/m32r-ibld.c +++ b/opcodes/m32r-ibld.c @@ -584,6 +584,15 @@ m32r_cgen_insert_operand (cd, opindex, fields, buffer, pc) switch (opindex) { + case M32R_OPERAND_ACC : + errmsg = insert_normal (cd, fields->f_acc, 0, 0, 8, 1, 32, total_length, buffer); + break; + case M32R_OPERAND_ACCD : + errmsg = insert_normal (cd, fields->f_accd, 0, 0, 4, 2, 32, total_length, buffer); + break; + case M32R_OPERAND_ACCS : + errmsg = insert_normal (cd, fields->f_accs, 0, 0, 12, 2, 32, total_length, buffer); + break; case M32R_OPERAND_DCR : errmsg = insert_normal (cd, fields->f_r1, 0, 0, 4, 4, 32, total_length, buffer); break; @@ -616,6 +625,13 @@ m32r_cgen_insert_operand (cd, opindex, fields, buffer, pc) case M32R_OPERAND_HI16 : errmsg = insert_normal (cd, fields->f_hi16, 0|(1<f_imm1; + value = ((value) - (1)); + errmsg = insert_normal (cd, value, 0, 0, 15, 1, 32, total_length, buffer); + } + break; case M32R_OPERAND_SCR : errmsg = insert_normal (cd, fields->f_r2, 0, 0, 12, 4, 32, total_length, buffer); break; @@ -694,6 +710,15 @@ m32r_cgen_extract_operand (cd, opindex, ex_info, insn_value, fields, pc) switch (opindex) { + case M32R_OPERAND_ACC : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 1, 32, total_length, pc, & fields->f_acc); + break; + case M32R_OPERAND_ACCD : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 2, 32, total_length, pc, & fields->f_accd); + break; + case M32R_OPERAND_ACCS : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 2, 32, total_length, pc, & fields->f_accs); + break; case M32R_OPERAND_DCR : length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_r1); break; @@ -729,6 +754,14 @@ m32r_cgen_extract_operand (cd, opindex, ex_info, insn_value, fields, pc) case M32R_OPERAND_HI16 : length = extract_normal (cd, ex_info, insn_value, 0|(1<f_hi16); break; + case M32R_OPERAND_IMM1 : + { + long value; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 1, 32, total_length, pc, & value); + value = ((value) + (1)); + fields->f_imm1 = value; + } + break; case M32R_OPERAND_SCR : length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_r2); break; @@ -801,6 +834,15 @@ m32r_cgen_get_int_operand (cd, opindex, fields) switch (opindex) { + case M32R_OPERAND_ACC : + value = fields->f_acc; + break; + case M32R_OPERAND_ACCD : + value = fields->f_accd; + break; + case M32R_OPERAND_ACCS : + value = fields->f_accs; + break; case M32R_OPERAND_DCR : value = fields->f_r1; break; @@ -822,6 +864,9 @@ m32r_cgen_get_int_operand (cd, opindex, fields) case M32R_OPERAND_HI16 : value = fields->f_hi16; break; + case M32R_OPERAND_IMM1 : + value = fields->f_imm1; + break; case M32R_OPERAND_SCR : value = fields->f_r2; break; @@ -879,6 +924,15 @@ m32r_cgen_get_vma_operand (cd, opindex, fields) switch (opindex) { + case M32R_OPERAND_ACC : + value = fields->f_acc; + break; + case M32R_OPERAND_ACCD : + value = fields->f_accd; + break; + case M32R_OPERAND_ACCS : + value = fields->f_accs; + break; case M32R_OPERAND_DCR : value = fields->f_r1; break; @@ -900,6 +954,9 @@ m32r_cgen_get_vma_operand (cd, opindex, fields) case M32R_OPERAND_HI16 : value = fields->f_hi16; break; + case M32R_OPERAND_IMM1 : + value = fields->f_imm1; + break; case M32R_OPERAND_SCR : value = fields->f_r2; break; @@ -961,6 +1018,15 @@ m32r_cgen_set_int_operand (cd, opindex, fields, value) { switch (opindex) { + case M32R_OPERAND_ACC : + fields->f_acc = value; + break; + case M32R_OPERAND_ACCD : + fields->f_accd = value; + break; + case M32R_OPERAND_ACCS : + fields->f_accs = value; + break; case M32R_OPERAND_DCR : fields->f_r1 = value; break; @@ -981,6 +1047,9 @@ m32r_cgen_set_int_operand (cd, opindex, fields, value) case M32R_OPERAND_HI16 : fields->f_hi16 = value; break; + case M32R_OPERAND_IMM1 : + fields->f_imm1 = value; + break; case M32R_OPERAND_SCR : fields->f_r2 = value; break; @@ -1035,6 +1104,15 @@ m32r_cgen_set_vma_operand (cd, opindex, fields, value) { switch (opindex) { + case M32R_OPERAND_ACC : + fields->f_acc = value; + break; + case M32R_OPERAND_ACCD : + fields->f_accd = value; + break; + case M32R_OPERAND_ACCS : + fields->f_accs = value; + break; case M32R_OPERAND_DCR : fields->f_r1 = value; break; @@ -1055,6 +1133,9 @@ m32r_cgen_set_vma_operand (cd, opindex, fields, value) case M32R_OPERAND_HI16 : fields->f_hi16 = value; break; + case M32R_OPERAND_IMM1 : + fields->f_imm1 = value; + break; case M32R_OPERAND_SCR : fields->f_r2 = value; break; diff --git a/opcodes/m32r-opc.c b/opcodes/m32r-opc.c index d4504fec2a..a1efecc3c8 100644 --- a/opcodes/m32r-opc.c +++ b/opcodes/m32r-opc.c @@ -93,11 +93,15 @@ static const CGEN_IFMT ifmt_cmpi = { 32, 32, 0xfff00000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 } }; +static const CGEN_IFMT ifmt_cmpz = { + 16, 16, 0xfff0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } +}; + static const CGEN_IFMT ifmt_div = { 32, 32, 0xf0f0ffff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 } }; -static const CGEN_IFMT ifmt_jl = { +static const CGEN_IFMT ifmt_jc = { 16, 16, 0xfff0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } }; @@ -109,10 +113,18 @@ static const CGEN_IFMT ifmt_ldi16 = { 32, 32, 0xf0ff0000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_SIMM16), 0 } }; +static const CGEN_IFMT ifmt_machi_a = { + 16, 16, 0xf070, { F (F_OP1), F (F_R1), F (F_ACC), F (F_OP23), F (F_R2), 0 } +}; + static const CGEN_IFMT ifmt_mvfachi = { 16, 16, 0xf0ff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } }; +static const CGEN_IFMT ifmt_mvfachi_a = { + 16, 16, 0xf0f3, { F (F_OP1), F (F_R1), F (F_OP2), F (F_ACCS), F (F_OP3), 0 } +}; + static const CGEN_IFMT ifmt_mvfc = { 16, 16, 0xf0f0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } }; @@ -121,6 +133,10 @@ static const CGEN_IFMT ifmt_mvtachi = { 16, 16, 0xf0ff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } }; +static const CGEN_IFMT ifmt_mvtachi_a = { + 16, 16, 0xf0f3, { F (F_OP1), F (F_R1), F (F_OP2), F (F_ACCS), F (F_OP3), 0 } +}; + static const CGEN_IFMT ifmt_mvtc = { 16, 16, 0xf0f0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } }; @@ -129,6 +145,10 @@ static const CGEN_IFMT ifmt_nop = { 16, 16, 0xffff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), 0 } }; +static const CGEN_IFMT ifmt_rac_dsi = { + 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 } +}; + static const CGEN_IFMT ifmt_seth = { 32, 32, 0xf0ff0000, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_HI16), 0 } }; @@ -145,6 +165,10 @@ static const CGEN_IFMT ifmt_trap = { 16, 16, 0xfff0, { F (F_OP1), F (F_R1), F (F_OP2), F (F_UIMM4), 0 } }; +static const CGEN_IFMT ifmt_satb = { + 32, 32, 0xf0f0ffff, { F (F_OP1), F (F_R1), F (F_OP2), F (F_R2), F (F_UIMM16), 0 } +}; + #undef F #define A(a) (1 << CONCAT2 (CGEN_INSN_,a)) @@ -298,6 +322,18 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (DISP24), 0 } }, & ifmt_bc24, { 0xfe000000 } }, +/* bcl.s $disp8 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DISP8), 0 } }, + & ifmt_bc8, { 0x7800 } + }, +/* bcl.l $disp24 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DISP24), 0 } }, + & ifmt_bc24, { 0xf8000000 } + }, /* bnc.s $disp8 */ { { 0, 0, 0, 0 }, @@ -328,6 +364,18 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (DISP24), 0 } }, & ifmt_bc24, { 0xff000000 } }, +/* bncl.s $disp8 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DISP8), 0 } }, + & ifmt_bc8, { 0x7900 } + }, +/* bncl.l $disp24 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DISP24), 0 } }, + & ifmt_bc24, { 0xf9000000 } + }, /* cmp $src1,$src2 */ { { 0, 0, 0, 0 }, @@ -352,6 +400,18 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (SRC2), ',', OP (SIMM16), 0 } }, & ifmt_cmpi, { 0x80500000 } }, +/* cmpeq $src1,$src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, + & ifmt_cmp, { 0x60 } + }, +/* cmpz $src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC2), 0 } }, + & ifmt_cmpz, { 0x70 } + }, /* div $dr,$sr */ { { 0, 0, 0, 0 }, @@ -376,17 +436,35 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } }, & ifmt_div, { 0x90300000 } }, +/* divh $dr,$sr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } }, + & ifmt_div, { 0x90000010 } + }, +/* jc $sr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SR), 0 } }, + & ifmt_jc, { 0x1cc0 } + }, +/* jnc $sr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SR), 0 } }, + & ifmt_jc, { 0x1dc0 } + }, /* jl $sr */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SR), 0 } }, - & ifmt_jl, { 0x1ec0 } + & ifmt_jc, { 0x1ec0 } }, /* jmp $sr */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SR), 0 } }, - & ifmt_jl, { 0x1fc0 } + & ifmt_jc, { 0x1fc0 } }, /* ld $dr,@$sr */ { @@ -484,24 +562,48 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3040 } }, +/* machi $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3040 } + }, /* maclo $src1,$src2 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3050 } }, +/* maclo $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3050 } + }, /* macwhi $src1,$src2 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3060 } }, +/* macwhi $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3060 } + }, /* macwlo $src1,$src2 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3070 } }, +/* macwlo $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3070 } + }, /* mul $dr,$sr */ { { 0, 0, 0, 0 }, @@ -514,24 +616,48 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3000 } }, +/* mulhi $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3000 } + }, /* mullo $src1,$src2 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3010 } }, +/* mullo $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3010 } + }, /* mulwhi $src1,$src2 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3020 } }, +/* mulwhi $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3020 } + }, /* mulwlo $src1,$src2 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, & ifmt_cmp, { 0x3030 } }, +/* mulwlo $src1,$src2,$acc */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), ',', OP (ACC), 0 } }, + & ifmt_machi_a, { 0x3030 } + }, /* mv $dr,$sr */ { { 0, 0, 0, 0 }, @@ -544,18 +670,36 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (DR), 0 } }, & ifmt_mvfachi, { 0x50f0 } }, +/* mvfachi $dr,$accs */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } }, + & ifmt_mvfachi_a, { 0x50f0 } + }, /* mvfaclo $dr */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DR), 0 } }, & ifmt_mvfachi, { 0x50f1 } }, +/* mvfaclo $dr,$accs */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } }, + & ifmt_mvfachi_a, { 0x50f1 } + }, /* mvfacmi $dr */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (DR), 0 } }, & ifmt_mvfachi, { 0x50f2 } }, +/* mvfacmi $dr,$accs */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (ACCS), 0 } }, + & ifmt_mvfachi_a, { 0x50f2 } + }, /* mvfc $dr,$scr */ { { 0, 0, 0, 0 }, @@ -568,12 +712,24 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (SRC1), 0 } }, & ifmt_mvtachi, { 0x5070 } }, +/* mvtachi $src1,$accs */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (ACCS), 0 } }, + & ifmt_mvtachi_a, { 0x5070 } + }, /* mvtaclo $src1 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (SRC1), 0 } }, & ifmt_mvtachi, { 0x5071 } }, +/* mvtaclo $src1,$accs */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (ACCS), 0 } }, + & ifmt_mvtachi_a, { 0x5071 } + }, /* mvtc $sr,$dcr */ { { 0, 0, 0, 0 }, @@ -604,12 +760,24 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, 0 } }, & ifmt_nop, { 0x5090 } }, +/* rac $accd,$accs,$imm1 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), ',', OP (IMM1), 0 } }, + & ifmt_rac_dsi, { 0x5090 } + }, /* rach */ { { 0, 0, 0, 0 }, { { MNEM, 0 } }, & ifmt_nop, { 0x5080 } }, +/* rach $accd,$accs,$imm1 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (ACCD), ',', OP (ACCS), ',', OP (IMM1), 0 } }, + & ifmt_rac_dsi, { 0x5080 } + }, /* rte */ { { 0, 0, 0, 0 }, @@ -754,6 +922,72 @@ static const CGEN_OPCODE m32r_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (SRC1), ',', '@', OP (SRC2), 0 } }, & ifmt_cmp, { 0x2050 } }, +/* satb $dr,$sr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } }, + & ifmt_satb, { 0x80600300 } + }, +/* sath $dr,$sr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } }, + & ifmt_satb, { 0x80600200 } + }, +/* sat $dr,$sr */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (DR), ',', OP (SR), 0 } }, + & ifmt_satb, { 0x80600000 } + }, +/* pcmpbz $src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC2), 0 } }, + & ifmt_cmpz, { 0x370 } + }, +/* sadd */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_nop, { 0x50e4 } + }, +/* macwu1 $src1,$src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, + & ifmt_cmp, { 0x50b0 } + }, +/* msblo $src1,$src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, + & ifmt_cmp, { 0x50d0 } + }, +/* mulwu1 $src1,$src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, + & ifmt_cmp, { 0x50a0 } + }, +/* maclh1 $src1,$src2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (SRC1), ',', OP (SRC2), 0 } }, + & ifmt_cmp, { 0x50c0 } + }, +/* sc */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_nop, { 0x7401 } + }, +/* snc */ + { + { 0, 0, 0, 0 }, + { { MNEM, 0 } }, + & ifmt_nop, { 0x7501 } + }, }; #undef A @@ -781,6 +1015,14 @@ static const CGEN_IFMT ifmt_bl24r = { 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 } }; +static const CGEN_IFMT ifmt_bcl8r = { + 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 } +}; + +static const CGEN_IFMT ifmt_bcl24r = { + 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 } +}; + static const CGEN_IFMT ifmt_bnc8r = { 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 } }; @@ -797,6 +1039,14 @@ static const CGEN_IFMT ifmt_bra24r = { 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 } }; +static const CGEN_IFMT ifmt_bncl8r = { + 16, 16, 0xff00, { F (F_OP1), F (F_R1), F (F_DISP8), 0 } +}; + +static const CGEN_IFMT ifmt_bncl24r = { + 32, 32, 0xff000000, { F (F_OP1), F (F_R1), F (F_DISP24), 0 } +}; + static const CGEN_IFMT ifmt_ld_2 = { 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 } }; @@ -849,6 +1099,22 @@ static const CGEN_IFMT ifmt_ldi16a = { 32, 32, 0xf0ff0000, { F (F_OP1), F (F_OP2), F (F_R2), F (F_R1), F (F_SIMM16), 0 } }; +static const CGEN_IFMT ifmt_rac_d = { + 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 } +}; + +static const CGEN_IFMT ifmt_rac_ds = { + 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 } +}; + +static const CGEN_IFMT ifmt_rach_d = { + 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 } +}; + +static const CGEN_IFMT ifmt_rach_ds = { + 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 } +}; + static const CGEN_IFMT ifmt_st_2 = { 16, 16, 0xf0f0, { F (F_OP1), F (F_OP2), F (F_R1), F (F_R2), 0 } }; @@ -893,142 +1159,182 @@ static const CGEN_IBASE m32r_cgen_macro_insn_table[] = /* bc $disp8 */ { -1, "bc8r", "bc", 16, - { 0|A(RELAXABLE)|A(COND_CTI)|A(ALIAS), { (1<