opcodes/mips: disassemble unknown micromips instructions as two shorts
authorAndrew Burgess <aburgess@redhat.com>
Fri, 6 Jan 2023 16:42:23 +0000 (16:42 +0000)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 13 Feb 2023 12:05:32 +0000 (12:05 +0000)
commit77be7257442b1ca19deba8ec0e424f0faf53321f
tree4d70af2c5d233796f906dfdd10a4d8435b26f785
parent97c195191578e9a68bfbb810eea373f5f3efcb7d
opcodes/mips: disassemble unknown micromips instructions as two shorts

Before commit:

  commit 2438b771ee07be19d5b01ea55e077dd8b7cef445
  Date:   Wed Nov 2 15:53:43 2022 +0000

      opcodes/mips: use .word/.short for undefined instructions

unknown 32-bit microMIPS instructions were disassembled as a raw
32-bit number with no '.word' directive.  The above commit changed
this and added a '.word' directive before the 32-bit number.

It was pointed out on the mailing list, that for microMIPS it would be
better to display such 32-bit instructions using a '.short' directive
followed by two 16-bit values.

This commit updates the mips disassembler to do this, and adds a new
test that validates this output.
binutils/testsuite/binutils-all/mips/micromips-reserved-enc-n32.d [new file with mode: 0644]
binutils/testsuite/binutils-all/mips/micromips-reserved-enc-n64.d [new file with mode: 0644]
binutils/testsuite/binutils-all/mips/micromips-reserved-enc-o32.d [new file with mode: 0644]
binutils/testsuite/binutils-all/mips/micromips-reserved-enc.s [new file with mode: 0644]
binutils/testsuite/binutils-all/mips/mips.exp
opcodes/mips-dis.c