added new callback to set frame entity
authorChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Fri, 11 Aug 2006 14:20:19 +0000 (14:20 +0000)
committerChristian Würdig <chriswue@ipd.info.uni-karlsruhe.de>
Fri, 11 Aug 2006 14:20:19 +0000 (14:20 +0000)
ir/be/TEMPLATE/bearch_TEMPLATE.c
ir/be/arm/arm_emitter.c
ir/be/arm/bearch_arm.c
ir/be/firm/bearch_firm.c
ir/be/mips/bearch_mips.c
ir/be/mips/mips_scheduler.c
ir/be/ppc32/bearch_ppc32.c

index d7fa82c..219f159 100644 (file)
@@ -210,6 +210,10 @@ static entity *TEMPLATE_get_frame_entity(const void *self, const ir_node *irn) {
        return NULL;
 }
 
+static void TEMPLATE_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
+       /* TODO: set the entity assigned to the frame */
+}
+
 /**
  * This function is called by the generic backend to correct offsets for
  * nodes accessing the stack.
@@ -227,7 +231,12 @@ static const arch_irn_ops_if_t TEMPLATE_irn_ops_if = {
        TEMPLATE_classify,
        TEMPLATE_get_flags,
        TEMPLATE_get_frame_entity,
+       TEMPLATE_set_frame_entity,
        TEMPLATE_set_stack_bias
+       NULL,    /* get_inverse             */
+       NULL,    /* get_op_estimated_cost   */
+       NULL,    /* possible_memory_operand */
+       NULL,    /* perform_memory_operand  */
 };
 
 TEMPLATE_irn_ops_t TEMPLATE_irn_ops = {
index 988a160..64dc9d2 100644 (file)
@@ -103,7 +103,7 @@ static const char *node_offset_to_str(ir_node *n, char *buf, int buflen) {
                entity *ent = be_get_frame_entity(n);
                offset = get_entity_offset_bytes(ent);
        } else if (irn_op == op_be_Reload || irn_op == op_be_Spill) {
-               entity * ent = be_get_spill_entity(n);
+               entity *ent = be_get_frame_entity(n);
                offset = get_entity_offset_bytes(ent);
        } else if (irn_op == op_be_IncSP) {
                int offs = be_get_IncSP_offset(n);
index e2c1889..d7d3bd5 100644 (file)
@@ -231,6 +231,10 @@ static entity *arm_get_frame_entity(const void *self, const ir_node *irn) {
        return NULL;
 }
 
+static void arm_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
+       /* TODO: set the entity assigned to the frame */
+}
+
 /**
  * This function is called by the generic backend to correct offsets for
  * nodes accessing the stack.
@@ -248,8 +252,12 @@ static const arch_irn_ops_if_t arm_irn_ops_if = {
        arm_classify,
        arm_get_flags,
        arm_get_frame_entity,
+       arm_set_frame_entity,
        arm_set_stack_bias,
-       NULL
+       NULL,    /* get_inverse             */
+       NULL,    /* get_op_estimated_cost   */
+       NULL,    /* possible_memory_operand */
+       NULL,    /* perform_memory_operand  */
 };
 
 arm_irn_ops_t arm_irn_ops = {
index 42af293..1813af7 100644 (file)
@@ -362,6 +362,10 @@ static entity *firm_get_frame_entity(const void *self, const ir_node *irn)
        return NULL;
 }
 
+static void firm_set_frame_entity(const void *self, const ir_node *irn, entity *ent)
+{
+}
+
 static const arch_irn_ops_if_t firm_irn_ops_if = {
        firm_get_irn_reg_req,
        firm_set_irn_reg,
@@ -369,7 +373,12 @@ static const arch_irn_ops_if_t firm_irn_ops_if = {
        firm_classify,
        firm_get_flags,
        firm_get_frame_entity,
-       firm_set_stack_bias
+       firm_set_frame_entity,
+       firm_set_stack_bias,
+       NULL,    /* get_inverse             */
+       NULL,    /* get_op_estimated_cost   */
+       NULL,    /* possible_memory_operand */
+       NULL,    /* perform_memory_operand  */
 };
 
 static const arch_irn_ops_t firm_irn_ops = {
index 7819624..105f6b1 100644 (file)
@@ -237,6 +237,12 @@ static entity *mips_get_frame_entity(const void *self, const ir_node *irn) {
        return NULL;
 }
 
+static void mips_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
+       mips_attr_t *attr  = get_mips_attr(irn);
+       assert(is_mips_load_r(irn) || is_mips_store_r(irn));
+       attr->stack_entity = ent;
+}
+
 /**
  * This function is called by the generic backend to correct offsets for
  * nodes accessing the stack.
@@ -257,8 +263,12 @@ static const arch_irn_ops_if_t mips_irn_ops_if = {
        mips_classify,
        mips_get_flags,
        mips_get_frame_entity,
+       mips_set_frame_entity,
        mips_set_frame_offset,
-       NULL
+       NULL,    /* get_inverse             */
+       NULL,    /* get_op_estimated_cost   */
+       NULL,    /* possible_memory_operand */
+       NULL,    /* perform_memory_operand  */
 };
 
 mips_irn_ops_t mips_irn_ops = {
index fdbb59e..9997419 100644 (file)
@@ -130,7 +130,7 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set)
        // test all nodes in the ready set and take the first non-branch that
        // is allowed
        for (node = nodeset_first(ready_set); node != NULL; node = nodeset_next(ready_set)) {
-               if (arch_irn_classify(arch_env, node) == arch_irn_class_branch) {
+               if (arch_irn_class_is(arch_env, node, branch)) {
                        if (is_irn_forking(node))
                                condjmp = node;
                        continue;
@@ -163,7 +163,7 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set)
                        return condjmp;
                }
                node = nodeset_first(ready_set);
-               assert(arch_irn_classify(arch_env, node) == arch_irn_class_branch);
+               assert(arch_irn_class_is(arch_env, node, branch));
                nodeset_break(ready_set);
                return node;
        }
index c1222d6..455f371 100644 (file)
@@ -233,6 +233,12 @@ static entity *ppc32_get_frame_entity(const void *self, const ir_node *irn) {
        return get_ppc32_frame_entity(irn);
 }
 
+static void ppc32_set_frame_entity(const void *self, const ir_node *irn, entity *ent) {
+       if (! is_ppc32_irn(irn) || get_ppc32_type(irn) != ppc32_ac_FrameEntity)
+               return;
+       set_ppc32_frame_entity(irn, ent);
+}
+
 /**
  * This function is called by the generic backend to correct offsets for
  * nodes accessing the stack.
@@ -359,8 +365,12 @@ static const arch_irn_ops_if_t ppc32_irn_ops_if = {
        ppc32_classify,
        ppc32_get_flags,
        ppc32_get_frame_entity,
+       ppc32_set_frame_entity,
        ppc32_set_stack_bias,
-       NULL
+       NULL,    /* get_inverse             */
+       NULL,    /* get_op_estimated_cost   */
+       NULL,    /* possible_memory_operand */
+       NULL,    /* perform_memory_operand  */
 };
 
 ppc32_irn_ops_t ppc32_irn_ops = {