X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Fsh-dis.c;h=5d771a53a50a5732c43d91f6a860faa7550bf898;hb=63ffd7c9131c0e9723016d33cf8d435cc508d02b;hp=7af514b8ea57ccfeef5dc3b92f933eabf40e2535;hpb=1a0670f37442b7ae904932b347353046126b990c;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c index 7af514b8ea..5d771a53a5 100644 --- a/opcodes/sh-dis.c +++ b/opcodes/sh-dis.c @@ -1,5 +1,5 @@ /* Disassemble SH instructions. - Copyright (C) 1993-2016 Free Software Foundation, Inc. + Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -25,11 +25,7 @@ #define DEFINE_TABLE #include "sh-opc.h" -#include "dis-asm.h" - -#ifdef ARCH_all -#define INCLUDE_SHMEDIA -#endif +#include "disassemble.h" static void print_movxy (const sh_opcode_info *op, @@ -106,8 +102,7 @@ print_movxy (const sh_opcode_info *op, /* 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) @@ -117,7 +112,10 @@ 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. */ @@ -125,8 +123,8 @@ print_insn_ddt (int insn, struct disassemble_info *info) 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) { @@ -161,7 +159,7 @@ print_insn_ddt (int insn, struct disassemble_info *info) 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; @@ -193,6 +191,8 @@ print_insn_ddt (int insn, struct disassemble_info *info) 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); } } @@ -404,16 +404,6 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info) && bfd_asymbol_flavour(*info->symbols) == bfd_target_coff_flavour) target_arch = arch_sh4; break; - case bfd_mach_sh5: -#ifdef INCLUDE_SHMEDIA - status = print_insn_sh64 (memaddr, info); - if (status != -2) - return status; -#endif - /* When we get here for sh64, it's because we want to disassemble - SHcompact, i.e. arch_sh4. */ - target_arch = arch_sh4; - break; default: target_arch = sh_get_arch_from_bfd_mach (info->mach); }