[gcc/devel/gccgo] i386: Use int_nonimmediate_operand more

Ian Lance Taylor ian@gcc.gnu.org
Sun Jul 12 17:48:31 GMT 2020


https://gcc.gnu.org/g:59e4474a22cbf23b777f244d2a28d1ee4b54d3ce

commit 59e4474a22cbf23b777f244d2a28d1ee4b54d3ce
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Tue May 5 11:31:52 2020 +0200

    i386: Use int_nonimmediate_operand more
    
    Pattern explosing and manual mode checks can be avoided by using
    int_nonimmediate_operand special predicate.
    
    While there, rewrite *x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>
    to a combine pass splitter.
    
            * config/i386/i386.md (*testqi_ext_3): Use
            int_nonimmediate_operand instead of manual mode checks.
            (*x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>):
            Use int_nonimmediate_operand predicate.  Rewrite
            define_insn_and_split pattern to a combine pass splitter.

Diff:
---
 gcc/ChangeLog           |  8 ++++++++
 gcc/config/i386/i386.md | 23 ++++++++---------------
 2 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aa904548808..8c46dcd92c3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2020-05-05  Uroš Bizjak  <ubizjak@gmail.com>
+
+	* config/i386/i386.md (*testqi_ext_3): Use
+	int_nonimmediate_operand instead of manual mode checks.
+	(*x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>):
+	Use int_nonimmediate_operand predicate.  Rewrite
+	define_insn_and_split pattern to a combine pass splitter.
+
 2020-05-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* configure.ac <i[34567]86-*-*>: Add --32 to tls_as_opt on Solaris.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 76c00867231..5cad481fd9f 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -8714,16 +8714,12 @@
   [(set (match_operand 0 "flags_reg_operand")
         (match_operator 1 "compare_operator"
 	  [(zero_extract:SWI248
-	     (match_operand 2 "nonimmediate_operand" "rm")
+	     (match_operand 2 "int_nonimmediate_operand" "rm")
 	     (match_operand 3 "const_int_operand" "n")
 	     (match_operand 4 "const_int_operand" "n"))
 	   (const_int 0)]))]
-  "((TARGET_64BIT && GET_MODE (operands[2]) == DImode)
-    || GET_MODE (operands[2]) == SImode
-    || GET_MODE (operands[2]) == HImode
-    || GET_MODE (operands[2]) == QImode)
-   /* Ensure that resulting mask is zero or sign extended operand.  */
-   && INTVAL (operands[4]) >= 0
+  "/* Ensure that resulting mask is zero or sign extended operand.  */
+   INTVAL (operands[4]) >= 0
    && ((INTVAL (operands[3]) > 0
 	&& INTVAL (operands[3]) + INTVAL (operands[4]) <= 32)
        || (<MODE>mode == DImode
@@ -18038,18 +18034,15 @@
    (set_attr "mode" "<MODE>")
    (set_attr "length_immediate" "0")])
 
-(define_insn_and_split "*x86_mov<SWI48:mode>cc_0_m1_neg_leu<SWI:mode>"
-  [(set (match_operand:SWI48 0 "register_operand" "=r")
+(define_split
+  [(set (match_operand:SWI48 0 "register_operand")
 	(neg:SWI48
 	  (leu:SWI48
-	    (match_operand:SWI 1 "nonimmediate_operand" "<SWI:r>m")
-	    (match_operand:SWI 2 "<SWI:immediate_operand>" "<SWI:i>"))))
-   (clobber (reg:CC FLAGS_REG))]
-  "CONST_INT_P (operands[2])
+	    (match_operand 1 "int_nonimmediate_operand")
+	    (match_operand 2 "const_int_operand"))))]
+  "x86_64_immediate_operand (operands[2], VOIDmode)
    && INTVAL (operands[2]) != -1
    && INTVAL (operands[2]) != 2147483647"
-  "#"
-  ""
   [(set (reg:CC FLAGS_REG) (compare:CC (match_dup 1) (match_dup 2)))
    (parallel [(set (match_dup 0)
 		   (neg:SWI48 (ltu:SWI48 (reg:CC FLAGS_REG) (const_int 0))))


More information about the Gcc-cvs mailing list