X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=opcodes%2Fmoxie-dis.c;h=4e67e2c5551443e140a0f5fa3a71a0ba4205e7a1;hb=aa820537ead0135a7c38c619039dce8a6fc74ed1;hp=b1d123f5a440c393117de94a14648b9af3ff08e4;hpb=20135e4cea8994900955e560910b2e675881fa95;p=platform%2Fupstream%2Fbinutils.git diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c index b1d123f..4e67e2c 100644 --- a/opcodes/moxie-dis.c +++ b/opcodes/moxie-dis.c @@ -33,6 +33,7 @@ static void *stream; /* Macros to extract operands from the instruction word. */ #define OP_A(i) ((i >> 4) & 0xf) #define OP_B(i) (i & 0xf) +#define INST2OFFSET(o) ((((signed short)((o & ((1<<10)-1))<<6))>>6)<<1) static const char * reg_names[16] = { "$fp", "$sp", "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", @@ -93,6 +94,17 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) length = 6; } break; + case MOXIE_F1_M: + { + unsigned imm; + if ((status = info->read_memory_func (addr + 2, buffer, 4, info))) + goto fail; + imm = bfd_getb32 (buffer); + fpr (stream, "%s\t", opcode->name); + info->print_address_func ((bfd_vma) imm, info); + length = 6; + } + break; case MOXIE_F1_AiB: fpr (stream, "%s\t(%s), %s", opcode->name, reg_names[OP_A(iword)], reg_names[OP_B(iword)]); @@ -165,11 +177,13 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) else { /* Extract the Form 3 opcode. */ - opcode = &moxie_form2_opc_info[(iword >> 12) & 3]; + opcode = &moxie_form3_opc_info[(iword >> 10) & 15]; switch (opcode->itype) { - case MOXIE_F3_NARG: - fpr (stream, "%s", opcode->name); + case MOXIE_F3_PCREL: + fpr (stream, "%s\t", opcode->name); + info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword)), + info); break; default: abort();