added new function for getting register from node
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Wed, 11 Jan 2006 16:20:15 +0000 (16:20 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Wed, 11 Jan 2006 16:20:15 +0000 (16:20 +0000)
ir/be/ia32/ia32_emitter.h
ir/be/ia32/ia32_new_nodes.c
ir/be/ia32/ia32_new_nodes.h

index c37ea10..0470932 100644 (file)
@@ -17,7 +17,7 @@ const lc_arg_env_t *ia32_get_arg_env(void);
 
 void equalize_dest_src(FILE *F, ir_node *n);
 
-int get_ia32_in_regnr(ir_node *irn, int pos);
+int get_ia32_reg_nr(ir_node *irn, int posi, int in_out);
 const char *get_ia32_in_reg_name(ir_node *irn, int pos);
 
 void ia32_gen_routine(FILE *F, ir_graph *irg, const arch_env_t *env);
index 19a6fc0..0e05f3d 100644 (file)
@@ -403,6 +403,19 @@ int get_ia32_out_regnr(const ir_node *node, int pos) {
        return attr->slots[pos]->index;
 }
 
+/**
+ * Returns the OUT register at position pos.
+ */
+const arch_register_t *get_ia32_out_reg(const ir_node *node, int pos) {
+       asmop_attr *attr = get_ia32_attr(node);
+
+       assert(is_ia32_irn(node) && "Not an ia32 node.");
+       assert(pos < attr->n_res && "Invalid OUT position.");
+       assert(attr->slots[pos]  && "No register assigned");
+
+       return attr->slots[pos];
+}
+
 /**
  * Sets the number of results.
  */
index 5e44f7d..2c01896 100644 (file)
@@ -40,8 +40,9 @@ const arch_register_t     **get_ia32_slots(const ir_node *node);
 void set_ia32_regreq_out(ir_node *node, const arch_register_req_t *req, int pos);
 void set_ia32_regreq_in(ir_node *node, const arch_register_req_t *req, int pos);
 
-const char *get_ia32_out_reg_name(const ir_node *node, int pos);
-int         get_ia32_out_regnr(const ir_node *node, int pos);
+const char            *get_ia32_out_reg_name(const ir_node *node, int pos);
+int                    get_ia32_out_regnr(const ir_node *node, int pos);
+const arch_register_t *get_ia32_out_reg(const ir_node *node, int pos);
 
 int is_ia32_irn(const ir_node *node);