From 45be3704c822b201bb2ec4734a550237f3aa2f74 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Sat, 18 Apr 2009 02:56:43 +0000 Subject: [PATCH] [cgen] * cpu/mep-c5.cpu (f-12s20): Change to signed. (lhucpm1): Limit to C5 mach. (dsp0,dsp1): Rewrite as aliases so that intrinsics are generated. * cpu/mep-core.cpu (extend-cdisp10): New. (f-cdisp10): Change to signed, use extend-cdisp10 to sign extend. [opcodes] * mep-desc.c: Regenerate. * mep-ibld.c: Regenerate. * mep-opc.c: Regenerate. * mep-opc.h: Regenerate. [sid/component/cgen-cpu/mep] * mep-core1-decode.cxx: Regenerate. * mep-core1-decode.h: Regenerate. * mep-decode.cxx: Regenerate. * mep-decode.h: Regenerate. --- opcodes/ChangeLog | 7 +++ opcodes/mep-desc.c | 12 +++++- opcodes/mep-ibld.c | 36 ++++++++-------- opcodes/mep-opc.c | 50 +++++++++------------- opcodes/mep-opc.h | 103 +++++++++++++++++++++++---------------------- 5 files changed, 108 insertions(+), 100 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 36f08e0a9ba..9d4794f2e10 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,10 @@ +2009-04-17 DJ Delorie * moxie-opc.c, moxie-dis.c: Created. diff --git a/opcodes/mep-desc.c b/opcodes/mep-desc.c index a210bdabc35..9225cad3483 100644 --- a/opcodes/mep-desc.c +++ b/opcodes/mep-desc.c @@ -1122,7 +1122,7 @@ static const CGEN_IBASE mep_cgen_insn_table[MAX_INSNS] = /* lhucpm1 $crn,($rma+),$cdisp10a2 */ { MEP_INSN_LHUCPM1, "lhucpm1", "lhucpm1", 32, - { 0|A(OPTIONAL_CP_INSN), { { { (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); + value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))); + 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); + value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))); + 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); + value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))); + 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); + value = (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (512))) ? (((((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))) - (1024))) : (((((((((value) & (128))) ? (((value) ^ (768))) : (value)) & (512))) ? ((((((value) & (128))) ? (((value) ^ (768))) : (value)) - (1024))) : ((((value) & (128))) ? (((value) ^ (768))) : (value))) & (1023))); + errmsg = insert_normal (cd, value, 0|(1<f_12s20, 0, 0, 20, 12, 32, total_length, buffer); + errmsg = insert_normal (cd, fields->f_12s20, 0|(1<f_rn, 0, 0, 4, 4, 32, total_length, buffer); @@ -1082,37 +1082,37 @@ mep_cgen_extract_operand (CGEN_CPU_DESC cd, 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)); + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_cdisp10 = value; } break; case MEP_OPERAND_CDISP10A2 : { 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)); + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_cdisp10 = value; } break; case MEP_OPERAND_CDISP10A4 : { 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)); + length = extract_normal (cd, ex_info, insn_value, 0|(1<f_cdisp10 = value; } break; case MEP_OPERAND_CDISP10A8 : { 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)); + length = extract_normal (cd, ex_info, insn_value, 0|(1<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); + length = extract_normal (cd, ex_info, insn_value, 0|(1<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); diff --git a/opcodes/mep-opc.c b/opcodes/mep-opc.c index bd298cb38cb..e2711e71402 100644 --- a/opcodes/mep-opc.c +++ b/opcodes/mep-opc.c @@ -212,6 +212,14 @@ 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_dsp0 ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_C5_RNMUIMM24) }, { F (F_SUB4) }, { 0 } } +}; + +static const CGEN_IFMT ifmt_dsp1 ATTRIBUTE_UNUSED = { + 32, 32, 0xf00f0000, { { F (F_MAJOR) }, { F (F_RN) }, { F (F_C5_RMUIMM20) }, { F (F_SUB4) }, { 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 } } }; @@ -569,6 +577,18 @@ static const CGEN_OPCODE mep_cgen_insn_opcode_table[MAX_INSNS] = { { MNEM, ' ', OP (RN), ',', OP (RM), ',', OP (UIMM16), 0 } }, & ifmt_dsp, { 0xf0000000 } }, +/* dsp0 $c5rnmuimm24 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (C5RNMUIMM24), 0 } }, + & ifmt_dsp0, { 0xf0000000 } + }, +/* dsp1 $rn,$c5rmuimm20 */ + { + { 0, 0, 0, 0 }, + { { MNEM, ' ', OP (RN), ',', OP (C5RMUIMM20), 0 } }, + & ifmt_dsp1, { 0xf0000000 } + }, /* sb $rnc,($rma) */ { { 0, 0, 0, 0 }, @@ -1795,14 +1815,6 @@ 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 } } }; @@ -1876,16 +1888,6 @@ 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<