/**
* Enable/Disable floating point constant folding.
*/
-int tarval_enable_fp_ops(int enable);
+void tarval_enable_fp_ops(int enable);
+
+/** returns 0/1 if floating point folding is enable/disabled */
+int tarval_fp_ops_enabled(void);
/**
* Check if its the a floating point NaN.
tarval *tv = value_of(b);
if (tv != tarval_bad) {
- int rem;
+ int rem = tarval_fp_ops_enabled();
/*
* Floating point constant folding might be disabled here to
* However, as we check for exact result, doing it is safe.
* Switch it on.
*/
- rem = tarval_enable_fp_ops(1);
+ tarval_enable_fp_ops(1);
tv = tarval_quo(get_mode_one(mode), tv);
- (void)tarval_enable_fp_ops(rem);
+ tarval_enable_fp_ops(rem);
/* Do the transformation if the result is either exact or we are not
using strict rules. */
/* 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(current_ir_graph);
- int old_fp_mode = tarval_enable_fp_ops((fp_model & fp_strict_algebraic) == 0);
+ 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) {
/* 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(current_ir_graph);
- int old_fp_mode = tarval_enable_fp_ops((fp_model & fp_strict_algebraic) == 0);
+ 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) {
}
/* Enable/Disable floating point constant folding. */
-int tarval_enable_fp_ops(int enable) {
- int old = !no_float;
-
+void tarval_enable_fp_ops(int enable) {
no_float = !enable;
- return old;
+}
+
+int tarval_fp_ops_enabled(void) {
+ return !no_float;
}
/**