aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorSandra Loosemore <sandra@codesourcery.com>2013-03-12 02:41:26 +0000
committerSandra Loosemore <sandra@codesourcery.com>2013-03-12 02:41:26 +0000
commitdad60f8e13c64b699e34d437c1c02b87ae158380 (patch)
treeaae744602ee6ec7a870ce3246692c12e77bd476f /gas/config
parentf5cb796a1ebfdf5bb5539acce0d6567e2ed594ce (diff)
downloadgdb-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/config')
-rw-r--r--gas/config/tc-nios2.c24
1 files changed, 24 insertions, 0 deletions
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},