aboutsummaryrefslogtreecommitdiff
path: root/include/opcode
diff options
context:
space:
mode:
Diffstat (limited to 'include/opcode')
-rw-r--r--include/opcode/ChangeLog5
-rw-r--r--include/opcode/ppc.h13
2 files changed, 18 insertions, 0 deletions
diff --git a/include/opcode/ChangeLog b/include/opcode/ChangeLog
index 0caabd5..f1b3f1f 100644
--- a/include/opcode/ChangeLog
+++ b/include/opcode/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-19 Peter Bergner <bergner@vnet.ibm.com>
+
+ * ppc.h (PPC_OPERAND_OPTIONAL_VALUE): New.
+ (ppc_optional_operand_value): New inline function.
+
2015-06-04 Matthew Wahab <matthew.wahab@arm.com>
* aarch64.h (AARCH64_V8_1): New.
diff --git a/include/opcode/ppc.h b/include/opcode/ppc.h
index 5dc132e..5246365 100644
--- a/include/opcode/ppc.h
+++ b/include/opcode/ppc.h
@@ -380,6 +380,11 @@ extern const unsigned int num_powerpc_operands;
/* This is a CR FIELD that does not use symbolic names. */
#define PPC_OPERAND_CR_REG (0x200000)
+
+/* This flag is only used with PPC_OPERAND_OPTIONAL. If this operand
+ is omitted, then the value it should use for the operand is stored
+ in the SHIFT field of the immediatly following operand field. */
+#define PPC_OPERAND_OPTIONAL_VALUE (0x400000)
/* The POWER and PowerPC assemblers use a few macros. We keep them
with the operands table for simplicity. The macro table is an
@@ -409,4 +414,12 @@ extern const int powerpc_num_macros;
extern ppc_cpu_t ppc_parse_cpu (ppc_cpu_t, ppc_cpu_t *, const char *);
+static inline long
+ppc_optional_operand_value (const struct powerpc_operand *operand)
+{
+ if ((operand->flags & PPC_OPERAND_OPTIONAL_VALUE) != 0)
+ return (operand+1)->shift;
+ return 0;
+}
+
#endif /* PPC_H */