From: DJ Delorie Date: Wed, 8 Apr 2009 20:39:35 +0000 (+0000) Subject: [cgen] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40493983ad5cdac9625b3f2a1f92e41e094fde4c;p=binutils-gdb.git [cgen] * cpu/mep-c5.cpu: New. * cpu/mep-core.cpu: Add C5 support. * cpu/mep.opc: Likewise. [opcodes] * mep-asm.c: Regenerate. * mep-desc.c: Regenerate. * mep-desc.h: Regenerate. * mep-dis.c: Regenerate. * mep-ibld.c: Regenerate. * mep-opc.c: Regenerate. * mep-opc.h: Regenerate. [sid] * component/cache/cache.cxx (cache_component::cache_component): Add write_hint_pin(). Attach it to write-hint. (cache_component::write_hint): New. * component/cache/cache.h (write_hint_pin): New. (write_hint): New. * component/cgen-cpu/mep/Makefile.am: Regenerate. * component/cgen-cpu/mep/Makefile.in: Regenerate. * component/cgen-cpu/mep/mep-core1-decode.cxx: Regenerate. * component/cgen-cpu/mep/mep-core1-decode.h: Regenerate. * component/cgen-cpu/mep/mep-core1-defs.h: Regenerate. * component/cgen-cpu/mep/mep-core1-model.cxx: Regenerate. * component/cgen-cpu/mep/mep-core1-model.h: Regenerate. * component/cgen-cpu/mep/mep-core1-sem.cxx: Regenerate. * component/cgen-cpu/mep/mep-decode.cxx: Regenerate. * component/cgen-cpu/mep/mep-decode.h: Regenerate. * component/cgen-cpu/mep/mep-defs.h: Regenerate. * component/cgen-cpu/mep/mep-desc.h: Regenerate. * component/cgen-cpu/mep/mep-model.cxx: Regenerate. * component/cgen-cpu/mep/mep-model.h: Regenerate. * component/cgen-cpu/mep/mep-sem.cxx: Regenerate. * component/cgen-cpu/mep/mep.cxx (mep_cpu): Connect write-hint pin. (do_cache): Add C5 support. (do_cache_prefetch): Likewise. (do_casb3, do_cash3, do_casw3): New. * component/cgen-cpu/mep/mep.h: Add C5 support and write-hint pin. (do_casb3, do_cash3, do_casw3): New. * component/families/mep/Makefile.in: Regenerate. * component/families/mep/dsu.in: Add C5 support. * main/dynamic/mainDynamic.cxx: Add C5 support. * main/dynamic/mepCfg.cxx: Connect write-hint pin. * main/dynamic/mepCfg.h: Add C5 support. --- diff --git a/opcodes/mep-asm.c b/opcodes/mep-asm.c index 43ca942fc18..41a1f92fd09 100644 --- a/opcodes/mep-asm.c +++ b/opcodes/mep-asm.c @@ -51,6 +51,8 @@ static const char * parse_insn_normal /* -- asm.c */ +#include "elf/mep.h" + #define CGEN_VALIDATE_INSN_SUPPORTED const char * parse_csrn (CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *); @@ -126,9 +128,6 @@ parse_mep_align (CGEN_CPU_DESC cd, const char ** strp, case MEP_OPERAND_PCREL12A2: case MEP_OPERAND_PCREL17A2: case MEP_OPERAND_PCREL24A2: - case MEP_OPERAND_CDISP8A2: - case MEP_OPERAND_CDISP8A4: - case MEP_OPERAND_CDISP8A8: err = cgen_parse_signed_integer (cd, strp, type, field); break; case MEP_OPERAND_PCABS24A2: @@ -155,16 +154,13 @@ parse_mep_align (CGEN_CPU_DESC cd, const char ** strp, case MEP_OPERAND_PCREL24A2: case MEP_OPERAND_PCABS24A2: case MEP_OPERAND_UDISP7A2: - case MEP_OPERAND_CDISP8A2: lsbs = *field & 1; break; case MEP_OPERAND_UDISP7A4: case MEP_OPERAND_UIMM7A4: case MEP_OPERAND_ADDR24A4: - case MEP_OPERAND_CDISP8A4: lsbs = *field & 3; break; - case MEP_OPERAND_CDISP8A8: lsbs = *field & 7; break; default: @@ -441,6 +437,66 @@ parse_unsigned7 (CGEN_CPU_DESC cd, const char **strp, return parse_mep_alignu (cd, strp, opindex, valuep); } +static ATTRIBUTE_UNUSED const char * +parse_cdisp10 (CGEN_CPU_DESC cd, + const char **strp, + int opindex, + long *valuep) +{ + const char *errmsg = 0; + signed long value; + long have_zero = 0; + int wide = 0; + int alignment; + + switch (opindex) + { + case MEP_OPERAND_CDISP10A4: + alignment = 2; + break; + case MEP_OPERAND_CDISP10A2: + alignment = 1; + break; + case MEP_OPERAND_CDISP10: + default: + alignment = 0; + break; + } + + if (MEP_CPU == EF_MEP_CPU_C5) + wide = 1; + + if (strncmp (*strp, "0x0", 3) == 0 + || (**strp == '0' && *(*strp + 1) != 'x')) + have_zero = 1; + + errmsg = cgen_parse_signed_integer (cd, strp, opindex, & value); + if (errmsg) + return errmsg; + + if (wide) + { + if (value < -512 || value > 511) + return _("Immediate is out of range -512 to 511"); + } + else + { + if (value < -128 || value > 127) + return _("Immediate is out of range -128 to 127"); + } + + if (value & ((1<f_24u8a4n)); break; + case MEP_OPERAND_C5RMUIMM20 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MEP_OPERAND_C5RMUIMM20, (unsigned long *) (& fields->f_c5_rmuimm20)); + break; + case MEP_OPERAND_C5RNMUIMM24 : + errmsg = cgen_parse_unsigned_integer (cd, strp, MEP_OPERAND_C5RNMUIMM24, (unsigned long *) (& fields->f_c5_rnmuimm24)); + break; case MEP_OPERAND_CALLNUM : errmsg = cgen_parse_unsigned_integer (cd, strp, MEP_OPERAND_CALLNUM, (unsigned long *) (& fields->f_callnum)); break; @@ -736,17 +798,20 @@ mep_cgen_parse_operand (CGEN_CPU_DESC cd, case MEP_OPERAND_CCRN : errmsg = cgen_parse_keyword (cd, strp, & mep_cgen_opval_h_ccr, & fields->f_ccrn); break; - case MEP_OPERAND_CDISP8 : - errmsg = cgen_parse_signed_integer (cd, strp, MEP_OPERAND_CDISP8, (long *) (& fields->f_8s24)); + case MEP_OPERAND_CDISP10 : + errmsg = parse_cdisp10 (cd, strp, MEP_OPERAND_CDISP10, (long *) (& fields->f_cdisp10)); + break; + case MEP_OPERAND_CDISP10A2 : + errmsg = parse_cdisp10 (cd, strp, MEP_OPERAND_CDISP10A2, (long *) (& fields->f_cdisp10)); break; - case MEP_OPERAND_CDISP8A2 : - errmsg = parse_mep_align (cd, strp, MEP_OPERAND_CDISP8A2, (long *) (& fields->f_8s24a2)); + case MEP_OPERAND_CDISP10A4 : + errmsg = parse_cdisp10 (cd, strp, MEP_OPERAND_CDISP10A4, (long *) (& fields->f_cdisp10)); break; - case MEP_OPERAND_CDISP8A4 : - errmsg = parse_mep_align (cd, strp, MEP_OPERAND_CDISP8A4, (long *) (& fields->f_8s24a4)); + case MEP_OPERAND_CDISP10A8 : + errmsg = parse_cdisp10 (cd, strp, MEP_OPERAND_CDISP10A8, (long *) (& fields->f_cdisp10)); break; - case MEP_OPERAND_CDISP8A8 : - errmsg = parse_mep_align (cd, strp, MEP_OPERAND_CDISP8A8, (long *) (& fields->f_8s24a8)); + case MEP_OPERAND_CDISP12 : + errmsg = cgen_parse_signed_integer (cd, strp, MEP_OPERAND_CDISP12, (long *) (& fields->f_12s20)); break; case MEP_OPERAND_CIMM4 : errmsg = cgen_parse_unsigned_integer (cd, strp, MEP_OPERAND_CIMM4, (unsigned long *) (& fields->f_rn)); @@ -847,6 +912,9 @@ mep_cgen_parse_operand (CGEN_CPU_DESC cd, case MEP_OPERAND_RL : errmsg = cgen_parse_keyword (cd, strp, & mep_cgen_opval_h_gpr, & fields->f_rl); break; + case MEP_OPERAND_RL5 : + errmsg = cgen_parse_keyword (cd, strp, & mep_cgen_opval_h_gpr, & fields->f_rl5); + break; case MEP_OPERAND_RM : errmsg = cgen_parse_keyword (cd, strp, & mep_cgen_opval_h_gpr, & fields->f_rm); break; diff --git a/opcodes/mep-desc.c b/opcodes/mep-desc.c index 88f958c3ade..a210bdabc35 100644 --- a/opcodes/mep-desc.c +++ b/opcodes/mep-desc.c @@ -48,6 +48,7 @@ static const CGEN_ATTR_ENTRY MACH_attr[] ATTRIBUTE_UNUSED = { "base", MACH_BASE }, { "mep", MACH_MEP }, { "h1", MACH_H1 }, + { "c5", MACH_C5 }, { "max", MACH_MAX }, { 0, 0 } }; @@ -193,6 +194,7 @@ static const CGEN_ISA mep_cgen_isa_table[] = { static const CGEN_MACH mep_cgen_mach_table[] = { { "mep", "mep", MACH_MEP, 16 }, { "h1", "h1", MACH_H1, 16 }, + { "c5", "c5", MACH_C5, 16 }, { 0, 0, 0, 0 } }; @@ -473,6 +475,8 @@ const CGEN_IFLD mep_cgen_ifld_table[] = { MEP_F_SUB3, "f-sub3", 0, 32, 13, 3, { 0, { { { (1<f_24u8a4n, 0|(1<f_c5_rmuimm20, 0|(1<f_c5_rnmuimm24, 0|(1<f_callnum, 0|(1<f_ccrn, 0|(1<f_8s24, 0|(1<f_cdisp10, 0|(1<f_8s24a2, 0|(1<f_cdisp10, 0|(1<f_8s24a4, 0|(1<f_cdisp10, 0|(1<f_8s24a8, 0|(1<f_cdisp10, 0|(1<f_12s20, 0|(1<f_rn, 0, pc, length); @@ -620,6 +629,9 @@ mep_cgen_print_operand (CGEN_CPU_DESC cd, case MEP_OPERAND_RL : print_keyword (cd, info, & mep_cgen_opval_h_gpr, fields->f_rl, 0); break; + case MEP_OPERAND_RL5 : + print_keyword (cd, info, & mep_cgen_opval_h_gpr, fields->f_rl5, 0); + break; case MEP_OPERAND_RM : print_keyword (cd, info, & mep_cgen_opval_h_gpr, fields->f_rm, 0); break; diff --git a/opcodes/mep-ibld.c b/opcodes/mep-ibld.c index ac44ee2535e..947390690b5 100644 --- a/opcodes/mep-ibld.c +++ b/opcodes/mep-ibld.c @@ -579,6 +579,34 @@ mep_cgen_insert_operand (CGEN_CPU_DESC cd, break; } break; + case MEP_OPERAND_C5RMUIMM20 : + { +{ + FLD (f_c5_rm) = ((unsigned int) (FLD (f_c5_rmuimm20)) >> (16)); + FLD (f_c5_16u16) = ((FLD (f_c5_rmuimm20)) & (65535)); +} + errmsg = insert_normal (cd, fields->f_c5_rm, 0, 0, 8, 4, 32, total_length, buffer); + if (errmsg) + break; + errmsg = insert_normal (cd, fields->f_c5_16u16, 0, 0, 16, 16, 32, total_length, buffer); + if (errmsg) + break; + } + break; + case MEP_OPERAND_C5RNMUIMM24 : + { +{ + FLD (f_c5_rnm) = ((unsigned int) (FLD (f_c5_rnmuimm24)) >> (16)); + FLD (f_c5_16u16) = ((FLD (f_c5_rnmuimm24)) & (65535)); +} + errmsg = insert_normal (cd, fields->f_c5_rnm, 0, 0, 4, 8, 32, total_length, buffer); + if (errmsg) + break; + errmsg = insert_normal (cd, fields->f_c5_16u16, 0, 0, 16, 16, 32, total_length, buffer); + if (errmsg) + break; + } + break; case MEP_OPERAND_CALLNUM : { { @@ -618,30 +646,37 @@ mep_cgen_insert_operand (CGEN_CPU_DESC cd, break; } break; - case MEP_OPERAND_CDISP8 : - errmsg = insert_normal (cd, fields->f_8s24, 0|(1<f_cdisp10; + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + errmsg = insert_normal (cd, value, 0, 0, 22, 10, 32, total_length, buffer); + } break; - case MEP_OPERAND_CDISP8A2 : + case MEP_OPERAND_CDISP10A2 : { - long value = fields->f_8s24a2; - value = ((int) (value) >> (1)); - errmsg = insert_normal (cd, value, 0|(1<f_cdisp10; + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + errmsg = insert_normal (cd, value, 0, 0, 22, 10, 32, total_length, buffer); } break; - case MEP_OPERAND_CDISP8A4 : + case MEP_OPERAND_CDISP10A4 : { - long value = fields->f_8s24a4; - value = ((int) (value) >> (2)); - errmsg = insert_normal (cd, value, 0|(1<f_cdisp10; + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + errmsg = insert_normal (cd, value, 0, 0, 22, 10, 32, total_length, buffer); } break; - case MEP_OPERAND_CDISP8A8 : + case MEP_OPERAND_CDISP10A8 : { - long value = fields->f_8s24a8; - value = ((int) (value) >> (3)); - errmsg = insert_normal (cd, value, 0|(1<f_cdisp10; + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + errmsg = insert_normal (cd, value, 0, 0, 22, 10, 32, total_length, buffer); } break; + case MEP_OPERAND_CDISP12 : + errmsg = insert_normal (cd, fields->f_12s20, 0, 0, 20, 12, 32, total_length, buffer); + break; case MEP_OPERAND_CIMM4 : errmsg = insert_normal (cd, fields->f_rn, 0, 0, 4, 4, 32, total_length, buffer); break; @@ -814,6 +849,9 @@ mep_cgen_insert_operand (CGEN_CPU_DESC cd, case MEP_OPERAND_RL : errmsg = insert_normal (cd, fields->f_rl, 0, 0, 12, 4, 32, total_length, buffer); break; + case MEP_OPERAND_RL5 : + errmsg = insert_normal (cd, fields->f_rl5, 0, 0, 20, 4, 32, total_length, buffer); + break; case MEP_OPERAND_RM : errmsg = insert_normal (cd, fields->f_rm, 0, 0, 8, 4, 32, total_length, buffer); break; @@ -994,6 +1032,28 @@ mep_cgen_extract_operand (CGEN_CPU_DESC cd, FLD (f_24u8a4n) = ((((FLD (f_24u8a4n_hi)) << (8))) | (((FLD (f_24u8a4n_lo)) << (2)))); } break; + case MEP_OPERAND_C5RMUIMM20 : + { + length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_c5_rm); + if (length <= 0) break; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16); + if (length <= 0) break; +{ + FLD (f_c5_rmuimm20) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rm)) << (16)))); +} + } + break; + case MEP_OPERAND_C5RNMUIMM24 : + { + length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 8, 32, total_length, pc, & fields->f_c5_rnm); + if (length <= 0) break; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 16, 16, 32, total_length, pc, & fields->f_c5_16u16); + if (length <= 0) break; +{ + FLD (f_c5_rnmuimm24) = ((FLD (f_c5_16u16)) | (((FLD (f_c5_rnm)) << (16)))); +} + } + break; case MEP_OPERAND_CALLNUM : { length = extract_normal (cd, ex_info, insn_value, 0, 0, 5, 1, 32, total_length, pc, & fields->f_5); @@ -1019,33 +1079,41 @@ mep_cgen_extract_operand (CGEN_CPU_DESC cd, FLD (f_ccrn) = ((((FLD (f_ccrn_hi)) << (4))) | (FLD (f_ccrn_lo))); } break; - case MEP_OPERAND_CDISP8 : - length = extract_normal (cd, ex_info, insn_value, 0|(1<f_8s24); + case MEP_OPERAND_CDISP10 : + { + long value; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 10, 32, total_length, pc, & value); + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + fields->f_cdisp10 = value; + } break; - case MEP_OPERAND_CDISP8A2 : + case MEP_OPERAND_CDISP10A2 : { long value; - length = extract_normal (cd, ex_info, insn_value, 0|(1<f_8s24a2 = value; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 10, 32, total_length, pc, & value); + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + fields->f_cdisp10 = value; } break; - case MEP_OPERAND_CDISP8A4 : + case MEP_OPERAND_CDISP10A4 : { long value; - length = extract_normal (cd, ex_info, insn_value, 0|(1<f_8s24a4 = value; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 10, 32, total_length, pc, & value); + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + fields->f_cdisp10 = value; } break; - case MEP_OPERAND_CDISP8A8 : + case MEP_OPERAND_CDISP10A8 : { long value; - length = extract_normal (cd, ex_info, insn_value, 0|(1<f_8s24a8 = value; + length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 10, 32, total_length, pc, & value); + value = ((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value)); + fields->f_cdisp10 = value; } break; + case MEP_OPERAND_CDISP12 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 12, 32, total_length, pc, & fields->f_12s20); + break; case MEP_OPERAND_CIMM4 : length = extract_normal (cd, ex_info, insn_value, 0, 0, 4, 4, 32, total_length, pc, & fields->f_rn); break; @@ -1185,6 +1253,9 @@ mep_cgen_extract_operand (CGEN_CPU_DESC cd, case MEP_OPERAND_RL : length = extract_normal (cd, ex_info, insn_value, 0, 0, 12, 4, 32, total_length, pc, & fields->f_rl); break; + case MEP_OPERAND_RL5 : + length = extract_normal (cd, ex_info, insn_value, 0, 0, 20, 4, 32, total_length, pc, & fields->f_rl5); + break; case MEP_OPERAND_RM : length = extract_normal (cd, ex_info, insn_value, 0, 0, 8, 4, 32, total_length, pc, & fields->f_rm); break; @@ -1352,6 +1423,12 @@ mep_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_ADDR24A4 : value = fields->f_24u8a4n; break; + case MEP_OPERAND_C5RMUIMM20 : + value = fields->f_c5_rmuimm20; + break; + case MEP_OPERAND_C5RNMUIMM24 : + value = fields->f_c5_rnmuimm24; + break; case MEP_OPERAND_CALLNUM : value = fields->f_callnum; break; @@ -1361,17 +1438,20 @@ mep_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_CCRN : value = fields->f_ccrn; break; - case MEP_OPERAND_CDISP8 : - value = fields->f_8s24; + case MEP_OPERAND_CDISP10 : + value = fields->f_cdisp10; break; - case MEP_OPERAND_CDISP8A2 : - value = fields->f_8s24a2; + case MEP_OPERAND_CDISP10A2 : + value = fields->f_cdisp10; break; - case MEP_OPERAND_CDISP8A4 : - value = fields->f_8s24a4; + case MEP_OPERAND_CDISP10A4 : + value = fields->f_cdisp10; break; - case MEP_OPERAND_CDISP8A8 : - value = fields->f_8s24a8; + case MEP_OPERAND_CDISP10A8 : + value = fields->f_cdisp10; + break; + case MEP_OPERAND_CDISP12 : + value = fields->f_12s20; break; case MEP_OPERAND_CIMM4 : value = fields->f_rn; @@ -1472,6 +1552,9 @@ mep_cgen_get_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_RL : value = fields->f_rl; break; + case MEP_OPERAND_RL5 : + value = fields->f_rl5; + break; case MEP_OPERAND_RM : value = fields->f_rm; break; @@ -1606,6 +1689,12 @@ mep_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_ADDR24A4 : value = fields->f_24u8a4n; break; + case MEP_OPERAND_C5RMUIMM20 : + value = fields->f_c5_rmuimm20; + break; + case MEP_OPERAND_C5RNMUIMM24 : + value = fields->f_c5_rnmuimm24; + break; case MEP_OPERAND_CALLNUM : value = fields->f_callnum; break; @@ -1615,17 +1704,20 @@ mep_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_CCRN : value = fields->f_ccrn; break; - case MEP_OPERAND_CDISP8 : - value = fields->f_8s24; + case MEP_OPERAND_CDISP10 : + value = fields->f_cdisp10; break; - case MEP_OPERAND_CDISP8A2 : - value = fields->f_8s24a2; + case MEP_OPERAND_CDISP10A2 : + value = fields->f_cdisp10; break; - case MEP_OPERAND_CDISP8A4 : - value = fields->f_8s24a4; + case MEP_OPERAND_CDISP10A4 : + value = fields->f_cdisp10; break; - case MEP_OPERAND_CDISP8A8 : - value = fields->f_8s24a8; + case MEP_OPERAND_CDISP10A8 : + value = fields->f_cdisp10; + break; + case MEP_OPERAND_CDISP12 : + value = fields->f_12s20; break; case MEP_OPERAND_CIMM4 : value = fields->f_rn; @@ -1726,6 +1818,9 @@ mep_cgen_get_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_RL : value = fields->f_rl; break; + case MEP_OPERAND_RL5 : + value = fields->f_rl5; + break; case MEP_OPERAND_RM : value = fields->f_rm; break; @@ -1867,6 +1962,12 @@ mep_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_ADDR24A4 : fields->f_24u8a4n = value; break; + case MEP_OPERAND_C5RMUIMM20 : + fields->f_c5_rmuimm20 = value; + break; + case MEP_OPERAND_C5RNMUIMM24 : + fields->f_c5_rnmuimm24 = value; + break; case MEP_OPERAND_CALLNUM : fields->f_callnum = value; break; @@ -1876,17 +1977,20 @@ mep_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_CCRN : fields->f_ccrn = value; break; - case MEP_OPERAND_CDISP8 : - fields->f_8s24 = value; + case MEP_OPERAND_CDISP10 : + fields->f_cdisp10 = value; + break; + case MEP_OPERAND_CDISP10A2 : + fields->f_cdisp10 = value; break; - case MEP_OPERAND_CDISP8A2 : - fields->f_8s24a2 = value; + case MEP_OPERAND_CDISP10A4 : + fields->f_cdisp10 = value; break; - case MEP_OPERAND_CDISP8A4 : - fields->f_8s24a4 = value; + case MEP_OPERAND_CDISP10A8 : + fields->f_cdisp10 = value; break; - case MEP_OPERAND_CDISP8A8 : - fields->f_8s24a8 = value; + case MEP_OPERAND_CDISP12 : + fields->f_12s20 = value; break; case MEP_OPERAND_CIMM4 : fields->f_rn = value; @@ -1970,6 +2074,9 @@ mep_cgen_set_int_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_RL : fields->f_rl = value; break; + case MEP_OPERAND_RL5 : + fields->f_rl5 = value; + break; case MEP_OPERAND_RM : fields->f_rm = value; break; @@ -2095,6 +2202,12 @@ mep_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_ADDR24A4 : fields->f_24u8a4n = value; break; + case MEP_OPERAND_C5RMUIMM20 : + fields->f_c5_rmuimm20 = value; + break; + case MEP_OPERAND_C5RNMUIMM24 : + fields->f_c5_rnmuimm24 = value; + break; case MEP_OPERAND_CALLNUM : fields->f_callnum = value; break; @@ -2104,17 +2217,20 @@ mep_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_CCRN : fields->f_ccrn = value; break; - case MEP_OPERAND_CDISP8 : - fields->f_8s24 = value; + case MEP_OPERAND_CDISP10 : + fields->f_cdisp10 = value; + break; + case MEP_OPERAND_CDISP10A2 : + fields->f_cdisp10 = value; break; - case MEP_OPERAND_CDISP8A2 : - fields->f_8s24a2 = value; + case MEP_OPERAND_CDISP10A4 : + fields->f_cdisp10 = value; break; - case MEP_OPERAND_CDISP8A4 : - fields->f_8s24a4 = value; + case MEP_OPERAND_CDISP10A8 : + fields->f_cdisp10 = value; break; - case MEP_OPERAND_CDISP8A8 : - fields->f_8s24a8 = value; + case MEP_OPERAND_CDISP12 : + fields->f_12s20 = value; break; case MEP_OPERAND_CIMM4 : fields->f_rn = value; @@ -2198,6 +2314,9 @@ mep_cgen_set_vma_operand (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED, case MEP_OPERAND_RL : fields->f_rl = value; break; + case MEP_OPERAND_RL5 : + fields->f_rl5 = value; + break; case MEP_OPERAND_RM : fields->f_rm = value; break; diff --git a/opcodes/mep-opc.c b/opcodes/mep-opc.c index aa25632b912..bd298cb38cb 100644 --- a/opcodes/mep-opc.c +++ b/opcodes/mep-opc.c @@ -88,8 +88,8 @@ mep_config_map_struct mep_config_map[] = { /* config-map-start */ /* Default entry: mep core only, all options enabled. */ - { "", 0, EF_MEP_CPU_C4, 1, 0, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x80"}, OPTION_MASK }, - { "default", CONFIG_DEFAULT, EF_MEP_CPU_C4, 0, 0, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\xc0" }, + { "", 0, EF_MEP_CPU_C5, 1, 0, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x0"}, {1,"\x80"}, OPTION_MASK }, + { "default", CONFIG_DEFAULT, EF_MEP_CPU_C5, 0, 0, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\x0" }, { 1, "\xc0" }, 0 | (1 << CGEN_INSN_OPTIONAL_MUL_INSN) | (1 << CGEN_INSN_OPTIONAL_DIV_INSN) @@ -120,6 +120,10 @@ check_configured_mach (int machs) case EF_MEP_CPU_H1: mach |= (1 << MACH_H1); break; + case EF_MEP_CPU_C5: + mach |= (1 << MACH_MEP); + mach |= (1 << MACH_C5); + break; default: break; } @@ -172,6 +176,42 @@ static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = { 0, 0, 0x0, { { 0 } } }; +static const CGEN_IFMT ifmt_stcb_r ATTRIBUTE_UNUSED = { + 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_pref ATTRIBUTE_UNUSED = { + 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_prefd ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_casb3 ATTRIBUTE_UNUSED = { + 32, 32, 0xf00ff0ff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_C5N4) }, { F (F_RL5) }, { F (F_C5N6) }, { F (F_C5N7) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_sbcp ATTRIBUTE_UNUSED = { + 32, 32, 0xf00ff000, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_12S20) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_lbucpa ATTRIBUTE_UNUSED = { + 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_lhucpa ATTRIBUTE_UNUSED = { + 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_uci ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_dsp ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } } +}; + static const CGEN_IFMT ifmt_sb ATTRIBUTE_UNUSED = { 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } }; @@ -284,14 +324,6 @@ static const CGEN_IFMT ifmt_slt3i ATTRIBUTE_UNUSED = { 16, 16, 0xf007, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_5U8) }, { F (F_SUB3) }, { 0 } } }; -static const CGEN_IFMT ifmt_add3x ATTRIBUTE_UNUSED = { - 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } } -}; - -static const CGEN_IFMT ifmt_sltu3x ATTRIBUTE_UNUSED = { - 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } } -}; - static const CGEN_IFMT ifmt_bra ATTRIBUTE_UNUSED = { 16, 16, 0xf001, { { F (F_MAJOR) }, { F (F_12S4A2) }, { F (F_15) }, { 0 } } }; @@ -348,14 +380,6 @@ static const CGEN_IFMT ifmt_bsetm ATTRIBUTE_UNUSED = { 16, 16, 0xf80f, { { F (F_MAJOR) }, { F (F_4) }, { F (F_3U5) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } }; -static const CGEN_IFMT ifmt_tas ATTRIBUTE_UNUSED = { - 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } -}; - -static const CGEN_IFMT ifmt_cache ATTRIBUTE_UNUSED = { - 16, 16, 0xf00f, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } -}; - static const CGEN_IFMT ifmt_madd ATTRIBUTE_UNUSED = { 32, 32, 0xf00fffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } } }; @@ -380,20 +404,12 @@ static const CGEN_IFMT ifmt_smcp16 ATTRIBUTE_UNUSED = { 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16S16) }, { 0 } } }; -static const CGEN_IFMT ifmt_sbcpa ATTRIBUTE_UNUSED = { - 32, 32, 0xf00fff00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT) }, { F (F_8S24) }, { 0 } } -}; - -static const CGEN_IFMT ifmt_shcpa ATTRIBUTE_UNUSED = { - 32, 32, 0xf00fff01, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT) }, { F (F_8S24A2) }, { F (F_31) }, { 0 } } -}; - static const CGEN_IFMT ifmt_swcpa ATTRIBUTE_UNUSED = { - 32, 32, 0xf00fff03, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT) }, { F (F_8S24A4) }, { F (F_30) }, { F (F_31) }, { 0 } } + 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } } }; static const CGEN_IFMT ifmt_smcpa ATTRIBUTE_UNUSED = { - 32, 32, 0xf00fff07, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT) }, { F (F_8S24A8) }, { F (F_29) }, { F (F_30) }, { F (F_31) }, { 0 } } + 32, 32, 0xf00ffc00, { { F (F_MAJOR) }, { F (F_CRN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_EXT4) }, { F (F_EXT62) }, { F (F_CDISP10) }, { 0 } } }; static const CGEN_IFMT ifmt_bcpeq ATTRIBUTE_UNUSED = { @@ -427,6 +443,132 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = A `num' value of zero is thus invalid. Also, the special `invalid' insn resides here. */ { { 0, 0, 0, 0 }, {{0}}, 0, {0}}, +/* stcb $rn,($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } }, + & ifmt_stcb_r, { 0x700c } + }, +/* ldcb $rn,($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } }, + & ifmt_stcb_r, { 0x700d } + }, +/* pref $cimm4,($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CIMM4), ',', '(', OP (RMA), ')', 0 } }, + & ifmt_pref, { 0x7005 } + }, +/* pref $cimm4,$sdisp16($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CIMM4), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } }, + & ifmt_prefd, { 0xf0030000 } + }, +/* casb3 $rl5,$rn,($rm) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } }, + & ifmt_casb3, { 0xf0012000 } + }, +/* cash3 $rl5,$rn,($rm) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } }, + & ifmt_casb3, { 0xf0012001 } + }, +/* casw3 $rl5,$rn,($rm) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RL5), ',', OP (RN), ',', '(', OP (RM), ')', 0 } }, + & ifmt_casb3, { 0xf0012002 } + }, +/* sbcp $crn,$cdisp12($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } }, + & ifmt_sbcp, { 0xf0060000 } + }, +/* lbcp $crn,$cdisp12($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } }, + & ifmt_sbcp, { 0xf0064000 } + }, +/* lbucp $crn,$cdisp12($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } }, + & ifmt_sbcp, { 0xf006c000 } + }, +/* shcp $crn,$cdisp12($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } }, + & ifmt_sbcp, { 0xf0061000 } + }, +/* lhcp $crn,$cdisp12($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } }, + & ifmt_sbcp, { 0xf0065000 } + }, +/* lhucp $crn,$cdisp12($rma) */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', OP (CDISP12), '(', OP (RMA), ')', 0 } }, + & ifmt_sbcp, { 0xf006d000 } + }, +/* lbucpa $crn,($rma+),$cdisp10 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf005c000 } + }, +/* lhucpa $crn,($rma+),$cdisp10a2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf005d000 } + }, +/* lbucpm0 $crn,($rma+),$cdisp10 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf005c800 } + }, +/* lhucpm0 $crn,($rma+),$cdisp10a2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf005d800 } + }, +/* lbucpm1 $crn,($rma+),$cdisp10 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf005cc00 } + }, +/* lhucpm1 $crn,($rma+),$cdisp10a2 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf005dc00 } + }, +/* uci $rn,$rm,$uimm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, + & ifmt_uci, { 0xf0020000 } + }, +/* dsp $rn,$rm,$uimm16 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, + & ifmt_dsp, { 0xf0000000 } + }, /* sb $rnc,($rma) */ { { 0, 0, 0, 0 }, @@ -743,19 +885,19 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (SIMM16), 0 } }, - & ifmt_add3x, { 0xc0000000 } + & ifmt_uci, { 0xc0000000 } }, /* slt3 $rn,$rm,$simm16 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (SIMM16), 0 } }, - & ifmt_add3x, { 0xc0020000 } + & ifmt_uci, { 0xc0020000 } }, /* sltu3 $rn,$rm,$uimm16 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, - & ifmt_sltu3x, { 0xc0030000 } + & ifmt_dsp, { 0xc0030000 } }, /* or $rn,$rm */ { @@ -785,19 +927,19 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, - & ifmt_sltu3x, { 0xc0040000 } + & ifmt_dsp, { 0xc0040000 } }, /* and3 $rn,$rm,$uimm16 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, - & ifmt_sltu3x, { 0xc0050000 } + & ifmt_dsp, { 0xc0050000 } }, /* xor3 $rn,$rm,$uimm16 */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, - & ifmt_sltu3x, { 0xc0060000 } + & ifmt_dsp, { 0xc0060000 } }, /* sra $rn,$rm */ { @@ -1085,13 +1227,13 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (RN), ',', '(', OP (RMA), ')', 0 } }, - & ifmt_tas, { 0x2004 } + & ifmt_stcb_r, { 0x2004 } }, /* cache $cimm4,($rma) */ { { 0, 0, 0, 0 }, { { MNEM, ' ', OP (CIMM4), ',', '(', OP (RMA), ')', 0 } }, - & ifmt_cache, { 0x7004 } + & ifmt_pref, { 0x7004 } }, /* mul $rn,$rm */ { @@ -1315,148 +1457,148 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (CRN64), ',', OP (SDISP16), '(', OP (RMA), ')', 0 } }, & ifmt_smcp16, { 0xf00f0000 } }, -/* sbcpa $crn,($rma+),$cdisp8 */ +/* sbcpa $crn,($rma+),$cdisp10 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8), 0 } }, - & ifmt_sbcpa, { 0xf0050000 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf0050000 } }, -/* lbcpa $crn,($rma+),$cdisp8 */ +/* lbcpa $crn,($rma+),$cdisp10 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8), 0 } }, - & ifmt_sbcpa, { 0xf0054000 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf0054000 } }, -/* shcpa $crn,($rma+),$cdisp8a2 */ +/* shcpa $crn,($rma+),$cdisp10a2 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A2), 0 } }, - & ifmt_shcpa, { 0xf0051000 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf0051000 } }, -/* lhcpa $crn,($rma+),$cdisp8a2 */ +/* lhcpa $crn,($rma+),$cdisp10a2 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A2), 0 } }, - & ifmt_shcpa, { 0xf0055000 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf0055000 } }, -/* swcpa $crn,($rma+),$cdisp8a4 */ +/* swcpa $crn,($rma+),$cdisp10a4 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A4), 0 } }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } }, & ifmt_swcpa, { 0xf0052000 } }, -/* lwcpa $crn,($rma+),$cdisp8a4 */ +/* lwcpa $crn,($rma+),$cdisp10a4 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A4), 0 } }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } }, & ifmt_swcpa, { 0xf0056000 } }, -/* smcpa $crn64,($rma+),$cdisp8a8 */ +/* smcpa $crn64,($rma+),$cdisp10a8 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A8), 0 } }, + { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } }, & ifmt_smcpa, { 0xf0053000 } }, -/* lmcpa $crn64,($rma+),$cdisp8a8 */ +/* lmcpa $crn64,($rma+),$cdisp10a8 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A8), 0 } }, + { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } }, & ifmt_smcpa, { 0xf0057000 } }, -/* sbcpm0 $crn,($rma+),$cdisp8 */ +/* sbcpm0 $crn,($rma+),$cdisp10 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8), 0 } }, - & ifmt_sbcpa, { 0xf0050800 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf0050800 } }, -/* lbcpm0 $crn,($rma+),$cdisp8 */ +/* lbcpm0 $crn,($rma+),$cdisp10 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8), 0 } }, - & ifmt_sbcpa, { 0xf0054800 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf0054800 } }, -/* shcpm0 $crn,($rma+),$cdisp8a2 */ +/* shcpm0 $crn,($rma+),$cdisp10a2 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A2), 0 } }, - & ifmt_shcpa, { 0xf0051800 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf0051800 } }, -/* lhcpm0 $crn,($rma+),$cdisp8a2 */ +/* lhcpm0 $crn,($rma+),$cdisp10a2 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A2), 0 } }, - & ifmt_shcpa, { 0xf0055800 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf0055800 } }, -/* swcpm0 $crn,($rma+),$cdisp8a4 */ +/* swcpm0 $crn,($rma+),$cdisp10a4 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A4), 0 } }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } }, & ifmt_swcpa, { 0xf0052800 } }, -/* lwcpm0 $crn,($rma+),$cdisp8a4 */ +/* lwcpm0 $crn,($rma+),$cdisp10a4 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A4), 0 } }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } }, & ifmt_swcpa, { 0xf0056800 } }, -/* smcpm0 $crn64,($rma+),$cdisp8a8 */ +/* smcpm0 $crn64,($rma+),$cdisp10a8 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A8), 0 } }, + { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } }, & ifmt_smcpa, { 0xf0053800 } }, -/* lmcpm0 $crn64,($rma+),$cdisp8a8 */ +/* lmcpm0 $crn64,($rma+),$cdisp10a8 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A8), 0 } }, + { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } }, & ifmt_smcpa, { 0xf0057800 } }, -/* sbcpm1 $crn,($rma+),$cdisp8 */ +/* sbcpm1 $crn,($rma+),$cdisp10 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8), 0 } }, - & ifmt_sbcpa, { 0xf0050c00 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf0050c00 } }, -/* lbcpm1 $crn,($rma+),$cdisp8 */ +/* lbcpm1 $crn,($rma+),$cdisp10 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8), 0 } }, - & ifmt_sbcpa, { 0xf0054c00 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10), 0 } }, + & ifmt_lbucpa, { 0xf0054c00 } }, -/* shcpm1 $crn,($rma+),$cdisp8a2 */ +/* shcpm1 $crn,($rma+),$cdisp10a2 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A2), 0 } }, - & ifmt_shcpa, { 0xf0051c00 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf0051c00 } }, -/* lhcpm1 $crn,($rma+),$cdisp8a2 */ +/* lhcpm1 $crn,($rma+),$cdisp10a2 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A2), 0 } }, - & ifmt_shcpa, { 0xf0055c00 } + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A2), 0 } }, + & ifmt_lhucpa, { 0xf0055c00 } }, -/* swcpm1 $crn,($rma+),$cdisp8a4 */ +/* swcpm1 $crn,($rma+),$cdisp10a4 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A4), 0 } }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } }, & ifmt_swcpa, { 0xf0052c00 } }, -/* lwcpm1 $crn,($rma+),$cdisp8a4 */ +/* lwcpm1 $crn,($rma+),$cdisp10a4 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A4), 0 } }, + { { MNEM, ' ', OP (CRN), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A4), 0 } }, & ifmt_swcpa, { 0xf0056c00 } }, -/* smcpm1 $crn64,($rma+),$cdisp8a8 */ +/* smcpm1 $crn64,($rma+),$cdisp10a8 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A8), 0 } }, + { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } }, & ifmt_smcpa, { 0xf0053c00 } }, -/* lmcpm1 $crn64,($rma+),$cdisp8a8 */ +/* lmcpm1 $crn64,($rma+),$cdisp10a8 */ { { 0, 0, 0, 0 }, - { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP8A8), 0 } }, + { { MNEM, ' ', OP (CRN64), ',', '(', OP (RMA), '+', ')', ',', OP (CDISP10A8), 0 } }, & ifmt_smcpa, { 0xf0057c00 } }, /* bcpeq $cccc,$pcrel17a2 */ @@ -1633,42 +1775,12 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, 0 } }, & ifmt_mov, { 0xe00d } }, -/* --reserved-- */ - { - { 0, 0, 0, 0 }, - { { MNEM, 0 } }, - & ifmt_mov, { 0xf003 } - }, -/* --reserved-- */ - { - { 0, 0, 0, 0 }, - { { MNEM, 0 } }, - & ifmt_mov, { 0xf006 } - }, /* --reserved-- */ { { 0, 0, 0, 0 }, { { MNEM, 0 } }, & ifmt_mov, { 0xf008 } }, -/* --reserved-- */ - { - { 0, 0, 0, 0 }, - { { MNEM, 0 } }, - & ifmt_mov, { 0x7005 } - }, -/* --reserved-- */ - { - { 0, 0, 0, 0 }, - { { MNEM, 0 } }, - & ifmt_mov, { 0x700c } - }, -/* --reserved-- */ - { - { 0, 0, 0, 0 }, - { { MNEM, 0 } }, - & ifmt_mov, { 0x700d } - }, }; #undef A @@ -1683,6 +1795,14 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = #else #define F(f) & mep_cgen_ifld_table[MEP_/**/f] #endif +static const CGEN_IFMT ifmt_dsp0 ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_dsp1 ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { F (F_16U16) }, { 0 } } +}; + static const CGEN_IFMT ifmt_nop ATTRIBUTE_UNUSED = { 16, 16, 0xffff, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_RM) }, { F (F_SUB4) }, { 0 } } }; @@ -1756,6 +1876,16 @@ static const CGEN_IFMT ifmt_lmcp16_0 ATTRIBUTE_UNUSED = { static const CGEN_IBASE mep_cgen_macro_insn_table[] = { +/* dsp0 $c5rnmuimm24 */ + { + -1, "dsp0", "dsp0", 32, + { 0|A(VOLATILE)|A(NO_DIS)|A(ALIAS), { { { (1<