[3/3,ARC] Fix case-sensitivity for extension instructions.

Message ID 20180717085633.15086-3-claziss@gmail.com
State New
Headers show
Series
  • [1/3] Fix decoding of w6 signed short immediate.
Related show

Commit Message

Claudiu Zissulescu July 17, 2018, 8:56 a.m.
From: claziss <claziss@synopsys.com>


In ARC assembler, we accept case insensitive mnemonics, but this was
not the case for extension instruction, fix it and add a test.

OK to apply?
Claudiu

gas/
2017-09-20  Claudiu Zissulescu <claziss@synopsys.com>

	* config/tc-arc.c (tokenize_extinsn): Convert to lower case the
	name of extension instructions.
	* testsuite/gas/arc/textinsn_case.d: New file.
	* testsuite/gas/arc/textinsn_case.s: Likewise.
---
 gas/config/tc-arc.c                   | 4 ++++
 gas/testsuite/gas/arc/textinsn_case.d | 9 +++++++++
 gas/testsuite/gas/arc/textinsn_case.s | 6 ++++++
 3 files changed, 19 insertions(+)
 create mode 100644 gas/testsuite/gas/arc/textinsn_case.d
 create mode 100644 gas/testsuite/gas/arc/textinsn_case.s

-- 
2.17.1

Comments

Nick Clifton July 18, 2018, 9:07 a.m. | #1
Hi Claudiu,

> gas/

> 2017-09-20  Claudiu Zissulescu <claziss@synopsys.com>

> 

> 	* config/tc-arc.c (tokenize_extinsn): Convert to lower case the

> 	name of extension instructions.

> 	* testsuite/gas/arc/textinsn_case.d: New file.

> 	* testsuite/gas/arc/textinsn_case.s: Likewise.

 
Approved please apply.

Cheers
  Nick

Patch

diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index cd90fdf56d..a1ce34d24d 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -4369,6 +4369,10 @@  tokenize_extinsn (extInstruction_t *einsn)
   insn_name = xstrdup (p);
   restore_line_pointer (c);
 
+  /* Convert to lower case.  */
+  for (p = insn_name; *p; ++p)
+    *p = TOLOWER (*p);
+
   /* 2nd: get major opcode.  */
   if (*input_line_pointer != ',')
     {
diff --git a/gas/testsuite/gas/arc/textinsn_case.d b/gas/testsuite/gas/arc/textinsn_case.d
new file mode 100644
index 0000000000..f7ef91f4ef
--- /dev/null
+++ b/gas/testsuite/gas/arc/textinsn_case.d
@@ -0,0 +1,9 @@ 
+#objdump: -d
+
+.*: +file format .*arc.*
+
+
+Disassembly of section .text:
+
+[0-9a-f]+ <test>:
+\s+[0-9a-f]+:\s+3a25 00c1\s+aes_qroundf\s+r1,r2,r3
diff --git a/gas/testsuite/gas/arc/textinsn_case.s b/gas/testsuite/gas/arc/textinsn_case.s
new file mode 100644
index 0000000000..4d04968c61
--- /dev/null
+++ b/gas/testsuite/gas/arc/textinsn_case.s
@@ -0,0 +1,6 @@ 
+	.cpu em
+	.extInstruction aes_qRoundF, 7, 0x25, SUFFIX_COND, SYNTAX_3OP
+
+	.text
+test:
+	aes_qRoundF  r1,r2,r3