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