no need for no_float_fold hack anymore
authorMatthias Braun <matze@braunis.de>
Wed, 22 Sep 2010 14:07:39 +0000 (14:07 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 22 Sep 2010 14:07:39 +0000 (14:07 +0000)
[r28018]

include/libfirm/iropt.h
ir/be/ia32/ia32_transform.c
ir/ir/iropt.c

index 0315ae1..53ed43a 100644 (file)
@@ -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,
index fd64132..784fb95 100644 (file)
@@ -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 {
index fd1c736..aabf6fb 100644 (file)
@@ -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);
                }
        }