aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/nios2/nios2.exp1
-rw-r--r--gas/testsuite/gas/nios2/rdprs.d35
-rw-r--r--gas/testsuite/gas/nios2/rdprs.s32
-rw-r--r--include/ChangeLog5
-rw-r--r--include/opcode/nios2.h2
-rw-r--r--opcodes/ChangeLog4
-rw-r--r--opcodes/nios2-opc.c2
8 files changed, 87 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 5b5306f..ad321f7 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
+ * gas/nios2/nios2.exp: Run rdprs.
+ * gas/nios2/rdprs.d: New file.
+ * gas/nios2/rdprs.s: Likewise.
+
+2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
* gas/nios2/nios2.exp: Run registers.
* gas/nios2/registers.d: New file.
* gas/nios2/registers.s: Likewise.
diff --git a/gas/testsuite/gas/nios2/nios2.exp b/gas/testsuite/gas/nios2/nios2.exp
index 13be1c1..173db00 100644
--- a/gas/testsuite/gas/nios2/nios2.exp
+++ b/gas/testsuite/gas/nios2/nios2.exp
@@ -53,6 +53,7 @@ if { [istarget nios2-*-*] } then {
run_dump_test "ret"
run_dump_test "rotate"
run_dump_test "registers"
+ run_dump_test "rdprs"
run_dump_test "stw"
run_dump_test "sth"
diff --git a/gas/testsuite/gas/nios2/rdprs.d b/gas/testsuite/gas/nios2/rdprs.d
new file mode 100644
index 0000000..f5a87cd
--- /dev/null
+++ b/gas/testsuite/gas/nios2/rdprs.d
@@ -0,0 +1,35 @@
+#objdump: -dr --prefix-addresses --show-raw-insn
+#name: NIOS2 rdprs
+
+# Test the rdprs instruction
+
+.*: +file format elf32-littlenios2
+
+Disassembly of section .text:
+0+0000 <[^>]*> 00000038 rdprs zero,zero,0
+0+0004 <[^>]*> 00000078 rdprs zero,zero,1
+0+0008 <[^>]*> 000000b8 rdprs zero,zero,2
+0+000c <[^>]*> 00000138 rdprs zero,zero,4
+0+0010 <[^>]*> 00000238 rdprs zero,zero,8
+0+0014 <[^>]*> 00000438 rdprs zero,zero,16
+0+0018 <[^>]*> 00000838 rdprs zero,zero,32
+0+001c <[^>]*> 00001038 rdprs zero,zero,64
+0+0020 <[^>]*> 00002038 rdprs zero,zero,128
+0+0024 <[^>]*> 00004038 rdprs zero,zero,256
+0+0028 <[^>]*> 00008038 rdprs zero,zero,512
+0+002c <[^>]*> 00010038 rdprs zero,zero,1024
+0+0030 <[^>]*> 00020038 rdprs zero,zero,2048
+0+0034 <[^>]*> 00040038 rdprs zero,zero,4096
+0+0038 <[^>]*> 00080038 rdprs zero,zero,8192
+0+003c <[^>]*> 00100038 rdprs zero,zero,16384
+0+0040 <[^>]*> 00200038 rdprs zero,zero,-32768
+0+0044 <[^>]*> 00400038 rdprs at,zero,0
+0+0048 <[^>]*> 00800038 rdprs r2,zero,0
+0+004c <[^>]*> 01000038 rdprs r4,zero,0
+0+0050 <[^>]*> 02000038 rdprs r8,zero,0
+0+0054 <[^>]*> 04000038 rdprs r16,zero,0
+0+0058 <[^>]*> 08000038 rdprs zero,at,0
+0+005c <[^>]*> 10000038 rdprs zero,r2,0
+0+0060 <[^>]*> 20000038 rdprs zero,r4,0
+0+0064 <[^>]*> 40000038 rdprs zero,r8,0
+0+0068 <[^>]*> 80000038 rdprs zero,r16,0
diff --git a/gas/testsuite/gas/nios2/rdprs.s b/gas/testsuite/gas/nios2/rdprs.s
new file mode 100644
index 0000000..fb4909d
--- /dev/null
+++ b/gas/testsuite/gas/nios2/rdprs.s
@@ -0,0 +1,32 @@
+# Source file used to test the rdprs instruction
+
+.set noat
+
+foo:
+ rdprs zero, zero, 0
+ rdprs zero, zero, 1
+ rdprs zero, zero, 2
+ rdprs zero, zero, 4
+ rdprs zero, zero, 8
+ rdprs zero, zero, 16
+ rdprs zero, zero, 32
+ rdprs zero, zero, 64
+ rdprs zero, zero, 128
+ rdprs zero, zero, 256
+ rdprs zero, zero, 512
+ rdprs zero, zero, 1024
+ rdprs zero, zero, 2048
+ rdprs zero, zero, 4096
+ rdprs zero, zero, 8192
+ rdprs zero, zero, 16384
+ rdprs zero, zero, -32768
+ rdprs at, zero, 0
+ rdprs r2, zero, 0
+ rdprs r4, zero, 0
+ rdprs r8, zero, 0
+ rdprs r16, zero, 0
+ rdprs zero, at, 0
+ rdprs zero, r2, 0
+ rdprs zero, r4, 0
+ rdprs zero, r8, 0
+ rdprs zero, r16, 0
diff --git a/include/ChangeLog b/include/ChangeLog
index 05e2a6c..f186941 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * opcode/nios2.h (OP_RDPRS): New define.
+ (OP_MATCH_RDPRS): Likewise.
+
2013-03-01 Cary Coutant <ccoutant@google.com>
* dwarf2.h (enum dwarf_sect): New enum type.
diff --git a/include/opcode/nios2.h b/include/opcode/nios2.h
index 85e7023..83773d5 100644
--- a/include/opcode/nios2.h
+++ b/include/opcode/nios2.h
@@ -289,6 +289,7 @@ struct nios2_reg
#define OP_OPX 58
#define OP_ORHI 52
#define OP_ORI 20
+#define OP_RDPRS 56
#define OP_STB 5
#define OP_STBIO 37
#define OP_STC 29
@@ -386,6 +387,7 @@ struct nios2_reg
#define OP_MATCH_OPX OP_OPX
#define OP_MATCH_ORHI OP_ORHI
#define OP_MATCH_ORI OP_ORI
+#define OP_MATCH_RDPRS OP_RDPRS
#define OP_MATCH_STB OP_STB
#define OP_MATCH_STBIO OP_STBIO
#define OP_MATCH_STC OP_STC
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 1419f3d..846bc94 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
+ * nios2-opc.c (nios2_builtin_opcodes): Add entry for rdprs.
+
+2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
* nios2-opc.c (nios2_builtin_regs): Add sstatus alias for ba register.
2013-03-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
diff --git a/opcodes/nios2-opc.c b/opcodes/nios2-opc.c
index ff24652..9617d47 100644
--- a/opcodes/nios2-opc.c
+++ b/opcodes/nios2-opc.c
@@ -345,6 +345,8 @@ const struct nios2_opcode nios2_builtin_opcodes[] =
OP_MATCH_ORI, OP_MASK_IOP, NIOS2_INSN_ORI, unsigned_immed16_overflow},
{"rdctl", "d,c", "d,c,E", 2,
OP_MATCH_RDCTL, OP_MASK_RDCTL, 0, no_overflow},
+ {"rdprs", "t,s,i", "t,s,i,E", 3,
+ OP_MATCH_RDPRS, OP_MASK_IOP, 0, unsigned_immed16_overflow},
{"ret", "", "E", 0,
OP_MATCH_RET, OP_MASK, 0, no_overflow},
{"rol", "d,s,t", "d,s,t,E", 3,