+/**
+ * Sets the number of results.
+ */
+void set_ia32_n_res(ir_node *node, int n_res) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->data.n_res = n_res;
+}
+
+/**
+ * Returns the number of results.
+ */
+int get_ia32_n_res(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return attr->data.n_res;
+}
+
+/**
+ * Returns the flavour of an ia32 node,
+ */
+ia32_op_flavour_t get_ia32_flavour(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return attr->data.op_flav;
+}
+
+/**
+ * Sets the flavour of an ia32 node to flavour_Div/Mod/DivMod/Mul/Mulh.
+ */
+void set_ia32_flavour(ir_node *node, ia32_op_flavour_t op_flav) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->data.op_flav = op_flav;
+}
+
+/**
+ * Returns the projnum code.
+ */
+long get_ia32_pncode(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ return attr->pn_code;
+}
+
+/**
+ * Sets the projnum code
+ */
+void set_ia32_pncode(ir_node *node, long code) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+ attr->pn_code = code;
+}
+
+
+/******************************************************************************************************
+ * _ _ _ _ __ _ _
+ * (_) | | | | | | / _| | | (_)
+ * ___ _ __ ___ ___ _ __ _| | __ _| |_| |_ _ __ | |_ _ _ _ __ ___| |_ _ ___ _ __ ___
+ * / __| '_ \ / _ \/ __| |/ _` | | / _` | __| __| '__| | _| | | | '_ \ / __| __| |/ _ \| '_ \ / __|
+ * \__ \ |_) | __/ (__| | (_| | | | (_| | |_| |_| | | | | |_| | | | | (__| |_| | (_) | | | | \__ \
+ * |___/ .__/ \___|\___|_|\__,_|_| \__,_|\__|\__|_| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_| |___/
+ * | |
+ * |_|
+ ******************************************************************************************************/
+
+/**
+ * Gets the type of an ia32_Const.
+ */
+unsigned get_ia32_Const_type(const ir_node *node) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+
+ assert((is_ia32_Const(node) || is_ia32_fConst(node)) && "Need ia32_Const to get type");
+
+ return attr->data.tp;
+}
+
+/**
+ * Sets the type of an ia32_Const.
+ */
+void set_ia32_Const_type(ir_node *node, int type) {
+ ia32_attr_t *attr = get_ia32_attr(node);
+
+ assert((is_ia32_Const(node) || is_ia32_fConst(node)) && "Need ia32_Const to set type");
+ assert((type == ia32_Const || type == ia32_SymConst) && "Unsupported ia32_Const type");
+
+ attr->data.tp = type;
+}
+
+/**
+ * Copy the attributes from an ia32_Const to an Immop (Add_i, Sub_i, ...) node
+ */
+void set_ia32_Immop_attr(ir_node *node, ir_node *cnst) {
+ ia32_attr_t *na = get_ia32_attr(node);
+ ia32_attr_t *ca = get_ia32_attr(cnst);
+
+ assert((is_ia32_Const(cnst) || is_ia32_fConst(cnst)) && "Need ia32_Const to set Immop attr");
+
+ na->tv = ca->tv;
+
+ if (ca->sc) {
+ na->sc = copy_str(na->sc, ca->sc);
+ na->cnst = na->sc;
+ }
+ else {
+ na->cnst = set_cnst_from_tv(na->cnst, na->tv);
+ na->sc = NULL;
+ }
+}
+
+/**
+ * Copy the attributes from a Const to an ia32_Const
+ */
+void set_ia32_Const_attr(ir_node *ia32_cnst, ir_node *cnst) {
+ ia32_attr_t *attr = get_ia32_attr(ia32_cnst);
+
+ assert((is_ia32_Const(ia32_cnst) || is_ia32_fConst(ia32_cnst)) && "Need ia32_Const to set Const attr");
+
+ switch (get_irn_opcode(cnst)) {
+ case iro_Const:
+ attr->data.tp = ia32_Const;
+ attr->tv = get_Const_tarval(cnst);
+ attr->cnst = set_cnst_from_tv(attr->cnst, attr->tv);
+ break;
+ case iro_SymConst:
+ attr->data.tp = ia32_SymConst;
+ attr->tv = NULL;
+ attr->sc = copy_str(attr->sc, get_sc_name(cnst));
+ attr->cnst = attr->sc;
+ break;
+ case iro_Unknown:
+ assert(0 && "Unknown Const NYI");
+ break;
+ default:
+ assert(0 && "Cannot create ia32_Const for this opcode");
+ }
+}
+
+/**
+ * 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 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);
+}
+