/* Check if immediate optimization is on and */
/* if it's an operation with immediate. */
- if (! env->cg->opt.immops) {
+ if (! (env->cg->opt & IA32_OPT_IMMOPS)) {
expr_op = op1;
imm_op = NULL;
}
/* Check if immediate optimization is on and */
/* if it's an operation with immediate. */
- imm_op = env->cg->opt.immops ? get_immediate_op(NULL, op2) : NULL;
+ imm_op = (env->cg->opt & IA32_OPT_IMMOPS) ? get_immediate_op(NULL, op2) : NULL;
expr_op = get_expr_op(op1, op2);
assert((expr_op || imm_op) && "invalid operands");
DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;)
/* try to optimize to inc/dec */
- if (env->cg->opt.incdec && tv) {
+ if ((env->cg->opt & IA32_OPT_INCDEC) && tv) {
/* optimize tarvals */
class_tv = classify_tarval(tv);
class_negtv = classify_tarval(tarval_neg(tv));
/* Check if immediate optimization is on and */
/* if it's an operation with immediate. */
- imm_op = env->cg->opt.immops ? get_immediate_op(op1, op2) : NULL;
+ imm_op = (env->cg->opt & IA32_OPT_IMMOPS) ? get_immediate_op(op1, op2) : NULL;
expr_op = get_expr_op(op1, op2);
assert((expr_op || imm_op) && "invalid operands");
DEBUG_ONLY(firm_dbg_module_t *mod = env->mod;)
/* try to optimize to inc/dec */
- if (env->cg->opt.incdec && tv) {
+ if ((env->cg->opt & IA32_OPT_INCDEC) && tv) {
/* optimize tarvals */
class_tv = classify_tarval(tv);
class_negtv = classify_tarval(tarval_neg(tv));
/* Check if immediate optimization is on and */
/* if it's an operation with immediate. */
- imm_op = env->cg->opt.immops ? get_immediate_op(NULL, op2) : NULL;
+ imm_op = (env->cg->opt & IA32_OPT_IMMOPS) ? get_immediate_op(NULL, op2) : NULL;
expr_op = get_expr_op(op1, op2);
assert((expr_op || imm_op) && "invalid operands");
set_ia32_Immop_tarval(edx_node, get_tarval_null(mode_Iu));
}
- res = new_rd_ia32_DivMod(dbg, irg, block, dividend, divisor, edx_node, mem, mode_T);
+ res = new_rd_ia32_DivMod(dbg, irg, block, dividend, divisor, edx_node, mem, mode_T, dm_flav);
- set_ia32_flavour(res, dm_flav);
set_ia32_n_res(res, 2);
/* Only one proj is used -> We must add a second proj and */
cmp_b = get_Cmp_right(pred);
/* check if we can use a CondJmp with immediate */
- cnst = env->cg->opt.immops ? get_immediate_op(cmp_a, cmp_b) : NULL;
+ cnst = (env->cg->opt & IA32_OPT_IMMOPS) ? get_immediate_op(cmp_a, cmp_b) : NULL;
expr = get_expr_op(cmp_a, cmp_b);
if (cnst && expr) {
static ir_node *gen_Conv(ia32_transform_env_t *env) {
dbg_info *dbg = env->dbg;
ir_graph *irg = env->irg;
- ir_node *op = get_Conv_op(env->irn);
+ ir_node *op = get_Conv_op(env->irn);
ir_mode *src_mode = get_irn_mode(op);
ir_mode *tgt_mode = env->mode;
int src_bits = get_mode_size_bits(src_mode);
return new_op;
}
+/**
+ * This function just sets the register for the Unknown node
+ * as this is not done during register allocation because Unknown
+ * is an "ignore" node.
+ */
+static ir_node *gen_Unknown(ia32_transform_env_t *env) {
+ ir_mode *mode = env->mode;
+ ir_node *irn = env->irn;
+
+ if (mode_is_float(mode)) {
+ if (USE_SSE2(env->cg))
+ arch_set_irn_register(env->cg->arch_env, irn, &ia32_xmm_regs[REG_XMM_UKNWN]);
+ else
+ arch_set_irn_register(env->cg->arch_env, irn, &ia32_vfp_regs[REG_VFP_UKNWN]);
+ }
+ else if (mode_is_int(mode) || mode_is_reference(mode)) {
+ arch_set_irn_register(env->cg->arch_env, irn, &ia32_gp_regs[REG_GP_UKNWN]);
+ }
+ else {
+ assert(0 && "unsupported Unknown-Mode");
+ }
+
+ return NULL;
+}
/*********************************************************
IGN(IJmp);
IGN(Break);
IGN(Cmp);
- IGN(Unknown);
/* constant transformation happens earlier */
IGN(Const);
GEN(be_FrameStore);
GEN(be_StackParam);
+ /* set the register for all Unknown nodes */
+ GEN(Unknown);
+
op_Max = get_op_Max();
if (op_Max)
GEN(Max);