Files
binutils-gdb/binutils/testsuite/binutils-all/mips/mips16-undecoded.s
Maciej W. Rozycki 11dd08e9a0 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.
2016-12-20 12:05:48 +00:00

199 lines
3.6 KiB
ArmAsm

.text
.module mips3
.set mips16
.globl foo
.ent foo
foo:
# Individual major opcodes.
addiu $2, $sp, 0x4011
.half 0xf008, 0x0211
.half 0xf008, 0x0231
.half 0xf008, 0x0251
.half 0xf008, 0x0291
addiu $2, $pc, 0x4011
.half 0xf008, 0x0a11
.half 0xf008, 0x0a31
.half 0xf008, 0x0a51
.half 0xf008, 0x0a91
b . + 0x8026
.half 0xf008, 0x1011
.half 0xf008, 0x1031
.half 0xf008, 0x1051
.half 0xf008, 0x1091
.half 0xf008, 0x1111
.half 0xf008, 0x1211
.half 0xf008, 0x1411
beqz $2, . + 0x8026
.half 0xf008, 0x2211
.half 0xf008, 0x2231
.half 0xf008, 0x2251
.half 0xf008, 0x2291
bnez $2, . + 0x8026
.half 0xf008, 0x2a11
.half 0xf008, 0x2a31
.half 0xf008, 0x2a51
.half 0xf008, 0x2a91
addiu $2, 0x4011
.half 0xf008, 0x4a11
.half 0xf008, 0x4a31
.half 0xf008, 0x4a51
.half 0xf008, 0x4a91
slti $2, 0x4011
.half 0xf008, 0x5211
.half 0xf008, 0x5231
.half 0xf008, 0x5251
.half 0xf008, 0x5291
sltiu $2, 0x4011
.half 0xf008, 0x5a11
.half 0xf008, 0x5a31
.half 0xf008, 0x5a51
.half 0xf008, 0x5a91
li $2, 0x4011
.half 0xf008, 0x6a11
.half 0xf008, 0x6a31
.half 0xf008, 0x6a51
.half 0xf008, 0x6a91
cmpi $2, 0x4011
.half 0xf008, 0x7211
.half 0xf008, 0x7231
.half 0xf008, 0x7251
.half 0xf008, 0x7291
lw $2, 0x4011($sp)
.half 0xf008, 0x9211
.half 0xf008, 0x9231
.half 0xf008, 0x9251
.half 0xf008, 0x9291
lw $2, 0x4011($pc)
.half 0xf008, 0xb211
.half 0xf008, 0xb231
.half 0xf008, 0xb251
.half 0xf008, 0xb291
sw $2, 0x4011($sp)
.half 0xf008, 0xd211
.half 0xf008, 0xd231
.half 0xf008, 0xd251
.half 0xf008, 0xd291
# I8 major opcode.
bteqz . + 0x8026
.half 0xf008, 0x6011
.half 0xf008, 0x6031
.half 0xf008, 0x6051
.half 0xf008, 0x6091
btnez . + 0x8026
.half 0xf008, 0x6111
.half 0xf008, 0x6131
.half 0xf008, 0x6151
.half 0xf008, 0x6191
sw $ra, 0x4011($sp)
.half 0xf008, 0x6211
.half 0xf008, 0x6231
.half 0xf008, 0x6251
.half 0xf008, 0x6291
addiu $sp, 0x4011
.half 0xf008, 0x6311
.half 0xf008, 0x6331
.half 0xf008, 0x6351
.half 0xf008, 0x6391
# SHIFT major opcode
sll $2, $3, 0x14
.half 0xf500, 0x3260
.half 0xf500, 0x3264
.half 0xf500, 0x3268
.half 0xf500, 0x3270
.half 0xf501, 0x3260
.half 0xf502, 0x3260
.half 0xf504, 0x3260
.half 0xf508, 0x3260
.half 0xf510, 0x3260
.half 0xf520, 0x3260
dsll $2, $3, 0x14
.half 0xf500, 0x3261
.half 0xf500, 0x3265
.half 0xf500, 0x3269
.half 0xf500, 0x3271
.half 0xf501, 0x3261
.half 0xf502, 0x3261
.half 0xf504, 0x3261
.half 0xf508, 0x3261
.half 0xf510, 0x3261
.half 0xf520, 0x3261
srl $2, $3, 0x14
.half 0xf500, 0x3262
.half 0xf500, 0x3266
.half 0xf500, 0x326a
.half 0xf500, 0x3272
.half 0xf501, 0x3262
.half 0xf502, 0x3262
.half 0xf504, 0x3262
.half 0xf508, 0x3262
.half 0xf510, 0x3262
.half 0xf520, 0x3262
sra $2, $3, 0x14
.half 0xf500, 0x3263
.half 0xf500, 0x3267
.half 0xf500, 0x326b
.half 0xf500, 0x3273
.half 0xf501, 0x3263
.half 0xf502, 0x3263
.half 0xf504, 0x3263
.half 0xf508, 0x3263
.half 0xf510, 0x3263
.half 0xf520, 0x3263
# RR major opcode
dsrl $2, 0x14
.half 0xf500, 0xe848
.half 0xf500, 0xe948
.half 0xf500, 0xea48
.half 0xf500, 0xec48
.half 0xf501, 0xe848
.half 0xf502, 0xe848
.half 0xf504, 0xe848
.half 0xf508, 0xe848
.half 0xf510, 0xe848
.half 0xf520, 0xe848
dsra $2, 0x14
.half 0xf500, 0xe853
.half 0xf500, 0xe953
.half 0xf500, 0xea53
.half 0xf500, 0xec53
.half 0xf501, 0xe853
.half 0xf502, 0xe853
.half 0xf504, 0xe853
.half 0xf508, 0xe853
.half 0xf510, 0xe853
.half 0xf520, 0xe853
# I64 major opcode.
daddiu $sp, 0x4011
.half 0xf008, 0xfb11
.half 0xf008, 0xfb31
.half 0xf008, 0xfb51
.half 0xf008, 0xfb91
.end foo
# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
.align 4, 0
.space 16