diff options
author | Sandra Loosemore <sandra@codesourcery.com> | 2013-03-12 02:41:26 +0000 |
---|---|---|
committer | Sandra Loosemore <sandra@codesourcery.com> | 2013-03-12 02:41:26 +0000 |
commit | dad60f8e13c64b699e34d437c1c02b87ae158380 (patch) | |
tree | aae744602ee6ec7a870ce3246692c12e77bd476f /gas | |
parent | f5cb796a1ebfdf5bb5539acce0d6567e2ed594ce (diff) | |
download | gdb-dad60f8e13c64b699e34d437c1c02b87ae158380.zip gdb-dad60f8e13c64b699e34d437c1c02b87ae158380.tar.gz gdb-dad60f8e13c64b699e34d437c1c02b87ae158380.tar.bz2 |
2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de>
include/
* opcode/nios2.h (OPX_WRPRS): New define.
(OP_MATCH_WRPRS): Likewise.
opcodes/
* nios2-opc.c (nios2_builtin_opcodes): Add entry for wrprs.
gas/
* config/tc-nios2.c (nios2_assemble_args_ds): New function.
(nios2_arg_info_structs): Add "d,s" and "d,s,E" entries.
gas/testsuite/
* gas/nios2/nios2.exp: Run wrprs.
* gas/nios2/wrprs.d: New file.
* gas/nios2/wrprs.s: Likewise.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-nios2.c | 24 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/nios2/nios2.exp | 1 | ||||
-rw-r--r-- | gas/testsuite/gas/nios2/wrprs.d | 19 | ||||
-rw-r--r-- | gas/testsuite/gas/nios2/wrprs.s | 16 |
6 files changed, 71 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index de1a91e..92ad5df 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2013-03-11 Sebastian Huber <sebastian.huber@embedded-brains.de> + + * config/tc-nios2.c (nios2_assemble_args_ds): New function. + (nios2_arg_info_structs): Add "d,s" and "d,s,E" entries. + 2013-03-11 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-arm.c (crc_ext_armv8): New feature set. diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c index 841c454..d669c60 100644 --- a/gas/config/tc-nios2.c +++ b/gas/config/tc-nios2.c @@ -1694,6 +1694,28 @@ nios2_assemble_args_cs (nios2_insn_infoS *insn_info) } static void +nios2_assemble_args_ds (nios2_insn_infoS * insn_info) +{ + if (insn_info->insn_tokens[1] != NULL && insn_info->insn_tokens[2] != NULL) + { + struct nios2_reg *dst = nios2_reg_lookup (insn_info->insn_tokens[1]); + struct nios2_reg *src = nios2_reg_lookup (insn_info->insn_tokens[2]); + + if (dst == NULL) + as_bad (_("unknown register %s"), insn_info->insn_tokens[1]); + else + SET_INSN_FIELD (RRD, insn_info->insn_code, dst->index); + + if (src == NULL) + as_bad (_("unknown register %s"), insn_info->insn_tokens[2]); + else + SET_INSN_FIELD (RRS, insn_info->insn_code, src->index); + + nios2_check_assembly (insn_info->insn_code, insn_info->insn_tokens[3]); + } +} + +static void nios2_assemble_args_ldst (nios2_insn_infoS *insn_info) { if (insn_info->insn_tokens[1] != NULL @@ -1850,6 +1872,8 @@ const nios2_arg_infoS nios2_arg_info_structs[] = { {"d,c,E", nios2_assemble_args_dc}, {"c,s", nios2_assemble_args_cs}, {"c,s,E", nios2_assemble_args_cs}, + {"d,s", nios2_assemble_args_ds}, + {"d,s,E", nios2_assemble_args_ds}, {"l,d,s,t", nios2_assemble_args_ldst}, {"l,d,s,t,E", nios2_assemble_args_ldst}, {"d,s,j", nios2_assemble_args_dsj}, diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index ad321f7..a672651 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 wrprs. + * gas/nios2/wrprs.d: New file. + * gas/nios2/wrprs.s: Likewise. + +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. diff --git a/gas/testsuite/gas/nios2/nios2.exp b/gas/testsuite/gas/nios2/nios2.exp index 173db00..af22bf8 100644 --- a/gas/testsuite/gas/nios2/nios2.exp +++ b/gas/testsuite/gas/nios2/nios2.exp @@ -54,6 +54,7 @@ if { [istarget nios2-*-*] } then { run_dump_test "rotate" run_dump_test "registers" run_dump_test "rdprs" + run_dump_test "wrprs" run_dump_test "stw" run_dump_test "sth" diff --git a/gas/testsuite/gas/nios2/wrprs.d b/gas/testsuite/gas/nios2/wrprs.d new file mode 100644 index 0000000..2e6de57 --- /dev/null +++ b/gas/testsuite/gas/nios2/wrprs.d @@ -0,0 +1,19 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#name: NIOS2 wrprs + +# Test the wrprs instruction + +.*: +file format elf32-littlenios2 + +Disassembly of section .text: +0+0000 <[^>]*> 0000a03a wrprs zero,zero +0+0004 <[^>]*> 0002a03a wrprs at,zero +0+0008 <[^>]*> 0004a03a wrprs r2,zero +0+000c <[^>]*> 0008a03a wrprs r4,zero +0+0010 <[^>]*> 0010a03a wrprs r8,zero +0+0014 <[^>]*> 0020a03a wrprs r16,zero +0+0018 <[^>]*> 0800a03a wrprs zero,at +0+001c <[^>]*> 1000a03a wrprs zero,r2 +0+0020 <[^>]*> 2000a03a wrprs zero,r4 +0+0024 <[^>]*> 4000a03a wrprs zero,r8 +0+0028 <[^>]*> 8000a03a wrprs zero,r16 diff --git a/gas/testsuite/gas/nios2/wrprs.s b/gas/testsuite/gas/nios2/wrprs.s new file mode 100644 index 0000000..c722ce5 --- /dev/null +++ b/gas/testsuite/gas/nios2/wrprs.s @@ -0,0 +1,16 @@ +# Source file used to test the wrprs instruction + +.set noat + +foo: + wrprs zero, zero + wrprs at, zero + wrprs r2, zero + wrprs r4, zero + wrprs r8, zero + wrprs r16, zero + wrprs zero, at + wrprs zero, r2 + wrprs zero, r4 + wrprs zero, r8 + wrprs zero, r16 |