public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Segher Boessenkool <segher@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-3487] rs6000: Add CCANY; replace <un>signed by <mode:CCANY>
Date: Tue, 25 Oct 2022 16:34:04 +0000 (GMT)	[thread overview]
Message-ID: <20221025163404.CBB24385AE5D@sourceware.org> (raw)

https://gcc.gnu.org/g:4ba3902e8f1ee3ca35e3194053ebdc1e174808ea

commit r13-3487-g4ba3902e8f1ee3ca35e3194053ebdc1e174808ea
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Mon Oct 24 18:17:24 2022 +0000

    rs6000: Add CCANY; replace <un>signed by <mode:CCANY>
    
    This is in preparation for adding CCFP, and maybe CCEQ, and whatever
    other CC mode we may want later.  CCANY is used for CC mode consumers
    that actually can take any of the four CR field bits.
    
    2022-10-25  Segher Boessenkool  <segher@kernel.crashing.org>
    
            * config/rs6000/rs6000.md (CCEITHER): Delete.
            (CCANY): New.
            (un): Delete.
            (isel_<un>signed_<GPR:mode>): Rename to...
            (isel_<CCANY:mode>_<GPR:mode>): ... this.  Adjust.
            (*isel_reversed_<un>signed_<GPR:mode>): Rename to...
            (*isel_reversed_<CCANY:mode>_<GPR:mode>): ... this.  Adjust.
            (setbc_<un>signed_<GPR:mode>): Rename to...
            (setbc_<CCANY:mode>_<GPR:mode>C): ... this.  Adjust."
            (*setbcr_<un>signed_<GPR:mode>): Rename to ...
            (*setbcr_<CCANY:mode>_<GPR:mode>): ... this.  Adjust.
            (*setnbc_<un>signed_<GPR:mode>): Rename to ...
            (*setnbc_<CCANY:mode>_<GPR:mode>): ... this.  Adjust.
            (*setnbcr_<un>signed_<GPR:mode>): Rename to ...
            (*setnbcr_<CCANY:mode>_<GPR:mode>): ... this.  Adjust.
            (eq<mode>3 for GPR): Adjust.
            (ne<mode>3 for GPR): Adjust.
            * config/rs6000/rs6000-string.cc (do_isel): Adjust.
            * config/rs6000/rs6000.cc (rs6000_emit_int_cmove): Adjust.

Diff:
---
 gcc/config/rs6000/rs6000-string.cc |  4 ++--
 gcc/config/rs6000/rs6000.cc        |  4 ++--
 gcc/config/rs6000/rs6000.md        | 31 +++++++++++++++----------------
 3 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-string.cc b/gcc/config/rs6000/rs6000-string.cc
