aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@imgtec.com>2017-04-25 11:44:29 +0100
committerMaciej W. Rozycki <macro@imgtec.com>2017-04-25 11:55:34 +0100
commit6e3d1f0728d980a384c5aa63ce7f2ff3919c5024 (patch)
tree131f83b92152d6710c91c9112b8cc07252438c58 /binutils
parentadc1273cb27286452ed8b32c5ca3ea263b4854f0 (diff)
downloadgdb-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')
-rw-r--r--binutils/ChangeLog7
-rw-r--r--binutils/testsuite/binutils-all/mips/mips.exp2
-rw-r--r--binutils/testsuite/binutils-all/mips/mips16-alias.d15
-rw-r--r--binutils/testsuite/binutils-all/mips/mips16-alias.s20
-rw-r--r--binutils/testsuite/binutils-all/mips/mips16-noalias.d16
5 files changed, 60 insertions, 0 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index eb540fa..d5b515f 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
+2017-04-25 Maciej W. Rozycki <macro@imgtec.com>
+
+ * 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.
+
2017-04-23 Alan Modra <amodra@gmail.com>
PR 21418
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\)
+ \.\.\.
+ \.\.\.