On Tue, Nov 14, 2023 at 6:37 PM Uros Bizjak <ubiz...@gmail.com> wrote:

>     PR target/78904
>
> gcc/ChangeLog:
>
>     * config/i386/i386.md (*addqi_ext<mode>_1_slp):
>     New define_insn_and_split pattern.
>     (*subqi_ext<mode>_1_slp): Ditto.
>     (*<any_logic:code>qi_ext<mode>_1_slp): Ditto.
>
> gcc/testsuite/ChangeLog:
>
>     * gcc.target/i386/pr78904-7.c: New test.
>     * gcc.target/i386/pr78904-7a.c: New test.
>     * gcc.target/i386/pr78904-7b.c: New test.
>
> Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Eh, I somehow managed to mix up patches. The attached patch is also
needed to avoid testsuite ICE in gcc.c-torture/execute/pr82524.c.

Will commit it later today.

Uros.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 6136e46b1bc..0a9d14e9c08 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -6626,7 +6626,7 @@ (define_insn_and_split "*addqi_ext<mode>_1_slp"
               (const_int 8)]) 0)
          (match_operand:QI 1 "nonimmediate_operand" "0,!Q")))
    (clobber (reg:CC FLAGS_REG))]
-  ""
+  "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
   "@
    add{b}\t{%h2, %0|%0, %h2}
    #"
@@ -6638,8 +6638,8 @@ (define_insn_and_split "*addqi_ext<mode>_1_slp"
           (plus:QI
             (subreg:QI
               (match_op_dup 3
-                [(match_dup 0) (const_int 8) (const_int 8)]) 0)
-          (match_dup 1)))
+                [(match_dup 2) (const_int 8) (const_int 8)]) 0)
+          (match_dup 0)))
       (clobber (reg:CC FLAGS_REG))])]
   ""
   [(set_attr "type" "alu")
@@ -7669,7 +7669,7 @@ (define_insn_and_split "*subqi_ext<mode>_1_slp"
               (const_int 8)
               (const_int 8)]) 0)))
    (clobber (reg:CC FLAGS_REG))]
-  ""
+  "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
   "@
    sub{b}\t{%h2, %0|%0, %h2}
    #"
@@ -7679,10 +7679,10 @@ (define_insn_and_split "*subqi_ext<mode>_1_slp"
    (parallel
      [(set (strict_low_part (match_dup 0))
           (minus:QI
-          (match_dup 1)
+            (match_dup 0)
             (subreg:QI
               (match_op_dup 3
-                [(match_dup 0) (const_int 8) (const_int 8)]) 0)))
+                [(match_dup 2) (const_int 8) (const_int 8)]) 0)))
       (clobber (reg:CC FLAGS_REG))])]
   ""
   [(set_attr "type" "alu")
@@ -11494,7 +11494,7 @@ (define_insn_and_split "*<code>qi_ext<mode>_1_slp"
               (const_int 8)]) 0)
          (match_operand:QI 1 "nonimmediate_operand" "0,!Q")))
    (clobber (reg:CC FLAGS_REG))]
-  ""
+  "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
   "@
    <logic>{b}\t{%h2, %0|%0, %h2}
    #"
@@ -11504,10 +11504,10 @@ (define_insn_and_split "*<code>qi_ext<mode>_1_slp"
    (parallel
      [(set (strict_low_part (match_dup 0))
           (any_logic:QI
-          (match_dup 1)
             (subreg:QI
               (match_op_dup 3
-                [(match_dup 0) (const_int 8) (const_int 8)]) 0)))
+                [(match_dup 2) (const_int 8) (const_int 8)]) 0)))
+          (match_dup 0)
       (clobber (reg:CC FLAGS_REG))])]
   ""
   [(set_attr "type" "alu")

Reply via email to