2013-11-07 Jose E. Marchesi <jose.marchesi@oracle.com>
[deliverable/binutils-gdb.git] / opcodes / mips-formats.h
index 49a0623da535a65bda28a7a39a4c01b01b1f12be..4b5aaaf31a34bb50eb8936b3ad362d53f993c5b0 100644 (file)
     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 \
     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 \
This page took 0.022937 seconds and 4 git commands to generate.