From patchwork Wed Nov 22 03:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongyu Wang X-Patchwork-Id: 168082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp1074252vqb; Tue, 21 Nov 2023 19:31:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcKMdEf8GfkRINAMgaTcWqm61m00F/BKCDMs4EyKKD2ufyzVI2yEgyry+c4RDZOODAHo4H X-Received: by 2002:a05:620a:1b97:b0:779:efb4:73bb with SMTP id dv23-20020a05620a1b9700b00779efb473bbmr1166848qkb.41.1700623897624; Tue, 21 Nov 2023 19:31:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700623897; cv=pass; d=google.com; s=arc-20160816; b=Stle2rfSi7nISTcg3LypzVdQy+1XXg9su2xUYI+vUG17vaofJrtFClj7EcFZwUwI6i U9F61ZfP6qVGq8gxi6ZEE46iBne4oEkDgz3U0zu5GG8Ha8/nOpdkibtudwehVMRl/iik /ThgPTEdQAFeQapFWTWvESQbpHm8AxBnU+8H8lpVrOWYn9ykr5k8IOltheVa7u2gnCEe R6yjLOEMrBACJqynNHedMSh8JvFTn4BrmkvMc2pkTGHuL2hsGeUn8Ydzc0gnt4EOC230 uNIrT6cMClDxvDd4a/B2Ll0MTeAqKsWeco8F6eXZovqSrQxLqBwyMeiahMD4M1F5ZkZc BznQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=sFGhkHLfkCT178fEK7OyxXp5P0VRYvN2cNXRkftV6h8=; fh=teAkCfp8/+jdw+9cwKK1bUX4dNiR8PY1y3wBzpNarjY=; b=RiAmPE7p9RjJ7npjI8kIWMuNdCnUIJWif38pwGzHP4NebCTiSuNNPIfMwbz1tzv6ze 0gZ407Kg4ihXvPbKXmkaI0sPnvSTPIy5Ath07n1AHvJ6+6xOlWZr7JEy8QmkYiC+sFNg nFsbLvj8/P8TrEWbVyiPiczJaVHSlMK1rwjSAEZFQRwVTem+gkJxMg62RaNrSum21mZp NoaFTpPbrfC0tM9d8njsvSypTGjn2wE24d10J+jOtlVIhfooi2avA8PYHlEehoneE2uE FNz0wd6+aztf7NNS1zj4pAMBSa8MqeQAr8O0EJCZ0+XwXEcnQUctoNOk41RZPonyyBso OBig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=djUOAUwj; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v20-20020a05620a441400b0076eed07c2adsi10293466qkp.237.2023.11.21.19.31.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 19:31:37 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=djUOAUwj; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 677E8385840C for ; Wed, 22 Nov 2023 03:31:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by sourceware.org (Postfix) with ESMTPS id F14CF3858D33 for ; Wed, 22 Nov 2023 03:31:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F14CF3858D33 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F14CF3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=198.175.65.10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700623875; cv=none; b=AmrbpagJpetvuFlfq7RnPZajdAKGO+bkEdm0rp0ZBBC4HeaySNzvv6QOBqKuNme+DsiB8QOC2I1hP+cCOmN39jsWtUbIvV3ss1ccPQurF4+ZHleQcFpN/GDpAF12AOsW3FDoxsjv3wWc8FFr98618fecK/DVP6gAtjpF3mgFVVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700623875; c=relaxed/simple; bh=/ebBWh8ajrL2SBk7FBcdNhaUYS/DzgKyxGPwF6Ncj2k=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ot0cmRXDfBATes+daq7/H1PdfyiMCw6MEw6B+7vyuTHQjhpVwe/OaFDW/sEdkcTaGrKWYp4tzCV/8H+dCioEcnn9l9ED9opOZ5zi4cHy3Gst2ljoMu5Fmy+aIJ/maMQTW9zeLWoYE7BPvBLwi+JAzqDXK/lehUrzEBC5EgtcqhI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700623873; x=1732159873; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/ebBWh8ajrL2SBk7FBcdNhaUYS/DzgKyxGPwF6Ncj2k=; b=djUOAUwj+riSIvZN/9zkH4dQeT4E8YbHxhjVtCDPS8rFjnbQX3BBHQn6 DJ5oV79CvU6K/T4UAG99O8YFcKmYLgATDg6hiH0HsRiYDLhyh8sK6MkqC L9yJwq/19dKUM2p4d0kPYrggawDhHn8QnbysI57sNrU6EM17MjLU5ETI9 FXXGWULGD5JFzp/08nN+nAsWFIZKZ89MSVGGXsDf+/DoXcf1F2pJxbJqt lHOsReYIByF90iGlEYJ/LyrbwujvQq6oAKQInv4/8SUJphovAb/wkmyfs h3AeCA3gQOWR7t6CMwMUTxQxKFdQo8dBmVNCrHxodmoQzUuTIG22DuKHo Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="5169861" X-IronPort-AV: E=Sophos;i="6.04,217,1695711600"; d="scan'208";a="5169861" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2023 19:31:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10901"; a="890434419" X-IronPort-AV: E=Sophos;i="6.04,217,1695711600"; d="scan'208";a="890434419" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orsmga004.jf.intel.com with ESMTP; 21 Nov 2023 19:31:09 -0800 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id D5338100569E; Wed, 22 Nov 2023 11:31:08 +0800 (CST) From: Hongyu Wang To: gcc-patches@gcc.gnu.org Cc: hongtao.liu@intel.com Subject: [PATCH] [APX PUSH2POP2] Adjust operand order for PUSH2POP2 Date: Wed, 22 Nov 2023 11:31:08 +0800 Message-Id: <20231122033108.3654950-1-hongyu.wang@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783233404164650722 X-GMAIL-MSGID: 1783233404164650722 Hi, 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. Bootstrapped/regtested on x86-64-linux-pc-gnu{-m32,} Ok for master? 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. --- gcc/config/i386/i386.md | 8 ++++---- gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c | 8 ++++---- .../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 @@ (define_insn "push2_di" (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 @@ (define_insn "pop2_di" (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 @@ (define_insn "push2p_di" 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 @@ (define_insn "pop2p_di" (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 } } */