• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision6e3d1f0728d980a384c5aa63ce7f2ff3919c5024 (tree)
l'heure2017-04-25 19:55:34
AuteurMaciej W. Rozycki <macro@imgt...>
CommiterMaciej W. Rozycki

Message de Log

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.

Change Summary

Modification

--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,10 @@
1+2017-04-25 Maciej W. Rozycki <macro@imgtec.com>
2+
3+ * testsuite/binutils-all/mips/mips16-alias.d: New test.
4+ * testsuite/binutils-all/mips/mips16-noalias.d: New test.
5+ * testsuite/binutils-all/mips/mips16-alias.s: New test source.
6+ * testsuite/binutils-all/mips/mips.exp: Run the new tests.
7+
18 2017-04-23 Alan Modra <amodra@gmail.com>
29
310 PR 21418
--- a/binutils/testsuite/binutils-all/mips/mips.exp
+++ b/binutils/testsuite/binutils-all/mips/mips.exp
@@ -30,4 +30,6 @@ if [is_elf_format] {
3030 run_dump_test "mips16-pcrel"
3131 run_dump_test "mips16-extend-noinsn"
3232 run_dump_test "mips16-extend-insn"
33+ run_dump_test "mips16-alias"
34+ run_dump_test "mips16-noalias"
3335 }
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips16-alias.d
@@ -0,0 +1,15 @@
1+#PROG: objcopy
2+#objdump: -d --prefix-addresses --show-raw-insn
3+#name: MIPS16 instruction alias disassembly
4+#as: -32 -mips3
5+
6+.*: +file format .*mips.*
7+
8+Disassembly of section \.text:
9+[0-9a-f]+ <[^>]*> 6500 nop
10+[0-9a-f]+ <[^>]*> 0a08 la v0,00000020 <bar>
11+[0-9a-f]+ <[^>]*> b207 lw v0,00000020 <bar>
12+[0-9a-f]+ <[^>]*> fe47 dla v0,00000020 <bar>
13+[0-9a-f]+ <[^>]*> fc43 ld v0,00000020 <bar>
14+ \.\.\.
15+ \.\.\.
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips16-alias.s
@@ -0,0 +1,20 @@
1+ .text
2+ .set mips16
3+ .ent foo
4+foo:
5+ nop
6+ la $2, bar
7+ lw $2, bar
8+ dla $2, bar
9+ ld $2, bar
10+ .set nomips16
11+ .end foo
12+
13+# Force some (non-delay-slot) zero bytes, to make 'objdump' print ...
14+ .align 4, 0
15+ .space 16
16+
17+ .type bar, @object
18+bar:
19+ .long 0
20+ .size bar, . - bar
--- /dev/null
+++ b/binutils/testsuite/binutils-all/mips/mips16-noalias.d
@@ -0,0 +1,16 @@
1+#PROG: objcopy
2+#objdump: -M no-aliases -d --prefix-addresses --show-raw-insn
3+#name: MIPS16 canonical alias disassembly
4+#as: -32 -mips3
5+#source: mips16-alias.s
6+
7+.*: +file format .*mips.*
8+
9+Disassembly of section \.text:
10+[0-9a-f]+ <[^>]*> 6500 move zero,s0
11+[0-9a-f]+ <[^>]*> 0a08 addiu v0,\$pc,32
12+[0-9a-f]+ <[^>]*> b207 lw v0,28\(\$pc\)
13+[0-9a-f]+ <[^>]*> fe47 daddiu v0,\$pc,28
14+[0-9a-f]+ <[^>]*> fc43 ld v0,24\(\$pc\)
15+ \.\.\.
16+ \.\.\.
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
1+2017-04-25 Maciej W. Rozycki <macro@imgtec.com>
2+
3+ * mips16-opc.c (AL): New macro.
4+ (mips16_opcodes): Mark "nop", "la", "dla", and synthetic forms
5+ of "ld" and "lw" as aliases.
6+
17 2017-04-24 Tamar Christina <tamar.christina@arm.com>
28
39 * aarch64-opc.c (aarch64_logical_immediate_p): Update DEBUG_TRACE
--- a/opcodes/mips16-opc.c
+++ b/opcodes/mips16-opc.c
@@ -145,6 +145,8 @@ decode_mips16_operand (char type, bfd_boolean extended_p)
145145 /* Use some short hand macros to keep down the length of the lines in
146146 the opcodes table. */
147147
148+#define AL INSN2_ALIAS
149+
148150 #define UBD INSN_UNCOND_BRANCH_DELAY
149151
150152 #define WR_1 INSN_WRITE_1
@@ -188,8 +190,8 @@ decode_mips16_operand (char type, bfd_boolean extended_p)
188190 const struct mips_opcode mips16_opcodes[] =
189191 {
190192 /* name, args, match, mask, pinfo, pinfo2, membership, ase, exclusions */
191-{"nop", "", 0x6500, 0xffff, 0, SH|RD_16, I1, 0, 0 }, /* move $0,$Z */
192-{"la", "x,A", 0x0800, 0xf800, WR_1, RD_PC, I1, 0, 0 },
193+{"nop", "", 0x6500, 0xffff, 0, SH|RD_16|AL, I1, 0, 0 }, /* move $0,$Z */
194+{"la", "x,A", 0x0800, 0xf800, WR_1, RD_PC|AL, I1, 0, 0 },
193195 {"abs", "x,w", 0, (int) M_ABS, INSN_MACRO, 0, I1, 0, 0 },
194196 {"addiu", "y,x,F", 0x4000, 0xf810, WR_1|RD_2, 0, I1, 0, 0 },
195197 {"addiu", "x,k", 0x4800, 0xf800, MOD_1, 0, I1, 0, 0 },
@@ -234,7 +236,7 @@ const struct mips_opcode mips16_opcodes[] =
234236 {"cmpi", "x,U", 0x7000, 0xf800, RD_1|WR_T, 0, I1, 0, 0 },
235237 {"cmp", "x,y", 0xe80a, 0xf81f, RD_1|RD_2|WR_T, SH, I1, 0, 0 },
236238 {"cmp", "x,U", 0x7000, 0xf800, RD_1|WR_T, 0, I1, 0, 0 },
237-{"dla", "y,E", 0xfe00, 0xff00, WR_1, RD_PC, I3, 0, 0 },
239+{"dla", "y,E", 0xfe00, 0xff00, WR_1, RD_PC|AL, I3, 0, 0 },
238240 {"daddiu", "y,x,F", 0x4010, 0xf810, WR_1|RD_2, 0, I3, 0, 0 },
239241 {"daddiu", "y,j", 0xfd00, 0xff00, MOD_1, 0, I3, 0, 0 },
240242 {"daddiu", "S,K", 0xfb00, 0xff00, 0, MOD_SP, I3, 0, 0 },
@@ -301,14 +303,14 @@ const struct mips_opcode mips16_opcodes[] =
301303 {"lb", "y,5(x)", 0x8000, 0xf800, WR_1|RD_3, 0, I1, 0, 0 },
302304 {"lbu", "y,5(x)", 0xa000, 0xf800, WR_1|RD_3, 0, I1, 0, 0 },
303305 {"ld", "y,D(x)", 0x3800, 0xf800, WR_1|RD_3, 0, I3, 0, 0 },
304-{"ld", "y,B", 0xfc00, 0xff00, WR_1, RD_PC, I3, 0, 0 },
306+{"ld", "y,B", 0xfc00, 0xff00, WR_1, RD_PC|AL, I3, 0, 0 },
305307 {"ld", "y,D(P)", 0xfc00, 0xff00, WR_1, RD_PC, I3, 0, 0 },
306308 {"ld", "y,D(S)", 0xf800, 0xff00, WR_1, RD_SP, I3, 0, 0 },
307309 {"lh", "y,H(x)", 0x8800, 0xf800, WR_1|RD_3, 0, I1, 0, 0 },
308310 {"lhu", "y,H(x)", 0xa800, 0xf800, WR_1|RD_3, 0, I1, 0, 0 },
309311 {"li", "x,U", 0x6800, 0xf800, WR_1, 0, I1, 0, 0 },
310312 {"lw", "y,W(x)", 0x9800, 0xf800, WR_1|RD_3, 0, I1, 0, 0 },
311-{"lw", "x,A", 0xb000, 0xf800, WR_1, RD_PC, I1, 0, 0 },
313+{"lw", "x,A", 0xb000, 0xf800, WR_1, RD_PC|AL, I1, 0, 0 },
312314 {"lw", "x,V(P)", 0xb000, 0xf800, WR_1, RD_PC, I1, 0, 0 },
313315 {"lw", "x,V(S)", 0x9000, 0xf800, WR_1, RD_SP, I1, 0, 0 },
314316 {"lwu", "y,W(x)", 0xb800, 0xf800, WR_1|RD_3, 0, I3, 0, 0 },