public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Hongyu Wang <hongyuw@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r14-5749] [APX PUSH2POP2] Adjust operand order for PUSH2POP2
Date: Wed, 22 Nov 2023 07:40:55 +0000 (GMT)	[thread overview]
Message-ID: <20231122074055.5A6FC38582A4@sourceware.org> (raw)

https://gcc.gnu.org/g:bd17d00a4bdee34876cc97bdf9a1f2316e0a6790

commit r14-5749-gbd17d00a4bdee34876cc97bdf9a1f2316e0a6790
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Fri Nov 17 15:30:16 2023 +0800

    [APX PUSH2POP2] Adjust operand order for PUSH2POP2
    
    The push2/pop2 operand order does not match the binutils implementation
    for AT&T syntax that it will first push operands[2] then operands[1].
    Correct it by reverse operand order for AT&T syntax.
    
    gcc/ChangeLog:
    
            * config/i386/i386.md (push2_di): Adjust operand order for AT&T
            syntax.
            (pop2_di): Likewise.
            (push2p_di): Likewise.
            (pop2p_di): Likewise.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/i386/apx-push2pop2-1.c: Adjust output scan.
            * gcc.target/i386/apx-push2pop2_force_drap-1.c: Likewise.

Diff:
---
 gcc/config/i386/i386.md                                    | 8 ++++----
 gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c            | 8 ++++----
 gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c | 8 ++++----
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 03e4ddd3037..99bb909b244 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3772,7 +3772,7 @@
 		    (match_operand:DI 2 "register_operand" "r")]
 		    UNSPEC_APXPUSH2))]
   "TARGET_APX_PUSH2POP2"
-  "push2\t%1, %2"
+  "push2\t{%2, %1|%1, %2}"
   [(set_attr "mode" "TI")
    (set_attr "type" "multi")
    (set_attr "prefix" "evex")])
@@ -3784,7 +3784,7 @@
 	      (set (match_operand:DI 2 "register_operand" "=r")
 		   (unspec:DI [(const_int 0)] UNSPEC_APXPOP2_HIGH))])]
   "TARGET_APX_PUSH2POP2"
-  "pop2\t%0, %2"
+  "pop2\t{%2, %0|%0, %2}"
   [(set_attr "mode" "TI")
    (set_attr "prefix" "evex")])
 
@@ -3811,7 +3811,7 @@
 		    UNSPEC_APXPUSH2))
    (unspec:DI [(const_int 0)] UNSPEC_APX_PPX)]
   "TARGET_APX_PUSH2POP2 && TARGET_APX_PPX"
-  "push2p\t%1, %2"
+  "push2p\t{%2, %1|%1, %2}"
   [(set_attr "mode" "TI")
    (set_attr "type" "multi")
    (set_attr "prefix" "evex")])
@@ -3824,7 +3824,7 @@
 		   (unspec:DI [(const_int 0)] UNSPEC_APXPOP2_HIGH))
 	      (unspec:DI [(const_int 0)] UNSPEC_APX_PPX)])]
   "TARGET_APX_PUSH2POP2 && TARGET_APX_PPX"
-  "pop2p\t%0, %2"
+  "pop2p\t{%2, %0|%0, %2}"
   [(set_attr "mode" "TI")
    (set_attr "prefix" "evex")])
 
diff --git a/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c b/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c
index c53112758a5..d78c96d36a3 100644
--- a/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c
+++ b/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c
@@ -24,11 +24,11 @@ void foo ()
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 2 } } */
 /* { dg-final { scan-assembler-times "pushq\[^\n\r]*%r15(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 15, -16(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%r14\[^\n\r]*%r13\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%r13\[^\n\r]*%r14\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 32" 2 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 14, -24(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 13, -32(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%r12\[^\n\r]*%rbp\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%rbp\[^\n\r]*%r12\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 48" 2 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 12, -40(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 6, -48(?:\n|\[ \\t\]+#)" 1 } } */
@@ -36,10 +36,10 @@ void foo ()
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 56" 2 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 3, -56(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "popq\[^\n\r]*rbx(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%rbp\[^\n\r]*%r12\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%r12\[^\n\r]*%rbp\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 12(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 6(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%r13\[^\n\r]*%r14\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%r14\[^\n\r]*%r13\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 14(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 13(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "popq\[^\n\r]*%r15(?:\n|\[ \\t\]+#)" 1 } } */
diff --git a/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c b/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c
index 022113bb1e2..3cac7b10769 100644
--- a/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c
+++ b/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c
@@ -8,11 +8,11 @@
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 16" 2 } } */
 /* { dg-final { scan-assembler-times "pushq\[^\n\r]*%r15(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 15, -16(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%r14\[^\n\r]*%r13\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%r13\[^\n\r]*%r14\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 32" 2 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 14, -24(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 13, -32(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%r12\[^\n\r]*%rbp\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "push2\[\\t \]*\[^\n\r]*%rbp\[^\n\r]*%r12\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 48" 2 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 12, -40(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 6, -48(?:\n|\[ \\t\]+#)" 1 } } */
@@ -20,10 +20,10 @@
 /* { dg-final { scan-assembler-times ".cfi_def_cfa_offset 56" 2 } } */
 /* { dg-final { scan-assembler-times ".cfi_offset 3, -56(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "popq\[^\n\r]*rbx(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%rbp\[^\n\r]*%r12\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%r12\[^\n\r]*%rbp\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 12(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 6(?:\n|\[ \\t\]+#)" 1 } } */
-/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%r13\[^\n\r]*%r14\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
+/* { dg-final { scan-assembler-times "pop2\[\\t \]*\[^\n\r]*%r14\[^\n\r]*%r13\[^\n\r]*(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 14(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times ".cfi_restore 13(?:\n|\[ \\t\]+#)" 1 } } */
 /* { dg-final { scan-assembler-times "popq\[^\n\r]*%r15(?:\n|\[ \\t\]+#)" 1 } } */

                 reply	other threads:[~2023-11-22  7:40 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=20231122074055.5A6FC38582A4@sourceware.org \
    --to=hongyuw@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).