diff options
author | Maciej W. Rozycki <macro@imgtec.com> | 2017-04-25 11:44:29 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@imgtec.com> | 2017-04-25 11:55:34 +0100 |
commit | 6e3d1f0728d980a384c5aa63ce7f2ff3919c5024 (patch) | |
tree | 131f83b92152d6710c91c9112b8cc07252438c58 /binutils/testsuite | |
parent | adc1273cb27286452ed8b32c5ca3ea263b4854f0 (diff) | |
download | gdb-6e3d1f0728d980a384c5aa63ce7f2ff3919c5024.zip gdb-6e3d1f0728d980a384c5aa63ce7f2ff3919c5024.tar.gz gdb-6e3d1f0728d980a384c5aa63ce7f2ff3919c5024.tar.bz2 |
MIPS16/opcodes: Annotate instruction aliases
Complement commit 986e18a5a9fd ("Add a second 'pinfo' member to
mips_opcode to extend number of available bits"),
<https://sourceware.org/ml/binutils/2005-01/msg00261.html>, and annotate
MIPS16 NOP, LA, DLA and the synthetic forms of LD and LW instructions as
aliases. These correspond to MOVE, and the PC-relative ADDIU, DADDIU,
LD and LW hardware instructions respectively.
binutils/
* testsuite/binutils-all/mips/mips16-alias.d: New test.
* testsuite/binutils-all/mips/mips16-noalias.d: New test.
* testsuite/binutils-all/mips/mips16-alias.s: New test source.
* testsuite/binutils-all/mips/mips.exp: Run the new tests.
opcodes/
* mips16-opc.c (AL): New macro.
(mips16_opcodes): Mark "nop", "la", "dla", and synthetic forms
of "ld" and "lw" as aliases.
Diffstat (limited to 'binutils/testsuite')
-rw-r--r-- | binutils/testsuite/binutils-all/mips/mips.exp | 2 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/mips/mips16-alias.d | 15 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/mips/mips16-alias.s | 20 | ||||
-rw-r--r-- | binutils/testsuite/binutils-all/mips/mips16-noalias.d | 16 |
4 files changed, 53 insertions, 0 deletions
diff --git a/binutils/testsuite/binutils-all/mips/mips.exp b/binutils/testsuite/binutils-all/mips/mips.exp index 255d4f7..672515c 100644 --- a/binutils/testsuite/binutils-all/mips/mips.exp +++ b/binutils/testsuite/binutils-all/mips/mips.exp @@ -30,4 +30,6 @@ if [is_elf_format] { run_dump_test "mips16-pcrel" run_dump_test "mips16-extend-noinsn" run_dump_test "mips16-extend-insn" + run_dump_test "mips16-alias" + run_dump_test "mips16-noalias" } diff --git a/binutils/testsuite/binutils-all/mips/mips16-alias.d b/binutils/testsuite/binutils-all/mips/mips16-alias.d new file mode 100644 index 0000000..875615b --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/mips16-alias.d @@ -0,0 +1,15 @@ +#PROG: objcopy +#objdump: -d --prefix-addresses --show-raw-insn +#name: MIPS16 instruction alias disassembly +#as: -32 -mips3 + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 6500 nop +[0-9a-f]+ <[^>]*> 0a08 la v0,00000020 <bar> +[0-9a-f]+ <[^>]*> b207 lw v0,00000020 <bar> +[0-9a-f]+ <[^>]*> fe47 dla v0,00000020 <bar> +[0-9a-f]+ <[^>]*> fc43 ld v0,00000020 <bar> + \.\.\. + \.\.\. diff --git a/binutils/testsuite/binutils-all/mips/mips16-alias.s b/binutils/testsuite/binutils-all/mips/mips16-alias.s new file mode 100644 index 0000000..bda4f9e --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/mips16-alias.s @@ -0,0 +1,20 @@ + .text + .set mips16 + .ent foo +foo: + nop + la $2, bar + lw $2, bar + dla $2, bar + ld $2, bar + .set nomips16 + .end foo + +# Force some (non-delay-slot) zero bytes, to make 'objdump' print ... + .align 4, 0 + .space 16 + + .type bar, @object +bar: + .long 0 + .size bar, . - bar diff --git a/binutils/testsuite/binutils-all/mips/mips16-noalias.d b/binutils/testsuite/binutils-all/mips/mips16-noalias.d new file mode 100644 index 0000000..76f61bd --- /dev/null +++ b/binutils/testsuite/binutils-all/mips/mips16-noalias.d @@ -0,0 +1,16 @@ +#PROG: objcopy +#objdump: -M no-aliases -d --prefix-addresses --show-raw-insn +#name: MIPS16 canonical alias disassembly +#as: -32 -mips3 +#source: mips16-alias.s + +.*: +file format .*mips.* + +Disassembly of section \.text: +[0-9a-f]+ <[^>]*> 6500 move zero,s0 +[0-9a-f]+ <[^>]*> 0a08 addiu v0,\$pc,32 +[0-9a-f]+ <[^>]*> b207 lw v0,28\(\$pc\) +[0-9a-f]+ <[^>]*> fe47 daddiu v0,\$pc,28 +[0-9a-f]+ <[^>]*> fc43 ld v0,24\(\$pc\) + \.\.\. + \.\.\. |