added isa and bias to ia32_intrinsic_env_t, c99 feature removed
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 13 Sep 2007 13:33:04 +0000 (13:33 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 13 Sep 2007 13:33:04 +0000 (13:33 +0000)
[r15784]

ir/be/ia32/bearch_ia32.c
ir/be/ia32/bearch_ia32_t.h

index 8aef2c7..6c6c8c5 100644 (file)
@@ -91,6 +91,24 @@ static set *cur_reg_set = NULL;
 ir_mode         *mode_fpcw       = NULL;
 ia32_code_gen_t *ia32_current_cg = NULL;
 
+/**
+ * The environment for the intrinsic mapping.
+ */
+static ia32_intrinsic_env_t intrinsic_env = {
+       NULL,    /* the isa */
+       NULL,    /* the irg, these entities belong to */
+       NULL,    /* entity for first div operand (move into FPU) */
+       NULL,    /* entity for second div operand (move into FPU) */
+       NULL,    /* entity for converts ll -> d */
+       NULL,    /* entity for converts d -> ll */
+       NULL,    /* entity for __divdi3 library call */
+       NULL,    /* entity for __moddi3 library call */
+       NULL,    /* entity for __udivdi3 library call */
+       NULL,    /* entity for __umoddi3 library call */
+       NULL,    /* bias value for conversion from float to unsigned 64 */
+};
+
+
 typedef ir_node *(*create_const_node_func) (dbg_info *dbg, ir_graph *irg, ir_node *block);
 
 static INLINE ir_node *create_const(ia32_code_gen_t *cg, ir_node **place,
@@ -996,16 +1014,18 @@ static ir_node *flags_remat(ir_node *node, ir_node *after)
 {
        /* we should turn back source address mode when rematerializing nodes */
        ia32_op_type_t type = get_ia32_op_type(node);
-       if(type == ia32_AddrModeS) {
+       ir_node        *copy;
+
+       if (type == ia32_AddrModeS) {
                turn_back_am(node);
-       } else if(type == ia32_AddrModeD) {
+       } else if (type == ia32_AddrModeD) {
                /* TODO implement this later... */
                panic("found DestAM with flag user %+F this should not happen", node);
        } else {
                assert(type == ia32_Normal);
        }
 
-       ir_node *copy  = exact_copy(node);
+       copy = exact_copy(node);
        sched_add_after(after, copy);
 
        return copy;
@@ -1613,6 +1633,8 @@ static void *ia32_init(FILE *file_handle) {
        obstack_init(isa->name_obst);
 #endif /* NDEBUG */
 
+       /* enter the ISA object into the intrinsic environment */
+       intrinsic_env.isa = isa;
        ia32_handle_intrinsics();
 
        /* needed for the debug support */
@@ -2147,18 +2169,6 @@ static int ia32_evaluate_insn(insn_kind kind, tarval *tv) {
        }
 }
 
-static ia32_intrinsic_env_t intrinsic_env = {
-       NULL,    /**< the irg, these entities belong to */
-       NULL,    /**< entity for first div operand (move into FPU) */
-       NULL,    /**< entity for second div operand (move into FPU) */
-       NULL,    /**< entity for converts ll -> d */
-       NULL,    /**< entity for converts d -> ll */
-       NULL,    /**< entity for __divdi3 library call */
-       NULL,    /**< entity for __moddi3 library call */
-       NULL,    /**< entity for __udivdi3 library call */
-       NULL,    /**< entity for __umoddi3 library call */
-};
-
 /**
  * Returns the libFirm configuration parameter for this backend.
  */
index 8839b7a..8655070 100644 (file)
@@ -173,15 +173,17 @@ struct ia32_irn_ops_t {
  * A helper type collecting needed info for IA32 intrinsic lowering.
  */
 struct ia32_intrinsic_env_t {
-       ir_graph  *irg;           /**< the irg, these entities belong to */
-       ir_entity *ll_div_op1;    /**< entity for first div operand (move into FPU) */
-       ir_entity *ll_div_op2;    /**< entity for second div operand (move into FPU) */
-       ir_entity *ll_d_conv;     /**< entity for converts ll -> d */
-       ir_entity *d_ll_conv;     /**< entity for converts d -> ll */
-       ir_entity *divdi3;        /**< entity for __divdi3 library call */
-       ir_entity *moddi3;        /**< entity for __moddi3 library call */
-       ir_entity *udivdi3;       /**< entity for __udivdi3 library call */
-       ir_entity *umoddi3;       /**< entity for __umoddi3 library call */
+       ia32_isa_t *isa;          /**< the isa object */
+       ir_graph   *irg;          /**< the irg, these entities belong to */
+       ir_entity  *ll_div_op1;   /**< entity for first div operand (move into FPU) */
+       ir_entity  *ll_div_op2;   /**< entity for second div operand (move into FPU) */
+       ir_entity  *ll_d_conv;    /**< entity for converts ll -> d */
+       ir_entity  *d_ll_conv;    /**< entity for converts d -> ll */
+       ir_entity  *divdi3;       /**< entity for __divdi3 library call */
+       ir_entity  *moddi3;       /**< entity for __moddi3 library call */
+       ir_entity  *udivdi3;      /**< entity for __udivdi3 library call */
+       ir_entity  *umoddi3;      /**< entity for __umoddi3 library call */
+       tarval     *u64_bias;     /**< bias value for conversion from float to unsigned 64 */
 };
 
 /** The mode for the floating point control word. */
@@ -211,7 +213,7 @@ ir_node *ia32_new_Unknown_vfp(ia32_code_gen_t *cg);
 ir_node *ia32_new_NoReg_fp(ia32_code_gen_t *cg);
 
 /**
- * Returns the uniqure per irg FPU truncation mode node.
+ * Returns the unique per irg FPU truncation mode node.
  */
 ir_node *ia32_new_Fpu_truncate(ia32_code_gen_t *cg);