From 11dd08e9a0a2b7115aac32d9599f1bdb0ad12ea6 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Tue, 20 Dec 2016 11:38:53 +0000 Subject: MIPS16/opcodes: Respect ISA and ASE in disassembly Limit MIPS16 instruction disassembly according to the ISA level and ASE set selected, as with the regular MIPS and microMIPS instruction sets. Retain the property of `objdump -m mips:16' disassembling all MIPS16 instructions however, regardless of any ISA level recorded in the binary examined. To validate the disassembler use the GAS test suite for its convenience of running tests across multiple ISAs, even though placing the tests in the binutils test suite would be more appropriate. Adjust the single binutils test which depends on 64-bit instruction disassembly to have the ISA level required actually recorded in the binary examined. opcodes/ * mips-dis.c (mips_arch_choices): Use ISA_MIPS64 rather than ISA_MIPS3 as the `isa' selection in the `bfd_mach_mips16' entry. (print_insn_mips16): Check opcode entries for validity against the ISA level and ASE set selected. binutils/ * testsuite/binutils-all/mips/mips16-undecoded.s: Use `.module' rather than `.set' to set the ISA level. gas/ * testsuite/gas/mips/mips16-sub.d: New test. * testsuite/gas/mips/mips16-32@mips16-sub.d: New test. * testsuite/gas/mips/mips16e-32@mips16-sub.d: New test. * testsuite/gas/mips/mips16e-sub.d: New test. * testsuite/gas/mips/mips16-32@mips16e-sub.d: New test. * testsuite/gas/mips/mips16-64@mips16e-sub.d: New test. * testsuite/gas/mips/mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16-32@mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16-64@mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16e-32@mips16e-64-sub.d: New test. * testsuite/gas/mips/mips16-sub.s: New test source. * testsuite/gas/mips/mips16e-sub.s: New test source. * testsuite/gas/mips/mips16e-64-sub.s: New test source. * testsuite/gas/mips/mips.exp: Run the new tests. --- binutils/ChangeLog | 5 +++++ binutils/testsuite/binutils-all/mips/mips16-undecoded.s | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'binutils') diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 6e9de9b..bcbbe67 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,5 +1,10 @@ 2016-12-20 Maciej W. Rozycki + * testsuite/binutils-all/mips/mips16-undecoded.s: Use `.module' + rather than `.set' to set the ISA level. + +2016-12-20 Maciej W. Rozycki + * testsuite/binutils-all/mips/mips16-extend-noinsn.d: Adjust test for separate EXTEND prefix disassembly. diff --git a/binutils/testsuite/binutils-all/mips/mips16-undecoded.s b/binutils/testsuite/binutils-all/mips/mips16-undecoded.s index 2736ae4..e17c45d 100644 --- a/binutils/testsuite/binutils-all/mips/mips16-undecoded.s +++ b/binutils/testsuite/binutils-all/mips/mips16-undecoded.s @@ -1,5 +1,5 @@ .text - .set mips3 + .module mips3 .set mips16 .globl foo .ent foo -- cgit v1.1