aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2016-09-15 12:24:24 +0200
committerClaudiu Zissulescu <claziss@synopsys.com>2016-09-16 14:49:33 +0200
commitf807f43d7eba5bba3042554f9b3e884d71a68309 (patch)
treeec9c600313b94d50ab2982fb20db1c256b799add /gas
parent0a0df908277bc9c63ec546fb7cd15ea14ad4d9a0 (diff)
downloadfsf-binutils-gdb-f807f43d7eba5bba3042554f9b3e884d71a68309.zip
fsf-binutils-gdb-f807f43d7eba5bba3042554f9b3e884d71a68309.tar.gz
fsf-binutils-gdb-f807f43d7eba5bba3042554f9b3e884d71a68309.tar.bz2
[ARC] Disassemble correctly extension instructions.
For each MAJOR-MINOR opcode tuple, we can have either a 3-operand, or 2-operand, or a single operand instruction format, depending on the values present in i-field, and a-field. The disassembler is reading the section containing the extension instruction format and stores them in a table. Each table element represents a linked list with encodings for a particular MAJOR-MINOR tuple. The current implementation checks only against the first element of the list, hence, the issue. This patch is walking the linked list until empty or finds an opcode match. It also adds a test outlining the found problem. opcodes/ 2016-09-15 Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (find_format): Walk the linked list pointed by einsn. gas/ 2016-09-15 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/textinsnxop.d: New file. * testsuite/gas/arc/textinsnxop.s: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/testsuite/gas/arc/textinsnxop.d12
-rw-r--r--gas/testsuite/gas/arc/textinsnxop.s10
3 files changed, 27 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index c2e390a..8a4e15f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-15 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * testsuite/gas/arc/textinsnxop.d: New file.
+ * testsuite/gas/arc/textinsnxop.s: Likewise.
+
2016-09-15 Jose E. Marchesi <jose.marchesi@oracle.com>
* testsuite/gas/sparc/sparc.exp (gas_64_check): Run
diff --git a/gas/testsuite/gas/arc/textinsnxop.d b/gas/testsuite/gas/arc/textinsnxop.d
new file mode 100644
index 0000000..14556e6
--- /dev/null
+++ b/gas/testsuite/gas/arc/textinsnxop.d
@@ -0,0 +1,12 @@
+#objdump: -d
+
+.*: +file format .*arc.*
+
+
+Disassembly of section .text:
+
+[0-9a-f]+ <start>:
+ 0: 3921 0080 insn1 r0,r1,r2
+ 4: 382f 0061 insn2 r0,r1
+ 8: 392f 407f insn3 r1
+ c: 396f 403f insn4
diff --git a/gas/testsuite/gas/arc/textinsnxop.s b/gas/testsuite/gas/arc/textinsnxop.s
new file mode 100644
index 0000000..be8111d
--- /dev/null
+++ b/gas/testsuite/gas/arc/textinsnxop.s
@@ -0,0 +1,10 @@
+ .extInstruction insn1, 7, 0x21, SUFFIX_NONE, SYNTAX_3OP
+ .extInstruction insn2, 7, 0x21, SUFFIX_NONE, SYNTAX_2OP
+ .extInstruction insn3, 7, 0x21, SUFFIX_NONE, SYNTAX_1OP
+ .extInstruction insn4, 7, 0x21, SUFFIX_NONE, SYNTAX_NOP
+
+start:
+ insn1 r0,r1,r2
+ insn2 r0,r1
+ insn3 r1
+ insn4