From: Matthias Braun Date: Wed, 22 Sep 2010 14:07:39 +0000 (+0000) Subject: no need for no_float_fold hack anymore X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=50b4ecceaf7e7d764244725e67912f97dcd3b577;p=libfirm no need for no_float_fold hack anymore [r28018] --- diff --git a/include/libfirm/iropt.h b/include/libfirm/iropt.h index 0315ae178..53ed43a61 100644 --- a/include/libfirm/iropt.h +++ b/include/libfirm/iropt.h @@ -52,9 +52,6 @@ * - fp_model_fast: * Fastest mode. Associative and distributive law allowed at the expense * of floating point accuracy and correctness. Explicit rounding is disabled. - * - fp_no_float_fold: - * Avoid floating point constant folding. Useful for frontends which do not - * create arithmetic operations in the backends arithmetic mode. */ typedef enum fp_model_t { fp_explicit_rounding = (1u << 0), /**< Explicit rounding at assignments, typecasts, return @@ -69,7 +66,6 @@ typedef enum fp_model_t { synchronized exception code. */ fp_environment_access = (1u << 5), /**< FPU environment can be accessed. Even Constant folding cannot be done. */ - fp_no_float_fold = (1u << 6), /** Precise floating point model. Default. */ fp_model_precise = fp_explicit_rounding|fp_strict_algebraic|fp_contradictions, diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index fd64132d3..784fb9586 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -3804,8 +3804,7 @@ static ir_node *gen_Conv(ir_node *node) /* if fp_no_float_fold is not set then we assume that we * don't have any float operations in a non * mode_float_arithmetic mode and can skip strict upconvs */ - if (src_bits < tgt_bits - && !(get_irg_fp_model(current_ir_graph) & fp_no_float_fold)) { + if (src_bits < tgt_bits) { DB((dbg, LEVEL_1, "killed Conv(float, float) ...")); return new_op; } else { diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index fd1c736bd..aabf6fb7e 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -6744,11 +6744,6 @@ ir_node *optimize_node(ir_node *n) if (get_opt_constant_folding()) { /* neither constants nor Tuple values can be evaluated */ if (iro != iro_Const && (get_irn_mode(n) != mode_T)) { - unsigned fp_model = get_irg_fp_model(irg); - int old_fp_mode = tarval_fp_ops_enabled(); - - tarval_enable_fp_ops(! (fp_model & fp_no_float_fold)); - /* try to evaluate */ tv = computed_value(n); if (tv != tarval_bad) { @@ -6786,10 +6781,8 @@ ir_node *optimize_node(ir_node *n) if (old_tp && get_type_mode(old_tp) == get_tarval_mode(tv)) set_Const_type(nw, old_tp); DBG_OPT_CSTEVAL(oldn, nw); - tarval_enable_fp_ops(old_fp_mode); return nw; } - tarval_enable_fp_ops(old_fp_mode); } } @@ -6860,11 +6853,6 @@ ir_node *optimize_in_place_2(ir_node *n) if (get_opt_constant_folding()) { /* neither constants nor Tuple values can be evaluated */ if (iro != iro_Const && get_irn_mode(n) != mode_T) { - ir_graph *irg = get_irn_irg(n); - unsigned fp_model = get_irg_fp_model(irg); - int old_fp_mode = tarval_fp_ops_enabled(); - - tarval_enable_fp_ops((fp_model & fp_strict_algebraic) == 0); /* try to evaluate */ tv = computed_value(n); if (tv != tarval_bad) { @@ -6884,10 +6872,8 @@ ir_node *optimize_in_place_2(ir_node *n) set_Const_type(n, old_tp); DBG_OPT_CSTEVAL(oldn, n); - tarval_enable_fp_ops(old_fp_mode); return n; } - tarval_enable_fp_ops(old_fp_mode); } }