index 59d901ac68d..cd8ee8c2f7e 100644
--- a/gcc/config/rs6000/rs6000-string.cc
+++ b/gcc/config/rs6000/rs6000-string.cc
@@ -414,9 +414,9 @@ static void
 do_isel (rtx dest, rtx cmp, rtx src_t, rtx src_f, rtx cr)
 {
   if (GET_MODE (dest) == DImode)
-    emit_insn (gen_isel_signed_di (dest, cmp, src_t, src_f, cr));
+    emit_insn (gen_isel_cc_di (dest, cmp, src_t, src_f, cr));
   else
-    emit_insn (gen_isel_signed_si (dest, cmp, src_t, src_f, cr));
+    emit_insn (gen_isel_cc_si (dest, cmp, src_t, src_f, cr));
 }
 
 /* Emit a subtract of the proper mode for DEST.
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc
index d2743f7bce6..01e5bbcf0b6 100644
--- a/gcc/config/rs6000/rs6000.cc
+++ b/gcc/config/rs6000/rs6000.cc
@@ -16341,8 +16341,8 @@ rs6000_emit_int_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond)
   signedp = GET_MODE (cr) == CCmode;
 
   isel_func = (mode == SImode
-	       ? (signedp ? gen_isel_signed_si : gen_isel_unsigned_si)
-	       : (signedp ? gen_isel_signed_di : gen_isel_unsigned_di));
+	       ? (signedp ? gen_isel_cc_si : gen_isel_ccuns_si)
+	       : (signedp ? gen_isel_cc_di : gen_isel_ccuns_di));
 
   switch (cond_code)
     {
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index ad5a4cf2ef8..3bae303086b 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -5428,13 +5428,12 @@
 ;; leave out the mode in operand 4 and use one pattern, but reload can
 ;; change the mode underneath our feet and then gets confused trying
 ;; to reload the value.
-(define_mode_iterator CCEITHER [CC CCUNS])
-(define_mode_attr un [(CC "") (CCUNS "un")])
-(define_insn "isel_<un>signed_<GPR:mode>"
+(define_mode_iterator CCANY [CC CCUNS])
+(define_insn "isel_<CCANY:mode>_<GPR:mode>"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
 	(if_then_else:GPR
 	 (match_operator 1 "scc_comparison_operator"
-			 [(match_operand:CCEITHER 4 "cc_reg_operand" "y,y")
+			 [(match_operand:CCANY 4 "cc_reg_operand" "y,y")
 			  (const_int 0)])
 	 (match_operand:GPR 2 "reg_or_zero_operand" "O,b")
 	 (match_operand:GPR 3 "gpc_reg_operand" "r,r")))]
@@ -5446,11 +5445,11 @@
 ;; isel can handle reversed comparisons so long as the operands are
 ;; registers.
 
-(define_insn "*isel_reversed_<un>signed_<GPR:mode>"
+(define_insn "*isel_reversed_<CCANY:mode>_<GPR:mode>"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r,r")
 	(if_then_else:GPR
 	 (match_operator 1 "scc_rev_comparison_operator"
-			 [(match_operand:CCEITHER 4 "cc_reg_operand" "y,y")
+			 [(match_operand:CCANY 4 "cc_reg_operand" "y,y")
 			  (const_int 0)])
 	 (match_operand:GPR 2 "gpc_reg_operand" "r,r")
 	 (match_operand:GPR 3 "reg_or_zero_operand" "O,b")))]
@@ -5462,38 +5461,38 @@
   [(set_attr "type" "isel")])
 
 ; Set Boolean Condition (Reverse)
-(define_insn "setbc_<un>signed_<GPR:mode>"
+(define_insn "setbc_<CCANY:mode>_<GPR:mode>"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
 	(match_operator:GPR 1 "scc_comparison_operator"
-			[(match_operand:CCEITHER 2 "cc_reg_operand" "y")
+			[(match_operand:CCANY 2 "cc_reg_operand" "y")
 			 (const_int 0)]))]
   "TARGET_POWER10"
   "setbc %0,%j1"
   [(set_attr "type" "isel")])
 
-(define_insn "*setbcr_<un>signed_<GPR:mode>"
+(define_insn "*setbcr_<CCANY:mode>_<GPR:mode>"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
 	(match_operator:GPR 1 "scc_rev_comparison_operator"
-			[(match_operand:CCEITHER 2 "cc_reg_operand" "y")
+			[(match_operand:CCANY 2 "cc_reg_operand" "y")
 			 (const_int 0)]))]
   "TARGET_POWER10"
   "setbcr %0,%j1"
   [(set_attr "type" "isel")])
 
 ; Set Negative Boolean Condition (Reverse)
-(define_insn "*setnbc_<un>signed_<GPR:mode>"
+(define_insn "*setnbc_<CCANY:mode>_<GPR:mode>"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
 	(neg:GPR (match_operator:GPR 1 "scc_comparison_operator"
-			[(match_operand:CCEITHER 2 "cc_reg_operand" "y")
+			[(match_operand:CCANY 2 "cc_reg_operand" "y")
 			 (const_int 0)])))]
   "TARGET_POWER10"
   "setnbc %0,%j1"
   [(set_attr "type" "isel")])
 
-(define_insn "*setnbcr_<un>signed_<GPR:mode>"
+(define_insn "*setnbcr_<CCANY:mode>_<GPR:mode>"
   [(set (match_operand:GPR 0 "gpc_reg_operand" "=r")
 	(neg:GPR (match_operator:GPR 1 "scc_rev_comparison_operator"
-			[(match_operand:CCEITHER 2 "cc_reg_operand" "y")
+			[(match_operand:CCANY 2 "cc_reg_operand" "y")
 			 (const_int 0)])))]
   "TARGET_POWER10"
   "setnbcr %0,%j1"
@@ -12644,7 +12643,7 @@
       rtx compare = gen_rtx_COMPARE (CCmode, operands[1], operands[2]);
       emit_insn (gen_rtx_SET (cc, compare));
       rtx eq = gen_rtx_fmt_ee (EQ, <MODE>mode, cc, const0_rtx);
-      emit_insn (gen_setbc_signed_<mode> (operands[0], eq, cc));
+      emit_insn (gen_setbc_cc_<mode> (operands[0], eq, cc));
       DONE;
     }
 
@@ -12700,7 +12699,7 @@
       rtx compare = gen_rtx_COMPARE (CCmode, operands[1], operands[2]);
       emit_insn (gen_rtx_SET (cc, compare));
       rtx ne = gen_rtx_fmt_ee (NE, <MODE>mode, cc, const0_rtx);
-      emit_insn (gen_setbc_signed_<mode> (operands[0], ne, cc));
+      emit_insn (gen_setbc_cc_<mode> (operands[0], ne, cc));
       DONE;
     }

                 reply	other threads:[~2022-10-25 16:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221025163404.CBB24385AE5D@sourceware.org \
    --to=segher@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).