X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=opcodes%2Fm10200-dis.c;h=537ce46ae02d736652c75ca2055c3925469524ee;hb=cd22ee05137b858fead379976d4c51e5cf23d907;hp=501ba716db111a668f62400209e7674349a46376;hpb=219d1afa89d0d53ca93a684cac341f16470f3ca0;p=thirdparty%2Fbinutils-gdb.git diff --git a/opcodes/m10200-dis.c b/opcodes/m10200-dis.c index 501ba716db1..537ce46ae02 100644 --- a/opcodes/m10200-dis.c +++ b/opcodes/m10200-dis.c @@ -1,5 +1,5 @@ /* Disassemble MN10200 instructions. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2020 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -83,16 +83,18 @@ disassemble (bfd_vma memaddr, operand = &mn10200_operands[*opindex_ptr]; - if ((operand->flags & MN10200_OPERAND_EXTENDED) != 0) + if ((operand->flags & MN10200_OPERAND_DREG) != 0 + || (operand->flags & MN10200_OPERAND_AREG) != 0) + value = ((insn >> (operand->shift + extra_shift)) + & ((1 << operand->bits) - 1)); + else if ((operand->flags & MN10200_OPERAND_EXTENDED) != 0) { value = (insn & 0xffff) << 8; value |= extension; } else - { - value = ((insn >> (operand->shift)) - & ((1L << operand->bits) - 1L)); - } + value = ((insn >> (operand->shift)) + & ((1L << operand->bits) - 1L)); if ((operand->flags & MN10200_OPERAND_SIGNED) != 0) value = ((long)(value << (32 - operand->bits)) @@ -106,18 +108,10 @@ disassemble (bfd_vma memaddr, nocomma = 0; if ((operand->flags & MN10200_OPERAND_DREG) != 0) - { - value = ((insn >> (operand->shift + extra_shift)) - & ((1 << operand->bits) - 1)); - (*info->fprintf_func) (info->stream, "d%ld", value); - } + (*info->fprintf_func) (info->stream, "d%ld", value); else if ((operand->flags & MN10200_OPERAND_AREG) != 0) - { - value = ((insn >> (operand->shift + extra_shift)) - & ((1 << operand->bits) - 1)); - (*info->fprintf_func) (info->stream, "a%ld", value); - } + (*info->fprintf_func) (info->stream, "a%ld", value); else if ((operand->flags & MN10200_OPERAND_PSW) != 0) (*info->fprintf_func) (info->stream, "psw");