diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2011-06-07 15:12:04 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2011-06-07 15:12:04 +0000 |
commit | 06bc3ec79056f8c53d4e59f45afe78a547c23546 (patch) | |
tree | 44dc6b8481b3a6a81e091f03fc34efc38e60abff /gcc/tree-ssa-math-opts.c | |
parent | 3c395ecf7d41384016acbcc18d4847c72685013c (diff) | |
download | gcc-06bc3ec79056f8c53d4e59f45afe78a547c23546.zip gcc-06bc3ec79056f8c53d4e59f45afe78a547c23546.tar.gz gcc-06bc3ec79056f8c53d4e59f45afe78a547c23546.tar.bz2 |
re PR tree-optimization/46728 (GCC does not generate fmadd for pow (x, 0.75)+y on powerpc)
2011-06-07 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/46728
* tree-ssa-math-opts.c (gimple_expand_builtin_pow): Change FIXME
to use gimple_val_nonnegative_real_p.
* gimple-fold.c (gimple_val_nonnegative_real_p): New function.
* gimple.h (gimple_val_nonnegative_real_p): New declaration.
From-SVN: r174752
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r-- | gcc/tree-ssa-math-opts.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index f53a300..e6b5857 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -1172,13 +1172,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc, if (flag_unsafe_math_optimizations && cbrtfn - /* FIXME: The following line was originally - && (tree_expr_nonnegative_p (arg0) || !HONOR_NANS (mode)), - but since arg0 is a gimple value, the first predicate - will always return false. It needs to be replaced with a - call to a similar gimple_val_nonnegative_p function to be - added in gimple-fold.c. */ - && !HONOR_NANS (mode) + && (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode)) && REAL_VALUES_EQUAL (c, dconst1_3)) return build_and_insert_call (gsi, loc, &target, cbrtfn, arg0); @@ -1190,13 +1184,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc, if (flag_unsafe_math_optimizations && sqrtfn && cbrtfn - /* FIXME: The following line was originally - && (tree_expr_nonnegative_p (arg0) || !HONOR_NANS (mode)), - but since arg0 is a gimple value, the first predicate - will always return false. It needs to be replaced with a - call to a similar gimple_val_nonnegative_p function to be - added in gimple-fold.c. */ - && !HONOR_NANS (mode) + && (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode)) && optimize_function_for_speed_p (cfun) && hw_sqrt_exists && REAL_VALUES_EQUAL (c, dconst1_6)) @@ -1270,13 +1258,7 @@ gimple_expand_builtin_pow (gimple_stmt_iterator *gsi, location_t loc, if (flag_unsafe_math_optimizations && cbrtfn - /* FIXME: The following line was originally - && (tree_expr_nonnegative_p (arg0) || !HONOR_NANS (mode)), - but since arg0 is a gimple value, the first predicate - will always return false. It needs to be replaced with a - call to a similar gimple_val_nonnegative_p function to be - added in gimple-fold.c. */ - && !HONOR_NANS (mode) + && (gimple_val_nonnegative_real_p (arg0) || !HONOR_NANS (mode)) && real_identical (&c2, &c) && optimize_function_for_speed_p (cfun) && powi_cost (n / 3) <= POWI_MAX_MULTS) |