diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-10-05 11:29:35 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-10-05 11:29:35 +0000 |
commit | 624d31fe0135b7b33529f4e8fae88a4877bfc204 (patch) | |
tree | 9ff1a2cfb5bbe32283d5601af93e89a8f4260dc5 /gcc/config | |
parent | 7d475a547690022aeb7e0bfbd51bc476c6ca31c0 (diff) | |
download | gcc-624d31fe0135b7b33529f4e8fae88a4877bfc204.zip gcc-624d31fe0135b7b33529f4e8fae88a4877bfc204.tar.gz gcc-624d31fe0135b7b33529f4e8fae88a4877bfc204.tar.bz2 |
Replace REAL_VALUES_EQUAL with real_equal
Richard B suggested we should replace dconsthalf etc. with
dconst<1, 2> (). When I tried that, the extra comma caused problems
with some lingering uses of the old target macros for handling reals
(e.g. REAL_ARITHMETIC instead of real_arithmetic), since the constant
was then treated as two macro parameters. It would have been possible
to add an extra level of brackets to avoid this, but I thought I might
as well take the opportunity to remove the macros instead. (Note that
I'm only removing macros that caused a problem directly, or are closely
related to ones that did.)
This first patch replaces REAL_VALUES_EQUAL with a real_equal function.
The prototype is the same as for real_identical, which has already
undergone a half-transition in this direction.
Bootstrapped & regression-tested on x86_64-linux-gnu. Also tested by
building one target per CPU directory and checking that there were
no new warnings and no changes in testsuite output at -O2.
gcc/c-family/
* c-lex.c (interpret_float): Use real_equal instead of
REAL_VALUES_EQUAL.
gcc/c/
* c-typeck.c (c_tree_equal): Use real_equal instead of
REAL_VALUES_EQUAL.
gcc/cp/
* tree.c (cp_tree_equal): Use real_equal instead of
REAL_VALUES_EQUAL.
gcc/
* real.h (real_equal): Declare.
(REAL_VALUES_EQUAL): Delete.
* real.c (real_equal): New function.
(real_compare): Use it.
* doc/tm.texi.in (REAL_VALUES_EQUAL): Delete.
* doc/tm.texi: Regenerate.
* builtins.c (fold_builtin_pow, fold_builtin_load_exponent): Use
real_equal instead of REAL_VALUES_EQUAL.
* config/aarch64/aarch64.c (aarch64_float_const_zero_rtx_p): Likewise.
* config/arm/arm.c (arm_const_double_rtx, neon_valid_immediate)
(fp_const_from_val): Likewise.
* config/fr30/fr30.c (fr30_const_double_is_zero): Likewise.
* config/m68k/m68k.c (standard_68881_constant_p): Likewise.
(floating_exact_log2): Likewise.
* config/sh/sh.c (fp_zero_operand, fp_one_operand): Likewise.
* config/vax/vax.c (vax_float_literal): Likewise.
* config/xtensa/predicates.md (const_float_1_operand): Likewise.
* cprop.c (implicit_set_cond_p): Likewise.
* expmed.c (expand_mult): Likewise.
* fold-const.c (const_binop): Likewise.
* simplify-rtx.c (simplify_binary_operation_1): Likewise.
(simplify_const_binary_operation): Likewise.
(simplify_const_relational_operation): Likewise.
* tree-call-cdce.c (check_pow): Likewise.
(gen_conditions_for_pow_cst_base): Likewise.
* tree-inline.c (estimate_num_insns): Likewise.
* tree-ssa-dom.c (record_equality): Likewise.
* tree-ssa-math-opts.c (representable_as_half_series_p): Likewise.
(gimple_expand_builtin_pow): Likewise.
(pass_optimize_widening_mul::execute): Likewise.
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
* tree-vect-patterns.c (vect_recog_pow_pattern): Likewise.
* tree.c (real_zerop, real_onep, real_minus_onep): Likewise.
---
gcc/builtins.c | 14 +++++++-------
gcc/c-family/c-lex.c | 6 +++---
gcc/c/c-typeck.c | 2 +-
gcc/config/aarch64/aarch64.c | 2 +-
gcc/config/arm/arm.c | 6 +++---
gcc/config/fr30/fr30.c | 2 +-
gcc/config/m68k/m68k.c | 6 +++---
gcc/config/sh/sh.c | 4 ++--
gcc/config/vax/vax.c | 4 ++--
gcc/config/xtensa/predicates.md | 2 +-
gcc/cp/tree.c | 2 +-
gcc/cprop.c | 2 +-
gcc/doc/tm.texi | 7 -------
gcc/doc/tm.texi.in | 7 -------
gcc/expmed.c | 2 +-
gcc/fold-const.c | 2 +-
gcc/real.c | 10 +++++++++-
gcc/real.h | 4 ++--
gcc/simplify-rtx.c | 16 ++++++++--------
gcc/tree-call-cdce.c | 4 ++--
gcc/tree-inline.c | 5 +++--
gcc/tree-ssa-dom.c | 2 +-
gcc/tree-ssa-math-opts.c | 16 ++++++++--------
gcc/tree-ssa-uncprop.c | 2 +-
gcc/tree-vect-patterns.c | 4 ++--
gcc/tree.c | 6 +++---
26 files changed, 67 insertions(+), 72 deletions(-)
From-SVN: r228473
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 2 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 6 | ||||
-rw-r--r-- | gcc/config/fr30/fr30.c | 2 | ||||
-rw-r--r-- | gcc/config/m68k/m68k.c | 6 | ||||
-rw-r--r-- | gcc/config/sh/sh.c | 4 | ||||
-rw-r--r-- | gcc/config/vax/vax.c | 4 | ||||
-rw-r--r-- | gcc/config/xtensa/predicates.md | 2 |
7 files changed, 13 insertions, 13 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index d4c5665..a1057c9 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3771,7 +3771,7 @@ aarch64_float_const_zero_rtx_p (rtx x) REAL_VALUE_FROM_CONST_DOUBLE (r, x); if (REAL_VALUE_MINUS_ZERO (r)) return !HONOR_SIGNED_ZEROS (GET_MODE (x)); - return REAL_VALUES_EQUAL (r, dconst0); + return real_equal (&r, &dconst0); } /* Return the fixed registers used for condition codes. */ diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 02f5dc3..184ce50 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -12107,7 +12107,7 @@ arm_const_double_rtx (rtx x) if (REAL_VALUE_MINUS_ZERO (r)) return 0; - if (REAL_VALUES_EQUAL (r, value_fp0)) + if (real_equal (&r, &value_fp0)) return 1; return 0; @@ -12319,7 +12319,7 @@ neon_valid_immediate (rtx op, machine_mode mode, int inverse, REAL_VALUE_FROM_CONST_DOUBLE (re, elt); - if (!REAL_VALUES_EQUAL (r0, re)) + if (!real_equal (&r0, &re)) return -1; } @@ -17594,7 +17594,7 @@ fp_const_from_val (REAL_VALUE_TYPE *r) if (!fp_consts_inited) init_fp_table (); - gcc_assert (REAL_VALUES_EQUAL (*r, value_fp0)); + gcc_assert (real_equal (r, &value_fp0)); return "0"; } diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 3308b55..0cac6ce 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -895,7 +895,7 @@ fr30_const_double_is_zero (rtx operand) REAL_VALUE_FROM_CONST_DOUBLE (d, operand); - return REAL_VALUES_EQUAL (d, dconst0); + return real_equal (&d, &dconst0); } /*}}}*/ diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index c26f37b..b7d96a5 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -4336,7 +4336,7 @@ standard_68881_constant_p (rtx x) REAL_VALUE_FROM_CONST_DOUBLE (r, x); - /* Use REAL_VALUES_IDENTICAL instead of REAL_VALUES_EQUAL so that -0.0 + /* Use REAL_VALUES_IDENTICAL instead of real_equal so that -0.0 is rejected. */ for (i = 0; i < 6; i++) { @@ -4347,7 +4347,7 @@ standard_68881_constant_p (rtx x) if (GET_MODE (x) == SFmode) return 0; - if (REAL_VALUES_EQUAL (r, values_68881[6])) + if (real_equal (&r, &values_68881[6])) return (codes_68881[6]); /* larger powers of ten in the constants ram are not used @@ -4371,7 +4371,7 @@ floating_exact_log2 (rtx x) exp = real_exponent (&r); real_2expN (&r1, exp, DFmode); - if (REAL_VALUES_EQUAL (r1, r)) + if (real_equal (&r1, &r)) return exp; return 0; diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 904201b..a0d2e16 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -10006,7 +10006,7 @@ fp_zero_operand (rtx op) return false; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - return REAL_VALUES_EQUAL (r, dconst0) && ! REAL_VALUE_MINUS_ZERO (r); + return real_equal (&r, &dconst0) && ! REAL_VALUE_MINUS_ZERO (r); } /* Returns true if OP is a floating point value with value 1.0. */ @@ -10019,7 +10019,7 @@ fp_one_operand (rtx op) return false; REAL_VALUE_FROM_CONST_DOUBLE (r, op); - return REAL_VALUES_EQUAL (r, dconst1); + return real_equal (&r, &dconst1); } /* Return the TLS type for TLS symbols. */ diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c index 7e0a2c2..2ad0e0ad 100644 --- a/gcc/config/vax/vax.c +++ b/gcc/config/vax/vax.c @@ -661,11 +661,11 @@ vax_float_literal (rtx c) bool ok; real_from_integer (&s, mode, x, SIGNED); - if (REAL_VALUES_EQUAL (r, s)) + if (real_equal (&r, &s)) return true; ok = exact_real_inverse (mode, &s); gcc_assert (ok); - if (REAL_VALUES_EQUAL (r, s)) + if (real_equal (&r, &s)) return true; } return false; diff --git a/gcc/config/xtensa/predicates.md b/gcc/config/xtensa/predicates.md index d7dfa11..e297b82 100644 --- a/gcc/config/xtensa/predicates.md +++ b/gcc/config/xtensa/predicates.md @@ -152,7 +152,7 @@ { REAL_VALUE_TYPE d; REAL_VALUE_FROM_CONST_DOUBLE (d, op); - return REAL_VALUES_EQUAL (d, dconst1); + return real_equal (&d, &dconst1); }) (define_predicate "fpmem_offset_operand" |