This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] NIOS2: Add sstatus alias for ba register


This register alias is present in the Altera binutils distribution.

I do not have commit access.  If someone approves this patch, please
commit it also.

2013-03-09  Sebastian Huber <sebastian.huber@embedded-brains.de>

	* nios2-opc.c: Add sstatus alias for ba register.

2013-03-09  Sebastian Huber <sebastian.huber@embedded-brains.de>

	* gas/nios2/nios2.exp: Run registers.
	* gas/nios2/register.d: New file.
	* gas/nios2/register.s: Likewise.
---
 gas/testsuite/gas/nios2/nios2.exp   |    1 +
 gas/testsuite/gas/nios2/registers.d |   51 +++++++++++++++++++++++++++++++++++
 gas/testsuite/gas/nios2/registers.s |   51 +++++++++++++++++++++++++++++++++++
 opcodes/nios2-opc.c                 |    1 +
 4 files changed, 104 insertions(+)
 create mode 100644 gas/testsuite/gas/nios2/registers.d
 create mode 100644 gas/testsuite/gas/nios2/registers.s

diff --git a/gas/testsuite/gas/nios2/nios2.exp b/gas/testsuite/gas/nios2/nios2.exp
index 38935e2..13be1c1 100644
--- a/gas/testsuite/gas/nios2/nios2.exp
+++ b/gas/testsuite/gas/nios2/nios2.exp
@@ -52,6 +52,7 @@ if { [istarget nios2-*-*] } then {
     run_dump_test "ctl"
     run_dump_test "ret"
     run_dump_test "rotate"
+    run_dump_test "registers"
     
     run_dump_test "stw"
     run_dump_test "sth"
diff --git a/gas/testsuite/gas/nios2/registers.d b/gas/testsuite/gas/nios2/registers.d
new file mode 100644
index 0000000..f92bda1
--- /dev/null
+++ b/gas/testsuite/gas/nios2/registers.d
@@ -0,0 +1,51 @@
+#objdump: -dr --prefix-addresses
+#name: NIOS2 registers
+
+# Test the register names
+
+.*: +file format elf32-littlenios2
+
+Disassembly of section .text:
+0+0000 <[^>]*> movi	zero,123
+0+0004 <[^>]*> movi	at,123
+0+0008 <[^>]*> movi	r2,123
+0+000c <[^>]*> movi	r3,123
+0+0010 <[^>]*> movi	r4,123
+0+0014 <[^>]*> movi	r5,123
+0+0018 <[^>]*> movi	r6,123
+0+001c <[^>]*> movi	r7,123
+0+0020 <[^>]*> movi	r8,123
+0+0024 <[^>]*> movi	r9,123
+0+0028 <[^>]*> movi	r10,123
+0+002c <[^>]*> movi	r11,123
+0+0030 <[^>]*> movi	r12,123
+0+0034 <[^>]*> movi	r13,123
+0+0038 <[^>]*> movi	r14,123
+0+003c <[^>]*> movi	r15,123
+0+0040 <[^>]*> movi	r16,123
+0+0044 <[^>]*> movi	r17,123
+0+0048 <[^>]*> movi	r18,123
+0+004c <[^>]*> movi	r19,123
+0+0050 <[^>]*> movi	r20,123
+0+0054 <[^>]*> movi	r21,123
+0+0058 <[^>]*> movi	r22,123
+0+005c <[^>]*> movi	r23,123
+0+0060 <[^>]*> movi	et,123
+0+0064 <[^>]*> movi	bt,123
+0+0068 <[^>]*> movi	gp,123
+0+006c <[^>]*> movi	sp,123
+0+0070 <[^>]*> movi	fp,123
+0+0074 <[^>]*> movi	ea,123
+0+0078 <[^>]*> movi	ba,123
+0+007c <[^>]*> movi	ra,123
+0+0080 <[^>]*> movi	zero,123
+0+0084 <[^>]*> movi	at,123
+0+0088 <[^>]*> movi	et,123
+0+008c <[^>]*> movi	bt,123
+0+0090 <[^>]*> movi	gp,123
+0+0094 <[^>]*> movi	sp,123
+0+0098 <[^>]*> movi	fp,123
+0+009c <[^>]*> movi	ea,123
+0+00a0 <[^>]*> movi	ba,123
+0+00a4 <[^>]*> movi	ba,123
+0+00a8 <[^>]*> movi	ra,123
diff --git a/gas/testsuite/gas/nios2/registers.s b/gas/testsuite/gas/nios2/registers.s
new file mode 100644
index 0000000..df8217f
--- /dev/null
+++ b/gas/testsuite/gas/nios2/registers.s
@@ -0,0 +1,51 @@
+# Source file used to test the register names
+
+.set noat
+.set nobreak
+
+foo:
+# Standard register names
+	movi zero, 123
+	movi at, 123
+	movi r2, 123
+	movi r3, 123
+	movi r4, 123
+	movi r5, 123
+	movi r6, 123
+	movi r7, 123
+	movi r8, 123
+	movi r9, 123
+	movi r10, 123
+	movi r11, 123
+	movi r12, 123
+	movi r13, 123
+	movi r14, 123
+	movi r15, 123
+	movi r16, 123
+	movi r17, 123
+	movi r18, 123
+	movi r19, 123
+	movi r20, 123
+	movi r21, 123
+	movi r22, 123
+	movi r23, 123
+	movi et, 123
+	movi bt, 123
+	movi gp, 123
+	movi sp, 123
+	movi fp, 123
+	movi ea, 123
+	movi ba, 123
+	movi ra, 123
+# Alternative names for special registers
+	movi r0, 123
+	movi r1, 123
+	movi r24, 123
+	movi r25, 123
+	movi r26, 123
+	movi r27, 123
+	movi r28, 123
+	movi r29, 123
+	movi r30, 123
+	movi sstatus, 123
+	movi r31, 123
diff --git a/opcodes/nios2-opc.c b/opcodes/nios2-opc.c
index d5094ac..ff24652 100644
--- a/opcodes/nios2-opc.c
+++ b/opcodes/nios2-opc.c
@@ -71,6 +71,7 @@ const struct nios2_reg nios2_builtin_regs[] = {
   {"r28", 28},
   {"r29", 29},
   {"r30", 30},
+  {"sstatus", 30},
   {"r31", 31},
 
   /* Control register names.  */
-- 
1.7.10.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]