if (flag_unsafe_math_optimizations
&& operand_equal_p (real, imag, OEP_PURE_SAME))
{
- const REAL_VALUE_TYPE sqrt2_trunc
- = real_value_truncate (TYPE_MODE (type), dconst_sqrt2 ());
STRIP_NOPS (real);
return fold_build2_loc (loc, MULT_EXPR, type,
- fold_build1_loc (loc, ABS_EXPR, type, real),
- build_real (type, sqrt2_trunc));
+ fold_build1_loc (loc, ABS_EXPR, type, real),
+ build_real_truncate (type, dconst_sqrt2 ()));
}
}
/* Adjust for the outer root. */
SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1);
- dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot);
- tree_root = build_real (type, dconstroot);
+ tree_root = build_real_truncate (type, dconstroot);
return build_call_expr_loc (loc, powfn, 2, arg0, tree_root);
}
}
if (BUILTIN_EXPONENT_P (fcode))
{
tree expfn = TREE_OPERAND (CALL_EXPR_FN (arg), 0);
- const REAL_VALUE_TYPE third_trunc =
- real_value_truncate (TYPE_MODE (type), dconst_third ());
arg = fold_build2_loc (loc, MULT_EXPR, type,
- CALL_EXPR_ARG (arg, 0),
- build_real (type, third_trunc));
+ CALL_EXPR_ARG (arg, 0),
+ build_real_truncate (type, dconst_third ()));
return build_call_expr_loc (loc, expfn, 1, arg);
}
REAL_VALUE_TYPE dconstroot = dconst_third ();
SET_REAL_EXP (&dconstroot, REAL_EXP (&dconstroot) - 1);
- dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot);
- tree_root = build_real (type, dconstroot);
+ tree_root = build_real_truncate (type, dconstroot);
return build_call_expr_loc (loc, powfn, 2, arg0, tree_root);
}
}
real_arithmetic (&dconstroot, MULT_EXPR,
dconst_third_ptr (), dconst_third_ptr ());
- dconstroot = real_value_truncate (TYPE_MODE (type), dconstroot);
- tree_root = build_real (type, dconstroot);
+ tree_root = build_real_truncate (type, dconstroot);
return build_call_expr_loc (loc, powfn, 2, arg0, tree_root);
}
}
if (tree_expr_nonnegative_p (arg00))
{
tree powfn = TREE_OPERAND (CALL_EXPR_FN (arg), 0);
- const REAL_VALUE_TYPE dconstroot
- = real_value_truncate (TYPE_MODE (type), dconst_third ());
- tree narg01 = fold_build2_loc (loc, MULT_EXPR, type, arg01,
- build_real (type, dconstroot));
+ tree c = build_real_truncate (type, dconst_third ());
+ tree narg01 = fold_build2_loc (loc, MULT_EXPR, type, arg01, c);
return build_call_expr_loc (loc, powfn, 2, arg00, narg01);
}
}
/* hypot(x,x) -> fabs(x)*sqrt(2). */
if (flag_unsafe_math_optimizations
&& operand_equal_p (arg0, arg1, OEP_PURE_SAME))
- {
- const REAL_VALUE_TYPE sqrt2_trunc
- = real_value_truncate (TYPE_MODE (type), dconst_sqrt2 ());
- return fold_build2_loc (loc, MULT_EXPR, type,
- fold_build1_loc (loc, ABS_EXPR, type, arg0),
- build_real (type, sqrt2_trunc));
- }
+ return fold_build2_loc (loc, MULT_EXPR, type,
+ fold_build1_loc (loc, ABS_EXPR, type, arg0),
+ build_real_truncate (type, dconst_sqrt2 ()));
return NULL_TREE;
}
tree arg = CALL_EXPR_ARG (arg0, 0);
if (tree_expr_nonnegative_p (arg))
{
- const REAL_VALUE_TYPE dconstroot
- = real_value_truncate (TYPE_MODE (type), dconst_third ());
- tree narg1 = fold_build2_loc (loc, MULT_EXPR, type, arg1,
- build_real (type, dconstroot));
+ tree c = build_real_truncate (type, dconst_third ());
+ tree narg1 = fold_build2_loc (loc, MULT_EXPR, type, arg1, c);
return build_call_expr_loc (loc, fndecl, 2, arg, narg1);
}
}