aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2016-05-03 13:44:13 +0200
committerClaudiu Zissulescu <claziss@synopsys.com>2016-05-04 16:18:32 +0200
commit945e0f82dad31db89a107b496532886fe215c011 (patch)
tree2d9fda4f448c3e7347ffb9cad26bb9a831e70bd8 /gas
parentedf689f02787121a49ea0e36cfaa051b06852c8b (diff)
downloadgdb-945e0f82dad31db89a107b496532886fe215c011.zip
gdb-945e0f82dad31db89a107b496532886fe215c011.tar.gz
gdb-945e0f82dad31db89a107b496532886fe215c011.tar.bz2
[ARC] Add SYNTAX_NOP and SYNTAX_1OP for extension instructions
gas/ 2016-05-03 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (syntaxclass): Add SYNTAX_NOP and SYNTAX_1OP. (arc_extinsn): Handle new introduced syntax. * testsuite/gas/arc/textinsn1op.d: New file. * testsuite/gas/arc/textinsn1op.s: Likewise. * doc/c-arc.texi: Document SYNTAX_NOP and SYNTAX_1OP. opcodes/ 2016-05-03 Claudiu Zissulescu <claziss@synopsys.com> * arc-ext.c (dump_ARC_extmap): Handle SYNATX_NOP and SYNTAX_1OP. (arcExtMap_genOpcode): Likewise. * arc-opc.c (arg_32bit_rc): Define new variable. (arg_32bit_u6): Likewise. (arg_32bit_limm): Likewise. include/ 2016-05-03 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (ARC_SYNTAX_1OP): Declare (ARC_SYNTAX_NOP): Likewsie. (ARC_OP1_MUST_BE_IMM): Update defined value. (ARC_OP1_IMM_IMPLIED): Likewise. (arg_32bit_rc, arg_32bit_u6, arg_32bit_limm): Declare.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog8
-rw-r--r--gas/config/tc-arc.c8
-rw-r--r--gas/doc/c-arc.texi6
-rw-r--r--gas/testsuite/gas/arc/textinsn1op.d17
-rw-r--r--gas/testsuite/gas/arc/textinsn1op.s12
5 files changed, 49 insertions, 2 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4edb8a2..4786e81 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,11 @@
+2016-05-03 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * config/tc-arc.c (syntaxclass): Add SYNTAX_NOP and SYNTAX_1OP.
+ (arc_extinsn): Handle new introduced syntax.
+ * testsuite/gas/arc/textinsn1op.d: New file.
+ * testsuite/gas/arc/textinsn1op.s: Likewise.
+ * doc/c-arc.texi: Document SYNTAX_NOP and SYNTAX_1OP.
+
2016-05-03 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* testsuite/gas/lns/lns.exp: Add avr to list of targets using
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 169b05c..b64174f 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -337,7 +337,9 @@ static const attributes_t suffixclass[] =
static const attributes_t syntaxclass[] =
{
{ "SYNTAX_3OP", 10, ARC_SYNTAX_3OP },
- { "SYNTAX_2OP", 10, ARC_SYNTAX_2OP }
+ { "SYNTAX_2OP", 10, ARC_SYNTAX_2OP },
+ { "SYNTAX_1OP", 10, ARC_SYNTAX_1OP },
+ { "SYNTAX_NOP", 10, ARC_SYNTAX_NOP }
};
/* Extension instruction syntax classes modifiers. */
@@ -4233,13 +4235,15 @@ arc_extinsn (int ignore ATTRIBUTE_UNUSED)
&& (einsn.major != 5) && (einsn.major != 9))
as_fatal (_("minor opcode not in range [0x00 - 0x3f]"));
- switch (einsn.syntax & (ARC_SYNTAX_3OP | ARC_SYNTAX_2OP))
+ switch (einsn.syntax & ARC_SYNTAX_MASK)
{
case ARC_SYNTAX_3OP:
if (einsn.modsyn & ARC_OP1_IMM_IMPLIED)
as_fatal (_("Improper use of OP1_IMM_IMPLIED"));
break;
case ARC_SYNTAX_2OP:
+ case ARC_SYNTAX_1OP:
+ case ARC_SYNTAX_NOP:
if (einsn.modsyn & ARC_OP1_MUST_BE_IMM)
as_fatal (_("Improper use of OP1_MUST_BE_IMM"));
break;
diff --git a/gas/doc/c-arc.texi b/gas/doc/c-arc.texi
index 36d3ec0..4852c3d 100644
--- a/gas/doc/c-arc.texi
+++ b/gas/doc/c-arc.texi
@@ -485,6 +485,12 @@ Two Operand Instruction;
@item SYNTAX_3OP
Three Operand Instruction.
+
+@item SYNTAX_1OP
+One Operand Instruction.
+
+@item SYNTAX_NOP
+No Operand Instruction.
@end table
The syntax class may be followed by @samp{|} and one of the following
diff --git a/gas/testsuite/gas/arc/textinsn1op.d b/gas/testsuite/gas/arc/textinsn1op.d
new file mode 100644
index 0000000..1bf1559
--- /dev/null
+++ b/gas/testsuite/gas/arc/textinsn1op.d
@@ -0,0 +1,17 @@
+#objdump: -dr
+
+.*: +file format .*arc.*
+
+
+
+Disassembly of section .text:
+
+[0-9a-f]+ <.text>:
+ 0: 3e2f 703f myinsn r0
+ 4: 3e6f 7ebf myinsn 0x3a
+ 8: 3e2f 7fbf dead beef myinsn 0xdeadbeef
+ 10: 3e2f 7fbf 0000 0000 myinsn 0
+ 14: R_ARC_32_ME label
+ 18: 3e2f 7fbf 0000 0000 myinsn 0
+ 1c: R_ARC_PC32 label
+ 20: 386f 203f noop
diff --git a/gas/testsuite/gas/arc/textinsn1op.s b/gas/testsuite/gas/arc/textinsn1op.s
new file mode 100644
index 0000000..f14b39a
--- /dev/null
+++ b/gas/testsuite/gas/arc/textinsn1op.s
@@ -0,0 +1,12 @@
+# Test 1OP and NOP syntax
+
+ .extInstruction noop, 0x07, 0x10, SUFFIX_FLAG, SYNTAX_NOP
+ .extInstruction myinsn, 0x07, 0x3E, SUFFIX_FLAG, SYNTAX_1OP
+
+ myinsn r0
+ myinsn 0x3A
+ myinsn 0xdeadbeef
+ myinsn @label
+ myinsn @label@pcl
+
+ noop