+typedef struct ia32_asm_reg_t ia32_asm_reg_t;
+struct ia32_asm_reg_t {
+ unsigned use_input : 1; /* use input or output pos */
+ unsigned valid : 1;
+ unsigned memory : 1;
+ unsigned dummy_fill : 13;
+ unsigned inout_pos : 16; /* in/out pos where the
+ register is assigned */
+ const ir_mode *mode;
+};
+
+/**
+ * The attributes for ASM nodes.
+ */
+typedef struct ia32_asm_attr_t ia32_asm_attr_t;
+struct ia32_asm_attr_t {
+ ia32_x87_attr_t x87_attr;
+ ident *asm_text;
+ const ia32_asm_reg_t *register_map;
+};
+
+/* the following union is necessary to indicate to the compiler that we might want to cast
+ * the structs (we use them to simulate OO-inheritance) */
+union allow_casts_attr_t_ {
+ ia32_attr_t attr;
+ ia32_condcode_attr_t cc_attr;
+ ia32_copyb_attr_t cpy_attr;
+ ia32_x87_attr_t x87_attr;
+ ia32_asm_attr_t asm_attr;
+ ia32_immediate_attr_t immediate_attr;
+};
+
+#ifndef NDEBUG
+#define CAST_IA32_ATTR(type,ptr) (assert( ((const ia32_attr_t*)(ptr))->attr_type & IA32_ATTR_ ## type ), (type*) (ptr))
+#define CONST_CAST_IA32_ATTR(type,ptr) (assert( ((const ia32_attr_t*)(ptr))->attr_type & IA32_ATTR_ ## type ), (const type*) (ptr))
+#else
+#define CAST_IA32_ATTR(type,ptr) ((type*) (ptr))
+#define CONST_CAST_IA32_ATTR(type,ptr) ((const type*) (ptr))
+#endif
+
+#endif