+ * Sets the AddrMode(S|D) attribute
+ */
+void set_ia32_AddrMode(ir_node *node, char direction) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+
+ switch (direction) {
+ case 'D':
+ attr->data.tp = ia32_AddrModeD;
+ break;
+ case 'S':
+ attr->data.tp = ia32_AddrModeS;
+ break;
+ default:
+ assert(0 && "wrong AM type");
+ }
+}
+
+/**
+ * Returns whether or not the node is an immediate operation with Const.
+ */
+int is_ia32_ImmConst(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return (attr->data.imm_tp == ia32_ImmConst);
+}
+
+/**
+ * Returns whether or not the node is an immediate operation with SymConst.
+ */
+int is_ia32_ImmSymConst(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return (attr->data.imm_tp == ia32_ImmSymConst);
+}
+
+/**
+ * Returns whether or not the node is an AddrModeS node.
+ */
+int is_ia32_AddrModeS(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return (attr->data.tp == ia32_AddrModeS);
+}
+
+/**
+ * Returns whether or not the node is an AddrModeD node.
+ */
+int is_ia32_AddrModeD(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return (attr->data.tp == ia32_AddrModeD);
+}
+
+/**
+ * Checks if node is a Load or fLoad.
+ */
+int is_ia32_Ld(const ir_node *node) {
+ return is_ia32_Load(node) || is_ia32_fLoad(node);
+}
+
+/**
+ * Checks if node is a Store or fStore.
+ */
+int is_ia32_St(const ir_node *node) {
+ return is_ia32_Store(node) || is_ia32_fStore(node);
+}
+
+/**
+ * Checks if node is a Const or fConst.
+ */
+int is_ia32_Cnst(const ir_node *node) {
+ return is_ia32_Const(node) || is_ia32_fConst(node);
+}
+
+/**
+ * Returns the name of the OUT register at position pos.
+ */
+const char *get_ia32_out_reg_name(const ir_node *node, int pos) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+
+ assert(is_ia32_irn(node) && "Not an ia32 node.");
+ assert(pos < attr->data.n_res && "Invalid OUT position.");
+ assert(attr->slots[pos] && "No register assigned");
+
+ return arch_register_get_name(attr->slots[pos]);
+}
+
+/**
+ * Returns the index of the OUT register at position pos within its register class.