From patchwork Wed Apr 19 16:10:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 85490 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp503041vqo; Wed, 19 Apr 2023 09:11:29 -0700 (PDT) X-Google-Smtp-Source: AKy350b8XghE2ICvlQoMZGMSUMshqmliVTgS4NUbHf0bv4cp+UGYhdZ2w4t9L476y2F+rDTRkIhN X-Received: by 2002:a17:906:1c49:b0:94e:bcb6:5f31 with SMTP id l9-20020a1709061c4900b0094ebcb65f31mr2882897ejg.20.1681920689670; Wed, 19 Apr 2023 09:11:29 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id fp7-20020a1709069e0700b0094ef518c152si7173743ejc.524.2023.04.19.09.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 09:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=UouLnqwi; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84BB43858C20 for ; Wed, 19 Apr 2023 16:11:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84BB43858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681920688; bh=Lw/ouc/+bz9QBv9rATMnn00PtLoe9bolHwfQreTCNWI=; h=Date:To:CC:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=UouLnqwiZfz29QXc0TV5POYJJ+yfZ5SPDnw4PuD0Kv4A8QLBNoyfo7CjosoC7lEpY 7I1bnGK/KEwRzg+qkCip2pjXU/y7dHOiww1U5nb9IgIU+zSslzB1aFeynq+smsaUwZ nQcyDyf5HbQZW7Mjs/u/lC++x2uuOTBeUFTASzyg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2060.outbound.protection.outlook.com [40.107.104.60]) by sourceware.org (Postfix) with ESMTPS id 1505B3858D33 for ; Wed, 19 Apr 2023 16:10:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1505B3858D33 Received: from AM6P193CA0070.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::47) by PAWPR08MB9097.eurprd08.prod.outlook.com (2603:10a6:102:330::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Wed, 19 Apr 2023 16:10:37 +0000 Received: from AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8e:cafe::73) by AM6P193CA0070.outlook.office365.com (2603:10a6:209:8e::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.20 via Frontend Transport; Wed, 19 Apr 2023 16:10:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT047.mail.protection.outlook.com (100.127.140.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.23 via Frontend Transport; Wed, 19 Apr 2023 16:10:37 +0000 Received: ("Tessian outbound 99a3040377ca:v136"); Wed, 19 Apr 2023 16:10:37 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fd60ea3db0eb41e6 X-CR-MTA-TID: 64aa7808 Received: from 026ae0a0d4be.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2F054F12-4F85-482B-B0A9-486F0962C900.1; Wed, 19 Apr 2023 16:10:29 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 026ae0a0d4be.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 19 Apr 2023 16:10:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iWtcGqmrojNAdXiQaD32GuiwI5uftJAZMp48o/Xbynv1T1GA7V/DUDCaVm91mgV6QGlzu0HPi3oomhrO8darxBBBeVqxnIaYojE+QxthyQyJrBdwQUpSjQzQvj6JBrauMTIfZDu2HDel5HMd1wxttPDt9VHn+q9s8gzRkzvOjM8xGtYRYYQOSj2nkvPonhrGjqevWSBlWtosKjuGRsFEBnE3XQ4ilRizQiANVPCNQHvzfJF26ZgCe0PZNnPPcu3VUs+JaHuAp88RbfNWfOXbtNofhp2JEAcObFWSGGMGDu0oQGaFB0sWfGQd9iJImC/Iw7597WCbI30CNtQ7T0nLcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lw/ouc/+bz9QBv9rATMnn00PtLoe9bolHwfQreTCNWI=; b=fYe0XaKwo37qxoEayRRKrT6JLnLstQHBO5qGZ/MjdunVbk2UCWybRtFQMjKQPGnBDjJqEi81GtB4U6NOFB983D5Wain0GuSD2FsFm4vNy+IRnrOIHv5ZcZqAhg4gnVsJs9sMjYIYyu4gHIdrCi4wOJF+rVuE8HbndgLmWMAiPaDaJQ8m6cnYJjeDhI2lrUMyXymVMIaJjq2aIxLCrlkM5rj+W+y/cfe3MX/0eZEtepI5nY1RBLS4yDZU1dInja+FwddrJ7ewgssuqVc+I+jbWX7W/UKGw7TRDOTbm6C+dHllENGBQ+sfeUQG0E0J9JUDfUBkESzLobLzdI6YEQsR8w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from DB3PR06CA0026.eurprd06.prod.outlook.com (2603:10a6:8:1::39) by VI1PR08MB10244.eurprd08.prod.outlook.com (2603:10a6:800:1bd::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Wed, 19 Apr 2023 16:10:26 +0000 Received: from DBAEUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:8:1:cafe::ff) by DB3PR06CA0026.outlook.office365.com (2603:10a6:8:1::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.22 via Frontend Transport; Wed, 19 Apr 2023 16:10:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT017.mail.protection.outlook.com (100.127.142.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6319.22 via Frontend Transport; Wed, 19 Apr 2023 16:10:26 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 19 Apr 2023 16:10:24 +0000 Received: from e125768 (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Wed, 19 Apr 2023 16:10:24 +0000 Date: Wed, 19 Apr 2023 17:10:24 +0100 Message-ID: To: CC: , , Subject: [PATCH v2] Leveraging the use of STP instruction for vec_duplicate MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT017:EE_|VI1PR08MB10244:EE_|AM7EUR03FT047:EE_|PAWPR08MB9097:EE_ X-MS-Office365-Filtering-Correlation-Id: 6470cb30-117f-4c46-dd71-08db40f09d02 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: DoioD2rohC9NzF5oXFSqQRj/0nTdKHvoD9SOe4DHzCvbLhl4oUJBXH28iwZFOmQEuhYbfJU7VKJ27rabs6hcTYmbGaridSnwW9T6103wx10jv03fYDqJSEhA4Fros7FCcEvlRdnakOcAQEdK//6xiOVeg/IlW7OlpOh+B2D8l3Mfg7mAsw+IhsNfJozeZlu/425+mE3CBiSeG7ldRpQ/M/Ie5Vw7JImAHlFoFlKcUJCR8VLzho3SXksQIZ+Bn+Mvw6bKMsh4GRxth9ro057iHeI2hNR2UjE3uCXusEXta+UQiZzcpoIOyU6B+L23EnPeIWgOk04fIEOkNnmFJVpcpaQdbIqdO12/4SCk4NimRMAoYVBSOsEKE2Ab3wb9hb1kyWIHzYph5VKpe8RZ7iKLLaQjxNgtk9kRVMpY1QAg2cJPoceXm73HpoEiYyJeJmV8J5wHcyZyNHE3EUmF0SXn0n80NJndiblT5lCfKbJkUG/v36hT0Qr1N7/kTW8UAxTlWKNKYdP4L78nnYFZrpxGOP5VmpuqtOtVpflzsQ26JAXYkWUxlMv9nH0ewe9dmiaNwsjA0/AeN2l5xmEqnewouvbrujrFcqVfFYmK8nVABk+/dm3R9YUZVj++ary7Ts7YQc8Wxzfrn9/SVSbUW3sH5GGL+fv0wNGULsrXtvi2bMqU297qVa7iltKk12HDW9BB X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(136003)(396003)(39860400002)(376002)(346002)(451199021)(46966006)(36840700001)(426003)(83380400001)(36756003)(336012)(26005)(86362001)(47076005)(82310400005)(356005)(186003)(2906002)(84970400001)(2616005)(5660300002)(36860700001)(8676002)(8936002)(478600001)(4326008)(54906003)(81166007)(41300700001)(82740400003)(316002)(70586007)(40480700001)(70206006)(6916009)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10244 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 447fc456-c253-4f56-1320-08db40f09674 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YvjX0paKD0UT/a5tjAE91Fq3ITVxR2GL0dFhqd147WCPPWdRncEoKdOqqXSdBD3eIai+KCGTM05UeceZlNTH29Eh5jbdRB0/Cf+zNpTNoMUFOhfS7bNtdY2VWzedJ4wDL3IwBx6dX/r9SlgN9jYACVsiXLA8F79NH32EdiCWbUDz9z3qjixJ2tDSuPIeQrlbaApdJ5MSnQH+D/brU5B0D7gb58aRH7tWnhTUi/Yby8ztO6YEj4BR9ftacB3uvm5OPhZbUebDU3EJNfd1j/HcRmI8asWl7WOV/tnVTd8CYo9hnqoHfKqpM6rDvdJyhMNTRXm7gghTnNdm+Eqhph1rrxmINxPUr099oTLIl5Ty+jrAYAK9PPeIIhISRR3sr3du3PxvxJgW5OFRb0zruMsSEtbD5ePTGjO7LOj0/FNh0Lj3boYMnsbLN0mkL1eJbCBAyGBgUBoQeqA/Ozo95j6WU68entF88RNL3xoVKetf29EIESRaC/s0hhl6z9U5Vv2gzTaBCzH8iWJ9pcL0g+BtomQAoN6z9O756xoL2ek8K/XXP15sGAc1Ic7+jppJEu+T3i/0ppArx3WZ9Kfct5AMMtsP5frCMC/Kw0omvW5RLIdeFzfWUNQ4Asl4uD66ZVzyaFdsQq/NpwokQvY1b9ygAxEyenXDS5RTDg6SD0Bu5lpy0GjdG+mh4jsFf5Ro648A X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230028)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199021)(46966006)(36840700001)(40470700004)(36756003)(4326008)(54906003)(316002)(6916009)(70586007)(70206006)(41300700001)(478600001)(5660300002)(8936002)(82310400005)(8676002)(2906002)(40480700001)(82740400003)(86362001)(426003)(81166007)(336012)(2616005)(40460700003)(26005)(36860700001)(47076005)(83380400001)(186003)(84970400001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 16:10:37.2971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6470cb30-117f-4c46-dd71-08db40f09d02 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT047.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9097 X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Victor L. Do Nascimento via Gcc-patches" From: Victor Do Nascimento Reply-To: "Victor L. Do Nascimento" Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763621668781460262?= X-GMAIL-MSGID: =?utf-8?q?1763621668781460262?= The backend pattern for storing a pair of identical values in 32 and 64-bit modes with the machine instruction STP was missing, and multiple instructions were needed to reproduce this behavior as a result of failed RTL pattern match in the combine pass. For the test case: typedef long long v2di __attribute__((vector_size (16))); typedef int v2si __attribute__((vector_size (8))); void foo (v2di *x, long long a) { v2di tmp = {a, a}; *x = tmp; } void foo2 (v2si *x, int a) { v2si tmp = {a, a}; *x = tmp; } at -O2 on aarch64 gives: foo stp x1, x1, [x0] ret foo2: stp w1, w1, [x0] ret instead of: foo: dup v0.2d, x1 str q0, [x0] ret foo2: dup v0.2s, w1 str d0, [x0] ret Bootstrapped and regtested on aarch64-none-linux-gnu. Ok to install? gcc/ * config/aarch64/aarch64-simd.md(aarch64_simd_stp): New. * config/aarch64/constraints.md: Make "Umn" relaxed memory constraint. * config/aarch64/iterators.md(ldpstp_vel_sz): New. gcc/testsuite/ * gcc.target/aarch64/stp_vec_dup_32_64-1.c: --- gcc/config/aarch64/aarch64-simd.md | 10 ++++ gcc/config/aarch64/constraints.md | 2 +- gcc/config/aarch64/iterators.md | 3 + .../gcc.target/aarch64/stp_vec_dup_32_64-1.c | 57 +++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/stp_vec_dup_32_64-1.c diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index de2b7383749..8b5e67bd100 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -229,6 +229,16 @@ [(set_attr "type" "neon_stp")] ) +(define_insn "aarch64_simd_stp" + [(set (match_operand:VP_2E 0 "aarch64_mem_pair_lanes_operand" "=Umn,Umn") + (vec_duplicate:VP_2E (match_operand: 1 "register_operand" "w,r")))] + "TARGET_SIMD" + "@ + stp\\t%1, %1, %y0 + stp\\t%1, %1, %y0" + [(set_attr "type" "neon_stp, store_")] +) + (define_insn "load_pair" [(set (match_operand:VQ 0 "register_operand" "=w") (match_operand:VQ 1 "aarch64_mem_pair_operand" "Ump")) diff --git a/gcc/config/aarch64/constraints.md b/gcc/config/aarch64/constraints.md index 5b20abc27e5..6df1dbec2a8 100644 --- a/gcc/config/aarch64/constraints.md +++ b/gcc/config/aarch64/constraints.md @@ -287,7 +287,7 @@ ;; Used for storing or loading pairs in an AdvSIMD register using an STP/LDP ;; as a vector-concat. The address mode uses the same constraints as if it ;; were for a single value. -(define_memory_constraint "Umn" +(define_relaxed_memory_constraint "Umn" "@internal A memory address suitable for a load/store pair operation." (and (match_code "mem") diff --git a/gcc/config/aarch64/iterators.md b/gcc/config/aarch64/iterators.md index 6cbc97cc82c..980dacb8025 100644 --- a/gcc/config/aarch64/iterators.md +++ b/gcc/config/aarch64/iterators.md @@ -1017,6 +1017,9 @@ ;; Likewise for load/store pair. (define_mode_attr ldpstp_sz [(SI "8") (DI "16")]) +;; Size of element access for STP/LDP-generated vectors. +(define_mode_attr ldpstp_vel_sz [(V2SI "8") (V2SF "8") (V2DI "16") (V2DF "16")]) + ;; For inequal width int to float conversion (define_mode_attr w1 [(HF "w") (SF "w") (DF "x")]) (define_mode_attr w2 [(HF "x") (SF "x") (DF "w")]) diff --git a/gcc/testsuite/gcc.target/aarch64/stp_vec_dup_32_64-1.c b/gcc/testsuite/gcc.target/aarch64/stp_vec_dup_32_64-1.c new file mode 100644 index 00000000000..fc2c1ea39e0 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/stp_vec_dup_32_64-1.c @@ -0,0 +1,57 @@ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +typedef long long v2di __attribute__((vector_size (16))); +typedef int v2si __attribute__((vector_size (8))); + +#define TESTV2DI(lab, idx) \ + void \ + stpv2di_##lab (v2di *x, long long a) \ + { \ + v2di tmp = {a, a}; \ + x[idx] = tmp; \ + } + + +#define TESTV2SI(lab, idx) \ + void \ + stpv2si_##lab (v2si *x, int a) \ + { \ + v2si tmp = {a, a}; \ + x[idx] = tmp; \ + } \ + +/* Core test, no imm assembler offset: */ + +TESTV2SI(0, 0) +TESTV2DI(0, 0) +/* { dg-final { scan-assembler {\s+stp\t(w[0-9]+), \1, \[x[0-9]+\]} } } */ +/* { dg-final { scan-assembler {\s+stp\t(x[0-9]+), \1, \[x[0-9]+\]} } } */ + +/* Lower offset bounds: */ + +/* Vaid offsets: */ +TESTV2SI(1, -32) +TESTV2DI(1, -32) +/* { dg-final { scan-assembler {\s+stp\t(w[0-9]+), \1, \[x[0-9]+, -256\]} } } */ +/* { dg-final { scan-assembler {\s+stp\t(x[0-9]+), \1, \[x[0-9]+, -512\]} } } */ +/* Invalid offsets: */ +TESTV2SI(2, -33) +TESTV2DI(2, -33) +/* { dg-final { scan-assembler-not {\s+stp\t(w[0-9]+), \1, \[x[0-9]+, -264\]} } } */ +/* { dg-final { scan-assembler-not {\s+stp\t(x[0-9]+), \1, \[x[0-9]+, -528\]} } } */ + +/* Upper offset bounds: */ + +/* Valid offsets: */ +TESTV2SI(3, 31) +TESTV2DI(3, 31) +/* { dg-final { scan-assembler {\s+stp\t(w[0-9]+), \1, \[x[0-9]+, 248\]} } } */ +/* { dg-final { scan-assembler {\s+stp\t(x[0-9]+), \1, \[x[0-9]+, 496\]} } } */ +/* Invalid offsets: */ +TESTV2SI(4, 32) +TESTV2DI(4, 32) +/* { dg-final { scan-assembler-not {\s+stp\t(w[0-9]+), \1, \[x[0-9]+, 256\]} } } */ +/* { dg-final { scan-assembler-not {\s+stp\t(x[0-9]+), \1, \[x[0-9]+, 512\]} } } */ + +