summaryrefslogtreecommitdiff
path: root/opcodes/mips-formats.h
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/mips-formats.h')
-rw-r--r--opcodes/mips-formats.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/opcodes/mips-formats.h b/opcodes/mips-formats.h
index 49a0623da53..4b5aaaf31a3 100644
--- a/opcodes/mips-formats.h
+++ b/opcodes/mips-formats.h
@@ -69,6 +69,14 @@
return &op.root; \
}
+#define OPTIONAL_REG(SIZE, LSB, BANK) \
+ { \
+ static const struct mips_reg_operand op = { \
+ { OP_OPTIONAL_REG, SIZE, LSB }, OP_REG_##BANK, 0 \
+ }; \
+ return &op.root; \
+ }
+
#define MAPPED_REG(SIZE, LSB, BANK, MAP) \
{ \
typedef char ATTRIBUTE_UNUSED \
@@ -79,6 +87,16 @@
return &op.root; \
}
+#define OPTIONAL_MAPPED_REG(SIZE, LSB, BANK, MAP) \
+ { \
+ typedef char ATTRIBUTE_UNUSED \
+ static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
+ static const struct mips_reg_operand op = { \
+ { OP_OPTIONAL_REG, SIZE, LSB }, OP_REG_##BANK, MAP \
+ }; \
+ return &op.root; \
+ }
+
#define REG_PAIR(SIZE, LSB, BANK, MAP) \
{ \
typedef char ATTRIBUTE_UNUSED \