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,
{
/* 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;
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 */
}
}
-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.
*/
* 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. */
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);