From patchwork Tue Apr 18 13:45:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 84858 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2867517vqo; Tue, 18 Apr 2023 06:52:57 -0700 (PDT) X-Google-Smtp-Source: AKy350ZG9EmRZ6gy6evYn9qn2mEdu+2Q7JtXetKkwO95YxTi5m0+zAtmVYcZ2ocAL4nFwpzJDzsf X-Received: by 2002:aa7:d5d2:0:b0:4fa:4a27:adba with SMTP id d18-20020aa7d5d2000000b004fa4a27adbamr2183161eds.22.1681825977136; Tue, 18 Apr 2023 06:52:57 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d8-20020aa7d688000000b00506c408c1a4si214579edr.687.2023.04.18.06.52.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Apr 2023 06:52:57 -0700 (PDT) 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=@gcc.gnu.org header.s=default header.b=oA3VZlIK; arc=fail (signature failed); 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=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB8C9388301D for ; Tue, 18 Apr 2023 13:50:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB8C9388301D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681825807; bh=hS/lQQRYOTONRibJi87yGr16nw2VLTdVypGJUMIOFDI=; h=To:CC:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=oA3VZlIKoUNBLkLuHsiHnhcgPcdqytg9Th8p++XLEmqTwz6m2VdhgN3uZZ3irElkd FhRMhrTwXCKlQ7ECFh3Vg6hPLUY0SrEqdPYa+8haeQyC+oF7tOhQUl6OOnHq9wOL18 InlnND65O2A5Q0uoEm4gs7Dvu4cSDjXSlE5c1Db8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2068.outbound.protection.outlook.com [40.107.21.68]) by sourceware.org (Postfix) with ESMTPS id 4D58E385771A for ; Tue, 18 Apr 2023 13:47:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4D58E385771A Received: from DUZPR01CA0093.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bb::21) by DU0PR08MB9821.eurprd08.prod.outlook.com (2603:10a6:10:446::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 13:47:22 +0000 Received: from DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4bb:cafe::b0) by DUZPR01CA0093.outlook.office365.com (2603:10a6:10:4bb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.47 via Frontend Transport; Tue, 18 Apr 2023 13:47:22 +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 DBAEUR03FT064.mail.protection.outlook.com (100.127.143.3) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6319.20 via Frontend Transport; Tue, 18 Apr 2023 13:47:22 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Tue, 18 Apr 2023 13:47:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a7e14d427514fdd7 X-CR-MTA-TID: 64aa7808 Received: from 936fb613a4f7.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CD20853D-8877-4B4F-8582-97C99DB7D9BF.1; Tue, 18 Apr 2023 13:47:16 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 936fb613a4f7.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 18 Apr 2023 13:47:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m/jdB0rhoNKs2iCYFpgj3+yhvLJ341RfXM5ELG69je4rJBviEd/ooF0v2sb5dzKxoogIIh4l3js3HxgxCqXslxFWazfpmrFO86TkJvBWjHLILCQbuhUp4u5Xhf122iZlq1a846Ye7Hi1UwJIzrQgF/+dpoo1KgaDcpatynrRd5IOwYYD9y58l2bNYBKqnd04qyqliJzYRMyPcMMHVXG60J18S5qTUNnoMApxUyaUHgDon8e+a0CVTKrZ3ut0Kb/Pe9JFrgJiZYggkWqjh6UiShUbiMcMO7R5quoJa/Ropze0QZcCCeMkxR5mNyL1d2fbrIZTYGrHlK94v4ir+GmwEQ== 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=hS/lQQRYOTONRibJi87yGr16nw2VLTdVypGJUMIOFDI=; b=flRrh/eCSP/khIadjtoCS8SikkAroxDtdFdA18GsNRQljIWYT5ZuW1mip8udhRqJNht6jUpklQZsm3hclnJwNICJhV3szj8BdcpeH/k4HNHNczkHoyy+hxzpdAhKxwprfgz3V4/N0MX+w2Uxrjk5G4SHADYLkKk9XS5Id7BaoG5u+HnBLcCbH43hAHKZpECd45QNCt+ymDy5EUbSZ1d4BvUAbz7aTHwmi2ETXlBkgD4kEfSqRc23i+4+9VYNDxMwSIoTxlDZusDCfqtSObBpFUweDUEoekELfxwotOQWXq1hvX5dYS26AtB6azAyLXG4BB9D0LiweuGmlJNOKBfZPQ== 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 AM5PR0502CA0020.eurprd05.prod.outlook.com (2603:10a6:203:91::30) by PAVPR08MB8845.eurprd08.prod.outlook.com (2603:10a6:102:2ff::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Tue, 18 Apr 2023 13:47:13 +0000 Received: from AM7EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:91:cafe::26) by AM5PR0502CA0020.outlook.office365.com (2603:10a6:203:91::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.46 via Frontend Transport; Tue, 18 Apr 2023 13:47:13 +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 AM7EUR03FT062.mail.protection.outlook.com (100.127.140.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6319.16 via Frontend Transport; Tue, 18 Apr 2023 13:47:13 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Tue, 18 Apr 2023 13:47:12 +0000 Received: from e129018.arm.com (10.57.54.117) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Tue, 18 Apr 2023 13:47:12 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 07/22] arm: [MVE intrinsics] factorize vadd vsubq vmulq Date: Tue, 18 Apr 2023 15:45:53 +0200 Message-ID: <20230418134608.244751-8-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230418134608.244751-1-christophe.lyon@arm.com> References: <20230418134608.244751-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT062:EE_|PAVPR08MB8845:EE_|DBAEUR03FT064:EE_|DU0PR08MB9821:EE_ X-MS-Office365-Filtering-Correlation-Id: ef3a8238-d8c6-4768-8d91-08db40136f9c 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: WynJWeCDaNcMW9uHQjaHaQw8m9r5vKIbQw939OAk4VwGwAg4RKtnVsGyRuXuSF2pVBJKu5E6I9/pPqpKZjY1AUiSinFk/i4a8MCwF0PSSwfU2k9L9Wylxh5ct00KTegmsELFYL/6n/lqiIz73zQipx2g03cEXn0v5xPyg8NsPU4MAlkq2AnHSlbUHzF7bwx8krr7vkefm7eWpPxjYEOVixoQPxw6dwNe4A8Ub5WxcqUGuAkX7FksOCQwW2buR7ozlUV3FPdifqKu0tC0GhT/dgbnjbRb6kjL/ikfzxq2pa1bXkzybf2JRK9yD3GyhwMo/7bdq0KxfYGQ64V6ZpU0wIt/UJr6Ni164Irjmoqn+f6P7dYzAt6H92EJmXhwiPBcnuVZUUECfXsHRfNK0ndKfKplQuZphH7TKXP2nclSr815UFmjTl99j5gcro0DB/USKth7D5oALc1D/AVqizuEXv/DFGKKgrmQgMeaHcudGSODSC9jigIXBiXpNwv/767OqBuz0IV9nTSQm41pGDLPdHq6OJFYAjY5rVsqkemBVjCpoEnDoX6o6gyx4n0vgnD3/lOSDrQZoXjc+hsEMNasCI2lK9ip3R+9CG/EfmFG5czSilQcGnsoMYJCAgpfk7GX5ss5U97X8LYaeojG0XAbQnxWsRBNB8uvo9LwKJm+PytyaxKsIdVdW3u3qBcfZTUAkIEU8kaQz0LGUB6JcH/i/Q== 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)(396003)(39860400002)(346002)(376002)(136003)(451199021)(46966006)(36840700001)(36860700001)(2616005)(40480700001)(47076005)(83380400001)(426003)(336012)(26005)(82310400005)(1076003)(186003)(86362001)(70586007)(4326008)(82740400003)(356005)(70206006)(2906002)(30864003)(8936002)(316002)(44832011)(41300700001)(81166007)(478600001)(110136005)(6636002)(6666004)(36756003)(5660300002)(7696005)(8676002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB8845 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4be710bd-1519-48f6-002d-08db40136a60 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NppmScn1Y4C1kaBsSJCpWWcHwUpzA2ZsV0dNCKmKWLwN3d+A8AVWLJpEQOmFQBVi6XU0JEHGJ9aKBOYE8LwgO29e7ZgI0dqQ0l7jYnidKNAX8JFmr9WVm9Q96cYMgwiEgxDy0b9wU/iiMie+PH6vcoEjhaa2fA8CqLeEWVvGpmQqip1RgcejCWmvbWRMZKaqRNJ6+e0abNOqDSov/8r6mbOANcseeT+vdvajdjADUrmvcShGnJxW4HWJjktPNQA++0bphBa4p3hc5lQY3RlWx6saZTsB+a6dAUyfPAv94bCmefVtHcJqslX9fJKOgLPdthycpq6I/JOfnE+IN0Z2JtSeJka+INvyc/Ll1mo8y8TBW3TEYrea1g4w5nI4NYyIwADeYvj5TQ1HYb2h5fzECJw1660vjOMm18Yy1ioDQjt5TuR0aqquCf2xNK68b98cOO6Q5H6RA5fm36LWVn4vA80Zs8gkKIBla+gkbT3HcN6j8gEywo+Ewr4DQ1Ms9ko2kSDUMeOWp1DGmHc/iPPJtb2Wi1Awsr0k8Mib1UIkRqg+ty6BLI2q8aM6zA+t7NCE24eDqnecLkp/8dTyVBPeI8uqfqtgKvOO74eGSuJwlNO/FOycj0MPm8DH6+LsYs79zhpnqQEwF/QsLRK6seoxDWV8MzK8NusYegjsC5Z35fpy3CY7fnKh1oL0F18isrQ+i7I5TEZYir+sXY6oSW6X0Q== 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)(136003)(346002)(376002)(39860400002)(396003)(451199021)(46966006)(36840700001)(40470700004)(1076003)(186003)(26005)(2616005)(40480700001)(110136005)(426003)(336012)(83380400001)(82310400005)(7696005)(36860700001)(47076005)(40460700003)(6666004)(36756003)(6636002)(41300700001)(316002)(44832011)(5660300002)(82740400003)(2906002)(30864003)(4326008)(478600001)(86362001)(8936002)(81166007)(8676002)(70586007)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Apr 2023 13:47:22.3988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef3a8238-d8c6-4768-8d91-08db40136f9c 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: DBAEUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9821 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: Christophe Lyon via Gcc-patches From: Christophe Lyon Reply-To: Christophe Lyon 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?1763522355537130494?= X-GMAIL-MSGID: =?utf-8?q?1763522355537130494?= In order to avoid using a huge switch when generating all the intrinsics (e.g. mve_vaddq_n_sv4si, ...), we want to generate a single function taking the builtin code as parameter (e.g. mve_q_n (VADDQ_S, ....) This is achieved by using the new mve_insn iterator. Having done that, it becomes easier to share similar patterns, to avoid useless/error-prone code duplication. 2022-09-08 Christophe Lyon gcc/ChangeLog: * config/arm/iterators.md (MVE_INT_BINARY_RTX, MVE_INT_M_BINARY) (MVE_INT_M_N_BINARY, MVE_INT_N_BINARY, MVE_FP_M_BINARY) (MVE_FP_M_N_BINARY, MVE_FP_N_BINARY, mve_addsubmul, mve_insn): New iterators. * config/arm/mve.md (mve_vsubq_n_f, mve_vaddq_n_f, mve_vmulq_n_f): Factorize into ... (@mve_q_n_f): ... this. (mve_vaddq_n_, mve_vmulq_n_) (mve_vsubq_n_): Factorize into ... (@mve_q_n_): ... this. (mve_vaddq, mve_vmulq, mve_vsubq): Factorize into ... (mve_q): ... this. (mve_vaddq_f, mve_vmulq_f, mve_vsubq_f): Factorize into ... (mve_q_f): ... this. (mve_vaddq_m_, mve_vmulq_m_) (mve_vsubq_m_): Factorize into ... (@mve_q_m_): ... this, (mve_vaddq_m_n_, mve_vmulq_m_n_) (mve_vsubq_m_n_): Factorize into ... (@mve_q_m_n_): ... this. (mve_vaddq_m_f, mve_vmulq_m_f, mve_vsubq_m_f): Factorize into ... (@mve_q_m_f): ... this. (mve_vaddq_m_n_f, mve_vmulq_m_n_f) (mve_vsubq_m_n_f): Factorize into ... (@mve_q_m_n_f): ... this. --- gcc/config/arm/iterators.md | 57 +++++++ gcc/config/arm/mve.md | 317 +++++------------------------------- 2 files changed, 99 insertions(+), 275 deletions(-) diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index 39895ad62aa..d3bef594775 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -330,6 +330,63 @@ (define_code_iterator FCVT [unsigned_float float]) ;; Saturating addition, subtraction (define_code_iterator SSPLUSMINUS [ss_plus ss_minus]) +;; MVE integer binary operations. +(define_code_iterator MVE_INT_BINARY_RTX [plus minus mult]) + +(define_int_iterator MVE_INT_M_BINARY [ + VADDQ_M_S VADDQ_M_U + VMULQ_M_S VMULQ_M_U + VSUBQ_M_S VSUBQ_M_U + ]) + +(define_int_iterator MVE_INT_M_N_BINARY [ + VADDQ_M_N_S VADDQ_M_N_U + VMULQ_M_N_S VMULQ_M_N_U + VSUBQ_M_N_S VSUBQ_M_N_U + ]) + +(define_int_iterator MVE_INT_N_BINARY [ + VADDQ_N_S VADDQ_N_U + VMULQ_N_S VMULQ_N_U + VSUBQ_N_S VSUBQ_N_U + ]) + +(define_int_iterator MVE_FP_M_BINARY [ + VADDQ_M_F + VMULQ_M_F + VSUBQ_M_F + ]) + +(define_int_iterator MVE_FP_M_N_BINARY [ + VADDQ_M_N_F + VMULQ_M_N_F + VSUBQ_M_N_F + ]) + +(define_int_iterator MVE_FP_N_BINARY [ + VADDQ_N_F + VMULQ_N_F + VSUBQ_N_F + ]) + +(define_code_attr mve_addsubmul [ + (minus "vsub") + (mult "vmul") + (plus "vadd") + ]) + +(define_int_attr mve_insn [ + (VADDQ_M_N_S "vadd") (VADDQ_M_N_U "vadd") (VADDQ_M_N_F "vadd") + (VADDQ_M_S "vadd") (VADDQ_M_U "vadd") (VADDQ_M_F "vadd") + (VADDQ_N_S "vadd") (VADDQ_N_U "vadd") (VADDQ_N_F "vadd") + (VMULQ_M_N_S "vmul") (VMULQ_M_N_U "vmul") (VMULQ_M_N_F "vmul") + (VMULQ_M_S "vmul") (VMULQ_M_U "vmul") (VMULQ_M_F "vmul") + (VMULQ_N_S "vmul") (VMULQ_N_U "vmul") (VMULQ_N_F "vmul") + (VSUBQ_M_N_S "vsub") (VSUBQ_M_N_U "vsub") (VSUBQ_M_N_F "vsub") + (VSUBQ_M_S "vsub") (VSUBQ_M_U "vsub") (VSUBQ_M_F "vsub") + (VSUBQ_N_S "vsub") (VSUBQ_N_U "vsub") (VSUBQ_N_F "vsub") + ]) + ;; plus and minus are the only SHIFTABLE_OPS for which Thumb2 allows ;; a stack pointer operand. The minus operation is a candidate for an rsub ;; and hence only plus is supported. diff --git a/gcc/config/arm/mve.md b/gcc/config/arm/mve.md index ab688396f97..5167fbc6add 100644 --- a/gcc/config/arm/mve.md +++ b/gcc/config/arm/mve.md @@ -668,21 +668,6 @@ (define_insn "mve_vpnotv16bi" [(set_attr "type" "mve_move") ]) -;; -;; [vsubq_n_f]) -;; -(define_insn "mve_vsubq_n_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "w") - (match_operand: 2 "s_register_operand" "r")] - VSUBQ_N_F)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vsub.f\t%q0, %q1, %2" - [(set_attr "type" "mve_move") -]) - ;; ;; [vbrsrq_n_f]) ;; @@ -871,16 +856,18 @@ (define_insn "mve_vabdq_" ;; ;; [vaddq_n_s, vaddq_n_u]) +;; [vsubq_n_s, vsubq_n_u]) +;; [vmulq_n_s, vmulq_n_u]) ;; -(define_insn "mve_vaddq_n_" +(define_insn "@mve_q_n_" [ (set (match_operand:MVE_2 0 "s_register_operand" "=w") (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "w") (match_operand: 2 "s_register_operand" "r")] - VADDQ_N)) + MVE_INT_N_BINARY)) ] "TARGET_HAVE_MVE" - "vadd.i%#\t%q0, %q1, %2" + ".i%#\t%q0, %q1, %2" [(set_attr "type" "mve_move") ]) @@ -1362,26 +1349,13 @@ (define_insn "mve_vmulltq_int_" ]) ;; -;; [vmulq_n_u, vmulq_n_s]) -;; -(define_insn "mve_vmulq_n_" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "w") - (match_operand: 2 "s_register_operand" "r")] - VMULQ_N)) - ] - "TARGET_HAVE_MVE" - "vmul.i%#\t%q0, %q1, %2" - [(set_attr "type" "mve_move") -]) - -;; +;; [vaddq_s, vaddq_u]) ;; [vmulq_u, vmulq_s]) +;; [vsubq_s, vsubq_u]) ;; (define_insn "mve_vmulq_" [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") + (set (match_operand:MVE_2 0 "s_register_operand" "=w") (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "w") (match_operand:MVE_2 2 "s_register_operand" "w")] VMULQ)) @@ -1391,14 +1365,14 @@ (define_insn "mve_vmulq_" [(set_attr "type" "mve_move") ]) -(define_insn "mve_vmulq" +(define_insn "mve_q" [ (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (mult:MVE_2 (match_operand:MVE_2 1 "s_register_operand" "w") - (match_operand:MVE_2 2 "s_register_operand" "w"))) + (MVE_INT_BINARY_RTX:MVE_2 (match_operand:MVE_2 1 "s_register_operand" "w") + (match_operand:MVE_2 2 "s_register_operand" "w"))) ] "TARGET_HAVE_MVE" - "vmul.i%#\t%q0, %q1, %q2" + ".i%#\t%q0, %q1, %q2" [(set_attr "type" "mve_move") ]) @@ -1768,21 +1742,6 @@ (define_insn "mve_vshlq_r_" [(set_attr "type" "mve_move") ]) -;; -;; [vsubq_n_s, vsubq_n_u]) -;; -(define_insn "mve_vsubq_n_" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "w") - (match_operand: 2 "s_register_operand" "r")] - VSUBQ_N)) - ] - "TARGET_HAVE_MVE" - "vsub.i%#\t%q0, %q1, %2" - [(set_attr "type" "mve_move") -]) - ;; ;; [vsubq_s, vsubq_u]) ;; @@ -1798,17 +1757,6 @@ (define_insn "mve_vsubq_" [(set_attr "type" "mve_move") ]) -(define_insn "mve_vsubq" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (minus:MVE_2 (match_operand:MVE_2 1 "s_register_operand" "w") - (match_operand:MVE_2 2 "s_register_operand" "w"))) - ] - "TARGET_HAVE_MVE" - "vsub.i%#\t%q0, %q1, %q2" - [(set_attr "type" "mve_move") -]) - ;; ;; [vabdq_f]) ;; @@ -1841,16 +1789,18 @@ (define_insn "mve_vaddlvaq_v4si" ;; ;; [vaddq_n_f]) +;; [vsubq_n_f]) +;; [vmulq_n_f]) ;; -(define_insn "mve_vaddq_n_f" +(define_insn "@mve_q_n_f" [ (set (match_operand:MVE_0 0 "s_register_operand" "=w") (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "w") (match_operand: 2 "s_register_operand" "r")] - VADDQ_N_F)) + MVE_FP_N_BINARY)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vadd.f%#\t%q0, %q1, %2" + ".f%#\t%q0, %q1, %2" [(set_attr "type" "mve_move") ]) @@ -2224,31 +2174,18 @@ (define_insn "mve_vmovntq_" ]) ;; +;; [vaddq_f]) ;; [vmulq_f]) +;; [vsubq_f]) ;; -(define_insn "mve_vmulq_f" +(define_insn "mve_q_f" [ (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (mult:MVE_0 (match_operand:MVE_0 1 "s_register_operand" "w") + (MVE_INT_BINARY_RTX:MVE_0 (match_operand:MVE_0 1 "s_register_operand" "w") (match_operand:MVE_0 2 "s_register_operand" "w"))) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vmul.f%# %q0, %q1, %q2" - [(set_attr "type" "mve_move") -]) - -;; -;; [vmulq_n_f]) -;; -(define_insn "mve_vmulq_n_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "w") - (match_operand: 2 "s_register_operand" "r")] - VMULQ_N_F)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vmul.f%# %q0, %q1, %2" + ".f%#\t%q0, %q1, %q2" [(set_attr "type" "mve_move") ]) @@ -2490,20 +2427,6 @@ (define_insn "mve_vshlltq_n_" [(set_attr "type" "mve_move") ]) -;; -;; [vsubq_f]) -;; -(define_insn "mve_vsubq_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (minus:MVE_0 (match_operand:MVE_0 1 "s_register_operand" "w") - (match_operand:MVE_0 2 "s_register_operand" "w"))) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vsub.f%#\t%q0, %q1, %q2" - [(set_attr "type" "mve_move") -]) - ;; ;; [vmulltq_poly_p]) ;; @@ -5032,23 +4955,6 @@ (define_insn "mve_vsriq_m_n_" [(set_attr "type" "mve_move") (set_attr "length" "8")]) -;; -;; [vsubq_m_u, vsubq_m_s]) -;; -(define_insn "mve_vsubq_m_" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0") - (match_operand:MVE_2 2 "s_register_operand" "w") - (match_operand:MVE_2 3 "s_register_operand" "w") - (match_operand: 4 "vpr_register_operand" "Up")] - VSUBQ_M)) - ] - "TARGET_HAVE_MVE" - "vpst\;vsubt.i%#\t%q0, %q2, %q3" - [(set_attr "type" "mve_move") - (set_attr "length" "8")]) - ;; ;; [vcvtq_m_n_to_f_u, vcvtq_m_n_to_f_s]) ;; @@ -5084,35 +4990,39 @@ (define_insn "mve_vabdq_m_" ;; ;; [vaddq_m_n_s, vaddq_m_n_u]) +;; [vsubq_m_n_s, vsubq_m_n_u]) +;; [vmulq_m_n_s, vmulq_m_n_u]) ;; -(define_insn "mve_vaddq_m_n_" +(define_insn "@mve_q_m_n_" [ (set (match_operand:MVE_2 0 "s_register_operand" "=w") (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0") (match_operand:MVE_2 2 "s_register_operand" "w") (match_operand: 3 "s_register_operand" "r") (match_operand: 4 "vpr_register_operand" "Up")] - VADDQ_M_N)) + MVE_INT_M_N_BINARY)) ] "TARGET_HAVE_MVE" - "vpst\;vaddt.i%# %q0, %q2, %3" + "vpst\;t.i%# %q0, %q2, %3" [(set_attr "type" "mve_move") (set_attr "length""8")]) ;; ;; [vaddq_m_u, vaddq_m_s]) +;; [vsubq_m_u, vsubq_m_s]) +;; [vmulq_m_u, vmulq_m_s]) ;; -(define_insn "mve_vaddq_m_" +(define_insn "@mve_q_m_" [ (set (match_operand:MVE_2 0 "s_register_operand" "=w") (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0") (match_operand:MVE_2 2 "s_register_operand" "w") (match_operand:MVE_2 3 "s_register_operand" "w") (match_operand: 4 "vpr_register_operand" "Up")] - VADDQ_M)) + MVE_INT_M_BINARY)) ] "TARGET_HAVE_MVE" - "vpst\;vaddt.i%# %q0, %q2, %q3" + "vpst\;t.i%# %q0, %q2, %q3" [(set_attr "type" "mve_move") (set_attr "length""8")]) @@ -5422,40 +5332,6 @@ (define_insn "mve_vmulltq_int_m_" [(set_attr "type" "mve_move") (set_attr "length""8")]) -;; -;; [vmulq_m_n_u, vmulq_m_n_s]) -;; -(define_insn "mve_vmulq_m_n_" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0") - (match_operand:MVE_2 2 "s_register_operand" "w") - (match_operand: 3 "s_register_operand" "r") - (match_operand: 4 "vpr_register_operand" "Up")] - VMULQ_M_N)) - ] - "TARGET_HAVE_MVE" - "vpst\;vmult.i%# %q0, %q2, %3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - -;; -;; [vmulq_m_s, vmulq_m_u]) -;; -(define_insn "mve_vmulq_m_" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0") - (match_operand:MVE_2 2 "s_register_operand" "w") - (match_operand:MVE_2 3 "s_register_operand" "w") - (match_operand: 4 "vpr_register_operand" "Up")] - VMULQ_M)) - ] - "TARGET_HAVE_MVE" - "vpst\;vmult.i%# %q0, %q2, %q3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - ;; ;; [vornq_m_u, vornq_m_s]) ;; @@ -5796,23 +5672,6 @@ (define_insn "mve_vsliq_m_n_" [(set_attr "type" "mve_move") (set_attr "length""8")]) -;; -;; [vsubq_m_n_s, vsubq_m_n_u]) -;; -(define_insn "mve_vsubq_m_n_" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (unspec:MVE_2 [(match_operand:MVE_2 1 "s_register_operand" "0") - (match_operand:MVE_2 2 "s_register_operand" "w") - (match_operand: 3 "s_register_operand" "r") - (match_operand: 4 "vpr_register_operand" "Up")] - VSUBQ_M_N)) - ] - "TARGET_HAVE_MVE" - "vpst\;vsubt.i%#\t%q0, %q2, %3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - ;; ;; [vhcaddq_rot270_m_s]) ;; @@ -6613,35 +6472,39 @@ (define_insn "mve_vabdq_m_f" ;; ;; [vaddq_m_f]) +;; [vsubq_m_f]) +;; [vmulq_m_f]) ;; -(define_insn "mve_vaddq_m_f" +(define_insn "@mve_q_m_f" [ (set (match_operand:MVE_0 0 "s_register_operand" "=w") (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "0") (match_operand:MVE_0 2 "s_register_operand" "w") (match_operand:MVE_0 3 "s_register_operand" "w") (match_operand: 4 "vpr_register_operand" "Up")] - VADDQ_M_F)) + MVE_FP_M_BINARY)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vaddt.f%# %q0, %q2, %q3" + "vpst\;t.f%# %q0, %q2, %q3" [(set_attr "type" "mve_move") (set_attr "length""8")]) ;; ;; [vaddq_m_n_f]) +;; [vsubq_m_n_f]) +;; [vmulq_m_n_f]) ;; -(define_insn "mve_vaddq_m_n_f" +(define_insn "@mve_q_m_n_f" [ (set (match_operand:MVE_0 0 "s_register_operand" "=w") (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "0") (match_operand:MVE_0 2 "s_register_operand" "w") (match_operand: 3 "s_register_operand" "r") (match_operand: 4 "vpr_register_operand" "Up")] - VADDQ_M_N_F)) + MVE_FP_M_N_BINARY)) ] "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vaddt.f%# %q0, %q2, %3" + "vpst\;t.f%# %q0, %q2, %3" [(set_attr "type" "mve_move") (set_attr "length""8")]) @@ -6985,40 +6848,6 @@ (define_insn "mve_vminnmq_m_f" [(set_attr "type" "mve_move") (set_attr "length""8")]) -;; -;; [vmulq_m_f]) -;; -(define_insn "mve_vmulq_m_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "0") - (match_operand:MVE_0 2 "s_register_operand" "w") - (match_operand:MVE_0 3 "s_register_operand" "w") - (match_operand: 4 "vpr_register_operand" "Up")] - VMULQ_M_F)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vmult.f%# %q0, %q2, %q3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - -;; -;; [vmulq_m_n_f]) -;; -(define_insn "mve_vmulq_m_n_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "0") - (match_operand:MVE_0 2 "s_register_operand" "w") - (match_operand: 3 "s_register_operand" "r") - (match_operand: 4 "vpr_register_operand" "Up")] - VMULQ_M_N_F)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vmult.f%# %q0, %q2, %3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - ;; ;; [vornq_m_f]) ;; @@ -7053,40 +6882,6 @@ (define_insn "mve_vorrq_m_f" [(set_attr "type" "mve_move") (set_attr "length""8")]) -;; -;; [vsubq_m_f]) -;; -(define_insn "mve_vsubq_m_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "0") - (match_operand:MVE_0 2 "s_register_operand" "w") - (match_operand:MVE_0 3 "s_register_operand" "w") - (match_operand: 4 "vpr_register_operand" "Up")] - VSUBQ_M_F)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vsubt.f%#\t%q0, %q2, %q3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - -;; -;; [vsubq_m_n_f]) -;; -(define_insn "mve_vsubq_m_n_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (unspec:MVE_0 [(match_operand:MVE_0 1 "s_register_operand" "0") - (match_operand:MVE_0 2 "s_register_operand" "w") - (match_operand: 3 "s_register_operand" "r") - (match_operand: 4 "vpr_register_operand" "Up")] - VSUBQ_M_N_F)) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vpst\;vsubt.f%#\t%q0, %q2, %3" - [(set_attr "type" "mve_move") - (set_attr "length""8")]) - ;; ;; [vstrbq_s vstrbq_u] ;; @@ -8927,34 +8722,6 @@ (define_insn "mve_vstrwq_scatter_shifted_offset_v4si_insn" "vstrw.32\t%q2, [%0, %q1, uxtw #2]" [(set_attr "length" "4")]) -;; -;; [vaddq_s, vaddq_u]) -;; -(define_insn "mve_vaddq" - [ - (set (match_operand:MVE_2 0 "s_register_operand" "=w") - (plus:MVE_2 (match_operand:MVE_2 1 "s_register_operand" "w") - (match_operand:MVE_2 2 "s_register_operand" "w"))) - ] - "TARGET_HAVE_MVE" - "vadd.i%#\t%q0, %q1, %q2" - [(set_attr "type" "mve_move") -]) - -;; -;; [vaddq_f]) -;; -(define_insn "mve_vaddq_f" - [ - (set (match_operand:MVE_0 0 "s_register_operand" "=w") - (plus:MVE_0 (match_operand:MVE_0 1 "s_register_operand" "w") - (match_operand:MVE_0 2 "s_register_operand" "w"))) - ] - "TARGET_HAVE_MVE && TARGET_HAVE_MVE_FLOAT" - "vadd.f%#\t%q0, %q1, %q2" - [(set_attr "type" "mve_move") -]) - ;; ;; [vidupq_n_u]) ;;