public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] Add constraints to new andn<dwi>_doubleword_bmi pattern in i386.md.
@ 2022-07-01 10:17 Roger Sayle
  2022-07-01 11:18 ` Uros Bizjak
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Sayle @ 2022-07-01 10:17 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]


Many thanks to Uros for spotting that I'd forgotten to add constraints
to the new define_insn_and_split *andn<dwi>_doubleword_bmi when moving it
from pre-reload to post-reload.  I've pushed this obvious fix after a
make bootstrap on x86_64-pc-linux-gnu.  Sorry for the inconvenience to
anyone building the tree with a non-default architecture that enables
BMI.


2022-07-01  Roger Sayle  <roger@nextmovesoftware.com>
            Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog
        * config/i386/i386.md (*andn<mode>3_doubleword_bmi): Add constraints
        to post-reload define_insn_and_split.


Roger
--


[-- Attachment #2: patchdw3.txt --]
[-- Type: text/plain, Size: 669 bytes --]

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3401814..352a21c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -10405,10 +10405,10 @@
 })
 
 (define_insn_and_split "*andn<mode>3_doubleword_bmi"
-  [(set (match_operand:<DWI> 0 "register_operand")
+  [(set (match_operand:<DWI> 0 "register_operand" "=r")
 	(and:<DWI>
-	  (not:<DWI> (match_operand:<DWI> 1 "register_operand"))
-	  (match_operand:<DWI> 2 "nonimmediate_operand")))
+	  (not:<DWI> (match_operand:<DWI> 1 "register_operand" "0"))
+	  (match_operand:<DWI> 2 "nonimmediate_operand" "ro")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_BMI"
   "#"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Committed] Add constraints to new andn<dwi>_doubleword_bmi pattern in i386.md.
  2022-07-01 10:17 [Committed] Add constraints to new andn<dwi>_doubleword_bmi pattern in i386.md Roger Sayle
@ 2022-07-01 11:18 ` Uros Bizjak
  2022-07-01 15:28   ` [PATCH] i386: Use "r" constraint in *andn<mode>3_doubleword_bmi Uros Bizjak
  0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2022-07-01 11:18 UTC (permalink / raw)
  To: Roger Sayle; +Cc: gcc-patches

On Fri, Jul 1, 2022 at 12:17 PM Roger Sayle <roger@nextmovesoftware.com> wrote:
>
>
> Many thanks to Uros for spotting that I'd forgotten to add constraints
> to the new define_insn_and_split *andn<dwi>_doubleword_bmi when moving it
> from pre-reload to post-reload.  I've pushed this obvious fix after a
> make bootstrap on x86_64-pc-linux-gnu.  Sorry for the inconvenience to
> anyone building the tree with a non-default architecture that enables
> BMI.
>
>
> 2022-07-01  Roger Sayle  <roger@nextmovesoftware.com>
>             Uroš Bizjak  <ubizjak@gmail.com>
>
> gcc/ChangeLog
>         * config/i386/i386.md (*andn<mode>3_doubleword_bmi): Add constraints
>         to post-reload define_insn_and_split.

-  (not:<DWI> (match_operand:<DWI> 1 "register_operand"))
-  (match_operand:<DWI> 2 "nonimmediate_operand")))
+  (not:<DWI> (match_operand:<DWI> 1 "register_operand" "0"))

This constraint can be "r", ANDN is not destructive.

+  (match_operand:<DWI> 2 "nonimmediate_operand" "ro")))

Uros.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] i386: Use "r" constraint in *andn<mode>3_doubleword_bmi
  2022-07-01 11:18 ` Uros Bizjak
@ 2022-07-01 15:28   ` Uros Bizjak
  0 siblings, 0 replies; 3+ messages in thread
From: Uros Bizjak @ 2022-07-01 15:28 UTC (permalink / raw)
  To: Roger Sayle; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

ANDN is non-destructive, so use "r" instead of "0" for its operand 1 constraint.

2022-07-01  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:

    * config/i386/i386.md (*andn<mode>3_doubleword_bmi):
    Use "r" constraint for operand 1.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Pushed to master.

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 557 bytes --]

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 352a21c585c..20c3b9a4122 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -10407,7 +10407,7 @@ (define_split
 (define_insn_and_split "*andn<mode>3_doubleword_bmi"
   [(set (match_operand:<DWI> 0 "register_operand" "=r")
 	(and:<DWI>
-	  (not:<DWI> (match_operand:<DWI> 1 "register_operand" "0"))
+	  (not:<DWI> (match_operand:<DWI> 1 "register_operand" "r"))
 	  (match_operand:<DWI> 2 "nonimmediate_operand" "ro")))
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_BMI"

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-01 15:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-01 10:17 [Committed] Add constraints to new andn<dwi>_doubleword_bmi pattern in i386.md Roger Sayle
2022-07-01 11:18 ` Uros Bizjak
2022-07-01 15:28   ` [PATCH] i386: Use "r" constraint in *andn<mode>3_doubleword_bmi Uros Bizjak

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).