From 2450703cc08737027b115c2da82db83a93cd4ecd Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 28 Feb 2001 17:19:16 +0100 Subject: [PATCH] jump.c (reversed_comparison_code_parts): Allow reversal of unordered compares in -ffast-math mode... * jump.c (reversed_comparison_code_parts): Allow reversal of unordered compares in -ffast-math mode; reverse ordered compares for FP even w/o -ffast-math. From-SVN: r40118 --- gcc/ChangeLog | 6 ++++++ gcc/jump.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c3fa5d9557..b8a2020ca36 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Feb 28 17:17:29 CET 2001 Jan Hubicka + + * jump.c (reversed_comparison_code_parts): Allow reversal of + unordered compares in -ffast-math mode; reverse ordered compares + for FP even w/o -ffast-math. + 2001-02-27 Richard Henderson * print-rtl.c (print_rtx) [i]: Don't print field five on diff --git a/gcc/jump.c b/gcc/jump.c index 5ff808ad0e3..bda1c6b270d 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -1782,7 +1782,11 @@ reversed_comparison_code_parts (code, arg0, arg1, insn) case UNLE: case UNGT: case UNGE: - /* We don't have safe way to reverse these yet. */ + /* We don't have safe way to reverse these yet - we would need + ordered compares that may not trap. */ + if (TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT + || flag_fast_math) + return reverse_condition_maybe_unordered (code); return UNKNOWN; default: break; @@ -1841,6 +1845,12 @@ reversed_comparison_code_parts (code, arg0, arg1, insn) } } + /* In case of floating point modes, we may reverse here, since + we will be always converting an ordered compare to unordered. + The unsafe code has been caught earlier. */ + if (FLOAT_MODE_P (mode)) + return reverse_condition_maybe_unordered (code); + /* An integer condition. */ if (GET_CODE (arg0) == CONST_INT || (GET_MODE (arg0) != VOIDmode -- 2.30.2