From 71925bc04f24a40ab8ac587e08609cf91299e293 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 7 Mar 2002 11:37:16 +0000 Subject: defaults.h (MODE_HAS_NANS, [...]): New. * defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New. (MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New. * flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New. (HONOR_SIGN_DEPENDENT_ROUNDING): New. * builtins.c (expand_builtin_mathfn): Use HONOR_NANS. * c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y unless x and y could be infinite. (expand_unordered_cmp): New, mostly split from expand_tree_builtin. Check that the common type of both arguments is a real, even for targets without unordered comparisons. Allow an integer argument to be compared against a real. (expand_tree_builtin): Use expand_unordered_cmp. * combine.c (combine_simplify_rtx): Use the new HONOR_... macros. * cse.c (fold_rtx): Likewise. Fix indentation. * fold-const.c (fold_real_zero_addition_p): New. (fold): Use it, and the new HONOR_... macros. * ifcvt.c (noce_try_minmax): Use the new HONOR_... macros. * jump.c (reversed_comparison_code_parts): After searching for the true comparison mode, use HONOR_NANS to decide whether it can be safely reversed. (reverse_condition_maybe_unordered): Remove IEEE check. * simplify-rtx.c (simplify_binary_operation): Use the new macros to decide which simplifications are valid. Allow the following simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b), and (a - -b) to (a + b). (simplify_relational_operation): Use HONOR_NANS. * doc/tm.texi: Document the MODE_HAS_... macros. From-SVN: r50401 --- gcc/ifcvt.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gcc/ifcvt.c') diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 038b8c5..7a450bc9 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1295,12 +1295,11 @@ noce_try_minmax (if_info) if (no_new_pseudos) return FALSE; - /* ??? Reject FP modes since we don't know how 0 vs -0 or NaNs - will be resolved with an SMIN/SMAX. It wouldn't be too hard + /* ??? Reject modes with NaNs or signed zeros since we don't know how + they will be resolved with an SMIN/SMAX. It wouldn't be too hard to get the target to tell us... */ - if (FLOAT_MODE_P (GET_MODE (if_info->x)) - && TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT - && ! flag_unsafe_math_optimizations) + if (HONOR_SIGNED_ZEROS (GET_MODE (if_info->x)) + || HONOR_NANS (GET_MODE (if_info->x))) return FALSE; cond = noce_get_alt_condition (if_info, if_info->a, &earliest); -- cgit v1.1