From bffb60047d90919d8c3a11db9ae7e9f45553a657 Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Sat, 27 Dec 2014 10:57:04 -0500 Subject: Limit moxie sto/ldo offsets to 16 bits --- opcodes/ChangeLog | 6 ++++++ opcodes/moxie-dis.c | 20 ++++++++++---------- opcodes/moxie-opc.c | 12 ++++++------ 3 files changed, 22 insertions(+), 16 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 8de16f6..dd302b2 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2014-12-27 Anthony Green * moxie-opc: Define mul.x and umul.x instructions. Remove diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c index 90e0464..923dda1 100644 --- a/opcodes/moxie-dis.c +++ b/opcodes/moxie-dis.c @@ -140,37 +140,37 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) length = 6; } break; - case MOXIE_F1_AiB4: + case MOXIE_F1_AiB2: { unsigned imm; - if ((status = info->read_memory_func (addr+2, buffer, 4, info))) + if ((status = info->read_memory_func (addr+2, buffer, 2, info))) goto fail; if (info->endian == BFD_ENDIAN_BIG) - imm = bfd_getb32 (buffer); + imm = bfd_getb16 (buffer); else - imm = bfd_getl32 (buffer); + imm = bfd_getl16 (buffer); fpr (stream, "%s\t0x%x(%s), %s", opcode->name, imm, reg_names[OP_A(iword)], reg_names[OP_B(iword)]); - length = 6; + length = 4; } break; - case MOXIE_F1_ABi4: + case MOXIE_F1_ABi2: { unsigned imm; - if ((status = info->read_memory_func (addr+2, buffer, 4, info))) + if ((status = info->read_memory_func (addr+2, buffer, 2, info))) goto fail; if (info->endian == BFD_ENDIAN_BIG) - imm = bfd_getb32 (buffer); + imm = bfd_getb16 (buffer); else - imm = bfd_getl32 (buffer); + imm = bfd_getl16 (buffer); fpr (stream, "%s\t%s, 0x%x(%s)", opcode->name, reg_names[OP_A(iword)], imm, reg_names[OP_B(iword)]); - length = 6; + length = 4; } break; case MOXIE_BAD: diff --git a/opcodes/moxie-opc.c b/opcodes/moxie-opc.c index a858088..b3603c9 100644 --- a/opcodes/moxie-opc.c +++ b/opcodes/moxie-opc.c @@ -64,8 +64,8 @@ const moxie_opc_info_t moxie_form1_opc_info[128] = { 0x09, MOXIE_F1_4A, "sta.l" }, { 0x0a, MOXIE_F1_ABi, "ld.l" }, { 0x0b, MOXIE_F1_AiB, "st.l" }, - { 0x0c, MOXIE_F1_ABi4, "ldo.l" }, - { 0x0d, MOXIE_F1_AiB4, "sto.l" }, + { 0x0c, MOXIE_F1_ABi2, "ldo.l" }, + { 0x0d, MOXIE_F1_AiB2, "sto.l" }, { 0x0e, MOXIE_F1_AB, "cmp" }, { 0x0f, MOXIE_F1_NARG, "nop" }, { 0x10, MOXIE_F1_AB, "sex.b" }, @@ -106,10 +106,10 @@ const moxie_opc_info_t moxie_form1_opc_info[128] = { 0x33, MOXIE_F1_AB, "mod" }, { 0x34, MOXIE_F1_AB, "umod" }, { 0x35, MOXIE_F1_NARG, "brk" }, - { 0x36, MOXIE_F1_ABi4, "ldo.b" }, - { 0x37, MOXIE_F1_AiB4, "sto.b" }, - { 0x38, MOXIE_F1_ABi4, "ldo.s" }, - { 0x39, MOXIE_F1_AiB4, "sto.s" }, + { 0x36, MOXIE_F1_ABi2, "ldo.b" }, + { 0x37, MOXIE_F1_AiB2, "sto.b" }, + { 0x38, MOXIE_F1_ABi2, "ldo.s" }, + { 0x39, MOXIE_F1_AiB2, "sto.s" }, { 0x3a, MOXIE_BAD, "bad" }, { 0x3b, MOXIE_BAD, "bad" }, { 0x3c, MOXIE_BAD, "bad" }, -- cgit v1.1