diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2014-12-12 11:46:00 +0100 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2014-12-12 10:46:00 +0000 |
commit | 3d3dbaddce17ecb312558f77bf32e3b0cc3d5fe5 (patch) | |
tree | 6e8c286bbdbceedd094b4c74d98033969cce3446 /gcc/real.c | |
parent | 3b41b58357054c9f236e265f68a4d852b57fa62d (diff) | |
download | gcc-3d3dbaddce17ecb312558f77bf32e3b0cc3d5fe5.tar.gz |
real.h (HONOR_SNANS, [...]): Replace macros with 3 overloaded declarations.
2014-12-12 Marc Glisse <marc.glisse@inria.fr>
* real.h (HONOR_SNANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS,
HONOR_SIGN_DEPENDENT_ROUNDING): Replace macros with 3 overloaded
declarations.
* real.c (HONOR_NANS): Fix indentation.
(HONOR_SNANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS,
HONOR_SIGN_DEPENDENT_ROUNDING): Define three overloads.
* builtins.c (fold_builtin_cproj, fold_builtin_signbit,
fold_builtin_fmin_fmax, fold_builtin_classify): Simplify argument
of HONOR_*.
* fold-const.c (operand_equal_p, fold_comparison, fold_binary_loc):
Likewise.
* gimple-fold.c (gimple_val_nonnegative_real_p): Likewise.
* ifcvt.c (noce_try_move, noce_try_minmax, noce_try_abs): Likewise.
* omp-low.c (omp_reduction_init): Likewise.
* rtlanal.c (may_trap_p_1): Likewise.
* simplify-rtx.c (simplify_const_relational_operation): Likewise.
* tree-ssa-dom.c (record_equality, record_edge_info): Likewise.
* tree-ssa-phiopt.c (value_replacement, abs_replacement): Likewise.
* tree-ssa-reassoc.c (eliminate_using_constants): Likewise.
* tree-ssa-uncprop.c (associate_equivalences_with_edges): Likewise.
From-SVN: r218663
Diffstat (limited to 'gcc/real.c')
-rw-r--r-- | gcc/real.c | 84 |
1 files changed, 83 insertions, 1 deletions
diff --git a/gcc/real.c b/gcc/real.c index 9ba847a6869..bee42456bca 100644 --- a/gcc/real.c +++ b/gcc/real.c @@ -5003,6 +5003,88 @@ HONOR_NANS (const_tree t) bool HONOR_NANS (const_rtx x) { - return HONOR_NANS (GET_MODE (x)); + return HONOR_NANS (GET_MODE (x)); } +/* Like HONOR_NANs, but true if we honor signaling NaNs (or sNaNs). */ + +bool +HONOR_SNANS (machine_mode m) +{ + return flag_signaling_nans && HONOR_NANS (m); +} + +bool +HONOR_SNANS (const_tree t) +{ + return HONOR_SNANS (element_mode (t)); +} + +bool +HONOR_SNANS (const_rtx x) +{ + return HONOR_SNANS (GET_MODE (x)); +} + +/* As for HONOR_NANS, but true if the mode can represent infinity and + the treatment of infinite values is important. */ + +bool +HONOR_INFINITIES (machine_mode m) +{ + return MODE_HAS_INFINITIES (m) && !flag_finite_math_only; +} + +bool +HONOR_INFINITIES (const_tree t) +{ + return HONOR_INFINITIES (element_mode (t)); +} + +bool +HONOR_INFINITIES (const_rtx x) +{ + return HONOR_INFINITIES (GET_MODE (x)); +} + +/* Like HONOR_NANS, but true if the given mode distinguishes between + positive and negative zero, and the sign of zero is important. */ + +bool +HONOR_SIGNED_ZEROS (machine_mode m) +{ + return MODE_HAS_SIGNED_ZEROS (m) && flag_signed_zeros; +} + +bool +HONOR_SIGNED_ZEROS (const_tree t) +{ + return HONOR_SIGNED_ZEROS (element_mode (t)); +} + +bool +HONOR_SIGNED_ZEROS (const_rtx x) +{ + return HONOR_SIGNED_ZEROS (GET_MODE (x)); +} + +/* Like HONOR_NANS, but true if given mode supports sign-dependent rounding, + and the rounding mode is important. */ + +bool +HONOR_SIGN_DEPENDENT_ROUNDING (machine_mode m) +{ + return MODE_HAS_SIGN_DEPENDENT_ROUNDING (m) && flag_rounding_math; +} + +bool +HONOR_SIGN_DEPENDENT_ROUNDING (const_tree t) +{ + return HONOR_SIGN_DEPENDENT_ROUNDING (element_mode (t)); +} + +bool +HONOR_SIGN_DEPENDENT_ROUNDING (const_rtx x) +{ + return HONOR_SIGN_DEPENDENT_ROUNDING (GET_MODE (x)); +} |