/* Disassemble SH instructions.
- Copyright (C) 1993-2019 Free Software Foundation, Inc.
+ Copyright (C) 1993-2020 Free Software Foundation, Inc.
This file is part of the GNU opcodes library.
/* Print a double data transfer insn. INSN is just the lower three
nibbles of the insn, i.e. field a and the bit that indicates if
- a parallel processing insn follows.
- Return nonzero if a field b of a parallel processing insns follows. */
+ a parallel processing insn follows. */
static void
print_insn_ddt (int insn, struct disassemble_info *info)
/* If this is just a nop, make sure to emit something. */
if (insn == 0x000)
- fprintf_fn (stream, "nopx\tnopy");
+ {
+ fprintf_fn (stream, "nopx\tnopy");
+ return;
+ }
/* If a parallel processing insn was printed before,
and we got a non-nop, emit a tab. */
fprintf_fn (stream, "\t");
/* Check if either the x or y part is invalid. */
- if (((insn & 0xc) == 0 && (insn & 0x2a0))
- || ((insn & 3) == 0 && (insn & 0x150)))
+ if (((insn & 3) != 0 && (insn & 0xc) == 0 && (insn & 0x2a0))
+ || ((insn & 3) == 0 && (insn & 0xc) != 0 && (insn & 0x150)))
if (info->mach != bfd_mach_sh_dsp
&& info->mach != bfd_mach_sh3_dsp)
{
fprintf_fn, stream);
}
else
- fprintf_fn (stream, ".word 0x%x", insn);
+ fprintf_fn (stream, ".word 0x%x", insn | 0xf000);
else
{
static const sh_opcode_info *first_movx, *first_movy;
print_movxy (opy, ((insn >> 8) & 1) + 6, (insn >> 6) & 1,
fprintf_fn, stream);
}
+ if (!insn_x && !insn_y && ((insn & 0x3ff) != 0 || (insn & 0x800) == 0))
+ fprintf_fn (stream, ".word 0x%x", insn | 0xf000);
}
}