summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@nildram.co.uk>2013-08-19 18:56:59 +0000
committerRichard Sandiford <rsandifo@nildram.co.uk>2013-08-19 18:56:59 +0000
commitbec029bce1bf374e05b16b6ba4714d5dba1633a4 (patch)
treea003046d538e88bcd095ce386572580fec869922 /include
parentac0f0fea863a323ae0f6ef70996a0cedaf4b0220 (diff)
downloadbinutils-redhat-bec029bce1bf374e05b16b6ba4714d5dba1633a4.tar.gz
include/opcode/
* mips.h (OP_OPTIONAL_REG): New mips_operand_type. (mips_optional_operand_p): New function. opcodes/ * mips-formats.h (OPTIONAL_REG, OPTIONAL_MAPPED_REG): New macros. * micromips-opc.c (decode_micromips_operand): Use OPTIONAL_REG and OPTIONAL_MAPPED_REG. * mips-opc.c (decode_mips_operand): Likewise. * mips16-opc.c (decode_mips16_operand): Likewise. * mips-dis.c (print_insn_arg): Handle OP_OPTIONAL_REG. gas/ * config/tc-mips.c (operand_reg_mask, match_operand): Handle OP_OPTIONAL_REG. (mips_ip, mips16_ip): Use mips_optional_operand_p to check for optional operands.
Diffstat (limited to 'include')
-rw-r--r--include/opcode/ChangeLog5
-rw-r--r--include/opcode/mips.h13
2 files changed, 18 insertions, 0 deletions
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index cdf578add2..19fd1b3985 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-19 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * mips.h (OP_OPTIONAL_REG): New mips_operand_type.
+ (mips_optional_operand_p): New function.
+
2013-08-04 Jürgen Urban <JuergenUrban@gmx.de>
Richard Sandiford <rdsandiford@googlemail.com>
diff --git a/include/opcode/mips.h b/include/opcode/mips.h
index ae6983b1d7..6860fa7945 100644
--- a/include/opcode/mips.h
+++ b/include/opcode/mips.h
@@ -346,6 +346,10 @@ enum mips_operand_type {
/* Described by mips_reg_operand. */
OP_REG,
+ /* Like OP_REG, but can be omitted if the register is the same as the
+ previous operand. */
+ OP_OPTIONAL_REG,
+
/* Described by mips_reg_pair_operand. */
OP_REG_PAIR,
@@ -574,6 +578,15 @@ struct mips_pcrel_operand
unsigned int flip_isa_bit : 1;
};
+/* Return true if the assembly syntax allows OPERAND to be omitted. */
+
+static inline bfd_boolean
+mips_optional_operand_p (const struct mips_operand *operand)
+{
+ return (operand->type == OP_OPTIONAL_REG
+ || operand->type == OP_REPEAT_PREV_REG);
+}
+
/* Return a version of INSN in which the field specified by OPERAND
has value UVAL. */