https://gcc.gnu.org/g:65c8727f5e0f938b50998c28565d1bba0c7394ba

commit 65c8727f5e0f938b50998c28565d1bba0c7394ba
Author: Michael Meissner <meiss...@linux.ibm.com>
Date:   Fri Jan 24 11:44:01 2025 -0500

    Revert changes

Diff:
---
 gcc/config/rs6000/rs6000-protos.h |  2 +-
 gcc/config/rs6000/rs6000.cc       | 19 ++++---------------
 gcc/config/rs6000/rs6000.h        | 10 ++--------
 gcc/config/rs6000/rs6000.md       | 24 +++++++++---------------
 4 files changed, 16 insertions(+), 39 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-protos.h 
b/gcc/config/rs6000/rs6000-protos.h
index 8f790d261d9a..4619142d197b 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -115,7 +115,7 @@ extern const char *rs6000_indirect_call_template (rtx *, 
unsigned int);
 extern const char *rs6000_indirect_sibcall_template (rtx *, unsigned int);
 extern const char *rs6000_pltseq_template (rtx *, int);
 extern enum rtx_code rs6000_reverse_condition (machine_mode,
-                                              enum rtx_code, bool);
+                                              enum rtx_code);
 extern rtx rs6000_emit_eqne (machine_mode, rtx, rtx, rtx);
 extern rtx rs6000_emit_fp_cror (rtx_code, machine_mode, rtx);
 extern void rs6000_emit_sCOND (machine_mode, rtx[]);
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index 276e2f886acc..f9f9a0b931db 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -15360,25 +15360,15 @@ rs6000_print_patchable_function_entry (FILE *file,
 }
 
 enum rtx_code
-rs6000_reverse_condition (machine_mode mode,
-                         enum rtx_code code,
-                         bool no_ordered)
+rs6000_reverse_condition (machine_mode mode, enum rtx_code code)
 {
   /* Reversal of FP compares takes care -- an ordered compare
-     becomes an unordered compare and vice versa.
-
-     However, this is not safe for ordered comparisons (i.e. for isgreater,
-     etc.)  starting with the power9 because ifcvt.cc will want to create a fp
-     cmove, and the x{s,v}cmp{eq,gt,ge}{dp,qp} instructions will trap if one of
-     the arguments is a signalling NaN.  */
-
+     becomes an unordered compare and vice versa.  */
   if (mode == CCFPmode
       && (!flag_finite_math_only
          || code == UNLT || code == UNLE || code == UNGT || code == UNGE
          || code == UNEQ || code == LTGT))
-    return (no_ordered
-           ? UNKNOWN
-           : reverse_condition_maybe_unordered (code));
+    return reverse_condition_maybe_unordered (code);
   else
     return reverse_condition (code);
 }
@@ -15993,8 +15983,7 @@ rs6000_emit_sCOND (machine_mode mode, rtx operands[])
 
       cc_mode = GET_MODE (XEXP (condition_rtx, 0));
 
-      rev_cond_rtx = gen_rtx_fmt_ee (rs6000_reverse_condition (cc_mode, 
cond_code,
-                                                              false),
+      rev_cond_rtx = gen_rtx_fmt_ee (rs6000_reverse_condition (cc_mode, 
cond_code),
                                     SImode, XEXP (condition_rtx, 0), 
const0_rtx);
       not_op = gen_rtx_COMPARE (CCEQmode, rev_cond_rtx, const0_rtx);
       emit_insn (gen_rtx_SET (not_result, not_op));
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 98228ee5ac16..ec08c96d0f67 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -1812,17 +1812,11 @@ extern scalar_int_mode rs6000_pmode;
 
 /* Can the condition code MODE be safely reversed?  This is safe in
    all cases on this port, because at present it doesn't use the
-   trapping FP comparisons (fcmpo).
-
-   However, this is not safe for ordered comparisons (i.e. for isgreater, etc.)
-   starting with the power9 because ifcvt.cc will want to create a fp cmove,
-   and the x{s,v}cmp{eq,gt,ge}{dp,qp} instructions will trap if one of the
-   arguments is a signalling NaN.  */
+   trapping FP comparisons (fcmpo).  */
 #define REVERSIBLE_CC_MODE(MODE) 1
 
 /* Given a condition code and a mode, return the inverse condition.  */
-#define REVERSE_CONDITION(CODE, MODE) \
-  rs6000_reverse_condition (MODE, CODE, true)
+#define REVERSE_CONDITION(CODE, MODE) rs6000_reverse_condition (MODE, CODE)
 
 
 /* Target cpu costs.  */
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index cf4b10257903..65da0c653304 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -13497,7 +13497,7 @@
 ;; If we are comparing the result of two comparisons, this can be done
 ;; using creqv or crxor.
 
-(define_insn_and_split "*reverse_branch_comparison"
+(define_insn_and_split ""
   [(set (match_operand:CCEQ 0 "cc_reg_operand" "=y")
        (compare:CCEQ (match_operator 1 "branch_comparison_operator"
                              [(match_operand 2 "cc_reg_operand" "y")
@@ -13519,25 +13519,19 @@
                                                    GET_MODE (operands[3]));
 
   if (! positive_1)
-    {
-      enum rtx_code rev = rs6000_reverse_condition (GET_MODE (operands[2]),
-                                                   GET_CODE (operands[1]),
-                                                   false);
-      gcc_assert (rev != UNKNOWN);
-      operands[1] = gen_rtx_fmt_ee (rev, SImode, operands[2], const0_rtx);
-    }
+    operands[1] = gen_rtx_fmt_ee (rs6000_reverse_condition (GET_MODE 
(operands[2]),
+                                                           GET_CODE 
(operands[1])),
+                                 SImode,
+                                 operands[2], const0_rtx);
   else if (GET_MODE (operands[1]) != SImode)
     operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]), SImode,
                                  operands[2], const0_rtx);
 
   if (! positive_2)
-    {
-      enum rtx_code rev = rs6000_reverse_condition (GET_MODE (operands[4]),
-                                                   GET_CODE (operands[3]),
-                                                   false);
-      gcc_assert (rev != UNKNOWN);
-      operands[3] = gen_rtx_fmt_ee (rev, SImode, operands[4], const0_rtx);
-    }
+    operands[3] = gen_rtx_fmt_ee (rs6000_reverse_condition (GET_MODE 
(operands[4]),
+                                                           GET_CODE 
(operands[3])),
+                                 SImode,
+                                 operands[4], const0_rtx);
   else if (GET_MODE (operands[3]) != SImode)
     operands[3] = gen_rtx_fmt_ee (GET_CODE (operands[3]), SImode,
                                  operands[4], const0_rtx);

Reply via email to