From patchwork Wed May 10 13:30:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 69064 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68A8138D1313 for ; Wed, 10 May 2023 13:35:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68A8138D1313 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683725745; bh=IMMTfATVBCTm/FEqD5dPy/nBsxzajvI1yIRXA6fse1E=; 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=FC5lNKsljpaPiSataexpKWwXU0V7riTbk0Eg+Mo20+MTkor/D74KqtJT7qSVqESMa iB8RFRc3YO3bMVbPDRPIStp6ujDGTHS7Kbh+tzgzNufQRbzYE38loDOebV5xSgLgb7 hWDVyk/nPNl8cgbwNYWMjLt6dQqZPcKDcaHaDDiY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2081.outbound.protection.outlook.com [40.107.8.81]) by sourceware.org (Postfix) with ESMTPS id 0A4B43853563 for ; Wed, 10 May 2023 13:31:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A4B43853563 Received: from DB6P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::19) by DB9PR08MB7889.eurprd08.prod.outlook.com (2603:10a6:10:39c::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May 2023 13:31:03 +0000 Received: from DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:29:cafe::e9) by DB6P193CA0009.outlook.office365.com (2603:10a6:6:29::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32 via Frontend Transport; Wed, 10 May 2023 13:31:03 +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 DBAEUR03FT014.mail.protection.outlook.com (100.127.143.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18 via Frontend Transport; Wed, 10 May 2023 13:31:03 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Wed, 10 May 2023 13:31:03 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b61411afb0f3bb6b X-CR-MTA-TID: 64aa7808 Received: from 07f40cc26e71.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E04B80CE-E526-4A0A-AC44-17872943C590.1; Wed, 10 May 2023 13:30:56 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 07f40cc26e71.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 May 2023 13:30:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gnl14L0LiOdC+qbCVjsEGX7cULn9m+QSnQnGDolK+OpetscQ6zQwsSlVabBRrlJJtPmHfNvt7/t35IVZ9kf5XwAHUKYT0XM1LbYvNHhE7rYPIemNcamcC2JLczqwN/PAi00b0T56ZHT7eSH8L1MNNQERxBvzym3FfHIL6vTskD1hiCs3+Y+eiEI9jTXh2kGHXlzmleatKqmf0i4e/IFTM1mAV1A1qy6SVkB23ihyADfm92pIuzkRV7lmmLNjQ7Q5c0e6IMhQACAItsU6e8ovy04AUK8rO8Jl6CUaFE+4VVXR1Uq/xh8HUmg8ZFGvxQ5LsG72BJGhSsHoFxV9yNXdUA== 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=IMMTfATVBCTm/FEqD5dPy/nBsxzajvI1yIRXA6fse1E=; b=ScBv9Bg9ZfMd47Zb+6lxsi1sqEDQD5DgJnKErnBDD3thEsv5/SXCrnRDJH5Q+PuynNPoJgnr7ycEcJ5caZ/Och/a+ckJ7YDFxPWo8SiUUavG0TLVlW2ZMuIZBCDEcjqf9+86mMOxzI0KmAqlYi0JUDPJpc1c7Pp2Yxk2bTLU4veRXzl48x2hgL87LsN8GQF81Ors08nyw+D3/LLUxtvBpASeXauk/boF8n3Qu7UJLEJEAYuNDyCRBNW8hjZu5IHnSV+dy3vIchMZ72p0J2o7kVGlETwtDy2Ncn1LxojM0PUCRN0IfardGWxVylCKNteLkDd4o+t6Kub5O3UFE3X5uQ== 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 AM0PR02CA0025.eurprd02.prod.outlook.com (2603:10a6:208:3e::38) by DU2PR08MB10186.eurprd08.prod.outlook.com (2603:10a6:10:46c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May 2023 13:30:54 +0000 Received: from AM7EUR03FT063.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:3e:cafe::fc) by AM0PR02CA0025.outlook.office365.com (2603:10a6:208:3e::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.19 via Frontend Transport; Wed, 10 May 2023 13:30:53 +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 AM7EUR03FT063.mail.protection.outlook.com (100.127.140.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.20 via Frontend Transport; Wed, 10 May 2023 13:30:53 +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; Wed, 10 May 2023 13:30:47 +0000 Received: from e129018.arm.com (10.57.23.51) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Wed, 10 May 2023 13:30:47 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 17/20] arm: [MVE intrinsics] rework vaddlvq Date: Wed, 10 May 2023 15:30:33 +0200 Message-ID: <20230510133036.596530-17-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230510133036.596530-1-christophe.lyon@arm.com> References: <20230510133036.596530-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT063:EE_|DU2PR08MB10186:EE_|DBAEUR03FT014:EE_|DB9PR08MB7889:EE_ X-MS-Office365-Filtering-Correlation-Id: 42421355-334f-4ed2-68de-08db515acd4c 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: sZ4Ofl+re+5+n1NyWOeXv/KNlT5UCE9TSnSAY9+dVnjFVg9Uug6YickXfacbbHCmtQ4YpTy2fXptGkiagfDtoVE7l8//Q4DRTX3pOP1e1g3p711aOMqql5PpeCFN47JjJcqj/q3D33L0sGIP169rICkC3u4GxUQTKh2s1QjuNPjAngnQJLM9cRnCfimsaTrc9deQR8MI0JzNS0wC718oGgNknayhMquLxEmqc2ZOeVfIPYI3s8KG60gIk3OgkFVokZ3djAIum+ZQIC6nPKVSq5ysLyrs8+lvGq0hs/cQRXSnKUZGmu/Jy71LPY7Y2Y5lPhzyqO6t2QNXFberZNoPZqvi/aTtfM/wllEr6ZFyVp7HUmzzsns9DvrsGpqSLhomp63D2F5QukQjFipuYffYAlCixCLevJpbqN/HAvU3Ng/W2u+MVAQTN0xCViNPz9Et8zC3J8xlZHkrnXkXKlFlRuQx5Gni2NUrgqceXpVGLQYcXJSCrWuu/nJsCClptRykH6YhOutem6rqyNRtm6sEGWwkd0nNoCmL7lIkeocnCVigXVZmCu3lSJz0pey04Q44H8nyW87DlUpNrjkrK7v89/lzflmR1AbfgiH0ZjpUBScqadAbmVD1uve2IBYIswmigZneLcWLj+nayF6L7kk6wEPoAEGfSc9j7EjcOSaK1WLu/lonq97gIyRx1GhJDV9tL1C+aAso8YFgTlix5z/ObQ== 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)(346002)(376002)(396003)(39860400002)(136003)(451199021)(36840700001)(46966006)(86362001)(36756003)(110136005)(316002)(6636002)(6666004)(4326008)(7696005)(70586007)(478600001)(70206006)(82310400005)(40480700001)(2906002)(41300700001)(8936002)(4001150100001)(30864003)(8676002)(5660300002)(44832011)(2616005)(186003)(356005)(81166007)(82740400003)(426003)(26005)(36860700001)(1076003)(83380400001)(336012)(47076005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10186 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9dd21bb2-f42c-4329-1bed-08db515ac76f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5E5r80u/EtAqKYckLjGiUlGvEA5b7n0xVaEb3Hu+VO69r1bya9dP9HHvL79HhE0wWYKWeBzsbWK/ufYxadajJSpHccOs0OHF3zei2i1BAJraJE8OVDyDnzU6CD71FiqnP8kKlpTD5pkcZ3zNeYo0lBxUsFLp1lQDwXY1xLy2qZsEv7am2NWQKXg0He1NXXqeLzmgiqbHzJFUqwzs4NT/sehAnA45vwzEH797bMX/HZWynC7klOyb1hJ10GNljws44Xae/ZdmZkavlhZX9emfSUHjWP+1YGkdSpDTYFmdoUxYUGA0G5z6sfLjWWTjTtRVuvI9rVIhH358IVJCS4RbuHj8FEI6Y7STq5tVh8+3K/6siRucQGy2kCjq0vvFLyebQE+fAFmTADL5GlbK7uJNaSsAMGP61t36EeeqF+b+ckJ/N1WAh9hqQsDjfBEyB/VlKVQvJi8buH1Pap5SVdce5OVdKWEKBXa1SWF7rhjRb3b4LYqVLpuyhqSnl2Ttf0Hi5wHIfOELDONTBfQy10cibdgCgdbZ1x1ATDpHZuHWh2bLGXy7rJUgLUL3JKjwJPxwEuhkUz5pyfhvcY4ece0izCj6oi7EAEiN6Tes9g1xaBSsu3/ndmPDqB0sNKySvEg5lL17+CsS1Zhc1pWJKxV3KOd4uIwfTKVuo3B9PMxBLOQeoGFu6D03fG+yT2DdhFunEg4DWA59kG4V/NshJd2cig== 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)(39860400002)(376002)(396003)(136003)(346002)(451199021)(46966006)(40470700004)(36840700001)(6666004)(7696005)(478600001)(40460700003)(36756003)(81166007)(36860700001)(186003)(86362001)(2616005)(426003)(336012)(47076005)(82740400003)(26005)(110136005)(44832011)(4001150100001)(83380400001)(1076003)(30864003)(2906002)(5660300002)(40480700001)(8936002)(8676002)(82310400005)(70206006)(70586007)(316002)(6636002)(4326008)(41300700001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 13:31:03.6144 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 42421355-334f-4ed2-68de-08db515acd4c 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: DBAEUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7889 X-Spam-Status: No, score=-12.6 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Implement vaddlvq using the new MVE builtins framework. Since we kept v4si hardcoded in the builtin name, we need to special-case it in unspec_mve_function_exact_insn_pred_p. 2022-10-25 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-base.cc (vaddlvq): New. * config/arm/arm-mve-builtins-base.def (vaddlvq): New. * config/arm/arm-mve-builtins-base.h (vaddlvq): New. * config/arm/arm-mve-builtins-functions.h (unspec_mve_function_exact_insn_pred_p): Handle vaddlvq. * config/arm/arm_mve.h (vaddlvq): Remove. (vaddlvq_p): Remove. (vaddlvq_s32): Remove. (vaddlvq_u32): Remove. (vaddlvq_p_s32): Remove. (vaddlvq_p_u32): Remove. (__arm_vaddlvq_s32): Remove. (__arm_vaddlvq_u32): Remove. (__arm_vaddlvq_p_s32): Remove. (__arm_vaddlvq_p_u32): Remove. (__arm_vaddlvq): Remove. (__arm_vaddlvq_p): Remove. --- gcc/config/arm/arm-mve-builtins-base.cc | 1 + gcc/config/arm/arm-mve-builtins-base.def | 1 + gcc/config/arm/arm-mve-builtins-base.h | 1 + gcc/config/arm/arm-mve-builtins-functions.h | 69 ++++++++++++++------ gcc/config/arm/arm_mve.h | 72 --------------------- 5 files changed, 51 insertions(+), 93 deletions(-) diff --git a/gcc/config/arm/arm-mve-builtins-base.cc b/gcc/config/arm/arm-mve-builtins-base.cc index e87069b0467..fdc0ff50b96 100644 --- a/gcc/config/arm/arm-mve-builtins-base.cc +++ b/gcc/config/arm/arm-mve-builtins-base.cc @@ -244,6 +244,7 @@ namespace arm_mve { FUNCTION_WITHOUT_N (vabdq, VABDQ) FUNCTION (vabsq, unspec_based_mve_function_exact_insn, (ABS, ABS, ABS, -1, -1, -1, VABSQ_M_S, -1, VABSQ_M_F, -1, -1, -1)) FUNCTION_WITH_RTX_M_N (vaddq, PLUS, VADDQ) +FUNCTION_PRED_P_S_U (vaddlvq, VADDLVQ) FUNCTION_PRED_P_S_U (vaddvq, VADDVQ) FUNCTION_PRED_P_S_U (vaddvaq, VADDVAQ) FUNCTION_WITH_RTX_M (vandq, AND, VANDQ) diff --git a/gcc/config/arm/arm-mve-builtins-base.def b/gcc/config/arm/arm-mve-builtins-base.def index 413fe4a1ef0..dcfb426a7fb 100644 --- a/gcc/config/arm/arm-mve-builtins-base.def +++ b/gcc/config/arm/arm-mve-builtins-base.def @@ -20,6 +20,7 @@ #define REQUIRES_FLOAT false DEF_MVE_FUNCTION (vabdq, binary, all_integer, mx_or_none) DEF_MVE_FUNCTION (vabsq, unary, all_signed, mx_or_none) +DEF_MVE_FUNCTION (vaddlvq, unary_acc, integer_32, p_or_none) DEF_MVE_FUNCTION (vaddq, binary_opt_n, all_integer, mx_or_none) DEF_MVE_FUNCTION (vaddvaq, unary_int32_acc, all_integer, p_or_none) DEF_MVE_FUNCTION (vaddvq, unary_int32, all_integer, p_or_none) diff --git a/gcc/config/arm/arm-mve-builtins-base.h b/gcc/config/arm/arm-mve-builtins-base.h index 5338b777444..5de70d5e1d4 100644 --- a/gcc/config/arm/arm-mve-builtins-base.h +++ b/gcc/config/arm/arm-mve-builtins-base.h @@ -25,6 +25,7 @@ namespace functions { extern const function_base *const vabdq; extern const function_base *const vabsq; +extern const function_base *const vaddlvq; extern const function_base *const vaddq; extern const function_base *const vaddvaq; extern const function_base *const vaddvq; diff --git a/gcc/config/arm/arm-mve-builtins-functions.h b/gcc/config/arm/arm-mve-builtins-functions.h index d069990dcab..ea926e42b81 100644 --- a/gcc/config/arm/arm-mve-builtins-functions.h +++ b/gcc/config/arm/arm-mve-builtins-functions.h @@ -408,32 +408,59 @@ public: expand (function_expander &e) const override { insn_code code; - switch (e.pred) + + if ((m_unspec_for_sint == VADDLVQ_S) + || m_unspec_for_sint == VADDLVAQ_S) { - case PRED_none: - if (e.type_suffix (0).integer_p) - if (e.type_suffix (0).unsigned_p) - code = code_for_mve_q (m_unspec_for_uint, m_unspec_for_uint, e.vector_mode (0)); - else - code = code_for_mve_q (m_unspec_for_sint, m_unspec_for_sint, e.vector_mode (0)); - else - code = code_for_mve_q_f (m_unspec_for_fp, e.vector_mode (0)); + switch (e.pred) + { + case PRED_none: + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q_v4si (m_unspec_for_uint, m_unspec_for_uint); + else + code = code_for_mve_q_v4si (m_unspec_for_sint, m_unspec_for_sint); + return e.use_exact_insn (code); - return e.use_exact_insn (code); + case PRED_p: + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q_p_v4si (m_unspec_for_p_uint, m_unspec_for_p_uint); + else + code = code_for_mve_q_p_v4si (m_unspec_for_p_sint, m_unspec_for_p_sint); + return e.use_exact_insn (code); - case PRED_p: - if (e.type_suffix (0).integer_p) - if (e.type_suffix (0).unsigned_p) - code = code_for_mve_q_p (m_unspec_for_p_uint, m_unspec_for_p_uint, e.vector_mode (0)); - else - code = code_for_mve_q_p (m_unspec_for_p_sint, m_unspec_for_p_sint, e.vector_mode (0)); - else - code = code_for_mve_q_p_f (m_unspec_for_p_fp, e.vector_mode (0)); + default: + gcc_unreachable (); + } + } + else + { + switch (e.pred) + { + case PRED_none: + if (e.type_suffix (0).integer_p) + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q (m_unspec_for_uint, m_unspec_for_uint, e.vector_mode (0)); + else + code = code_for_mve_q (m_unspec_for_sint, m_unspec_for_sint, e.vector_mode (0)); + else + code = code_for_mve_q_f (m_unspec_for_fp, e.vector_mode (0)); - return e.use_exact_insn (code); + return e.use_exact_insn (code); - default: - gcc_unreachable (); + case PRED_p: + if (e.type_suffix (0).integer_p) + if (e.type_suffix (0).unsigned_p) + code = code_for_mve_q_p (m_unspec_for_p_uint, m_unspec_for_p_uint, e.vector_mode (0)); + else + code = code_for_mve_q_p (m_unspec_for_p_sint, m_unspec_for_p_sint, e.vector_mode (0)); + else + code = code_for_mve_q_p_f (m_unspec_for_p_fp, e.vector_mode (0)); + + return e.use_exact_insn (code); + + default: + gcc_unreachable (); + } } gcc_unreachable (); diff --git a/gcc/config/arm/arm_mve.h b/gcc/config/arm/arm_mve.h index 74783570561..21d7768a732 100644 --- a/gcc/config/arm/arm_mve.h +++ b/gcc/config/arm/arm_mve.h @@ -42,11 +42,9 @@ #ifndef __ARM_MVE_PRESERVE_USER_NAMESPACE #define vst4q(__addr, __value) __arm_vst4q(__addr, __value) -#define vaddlvq(__a) __arm_vaddlvq(__a) #define vmovlbq(__a) __arm_vmovlbq(__a) #define vmovltq(__a) __arm_vmovltq(__a) #define vmvnq(__a) __arm_vmvnq(__a) -#define vaddlvq_p(__a, __p) __arm_vaddlvq_p(__a, __p) #define vornq(__a, __b) __arm_vornq(__a, __b) #define vmulltq_int(__a, __b) __arm_vmulltq_int(__a, __b) #define vmullbq_int(__a, __b) __arm_vmullbq_int(__a, __b) @@ -324,7 +322,6 @@ #define vcvtq_f32_s32(__a) __arm_vcvtq_f32_s32(__a) #define vcvtq_f16_u16(__a) __arm_vcvtq_f16_u16(__a) #define vcvtq_f32_u32(__a) __arm_vcvtq_f32_u32(__a) -#define vaddlvq_s32(__a) __arm_vaddlvq_s32(__a) #define vmovlbq_s8(__a) __arm_vmovlbq_s8(__a) #define vmovlbq_s16(__a) __arm_vmovlbq_s16(__a) #define vmovltq_s8(__a) __arm_vmovltq_s8(__a) @@ -353,7 +350,6 @@ #define vmovlbq_u16(__a) __arm_vmovlbq_u16(__a) #define vmvnq_n_u16( __imm) __arm_vmvnq_n_u16( __imm) #define vmvnq_n_u32( __imm) __arm_vmvnq_n_u32( __imm) -#define vaddlvq_u32(__a) __arm_vaddlvq_u32(__a) #define vcvtq_u16_f16(__a) __arm_vcvtq_u16_f16(__a) #define vcvtq_u32_f32(__a) __arm_vcvtq_u32_f32(__a) #define vcvtpq_u16_f16(__a) __arm_vcvtpq_u16_f16(__a) @@ -379,8 +375,6 @@ #define vcvtq_n_s32_f32(__a, __imm6) __arm_vcvtq_n_s32_f32(__a, __imm6) #define vcvtq_n_u16_f16(__a, __imm6) __arm_vcvtq_n_u16_f16(__a, __imm6) #define vcvtq_n_u32_f32(__a, __imm6) __arm_vcvtq_n_u32_f32(__a, __imm6) -#define vaddlvq_p_s32(__a, __p) __arm_vaddlvq_p_s32(__a, __p) -#define vaddlvq_p_u32(__a, __p) __arm_vaddlvq_p_u32(__a, __p) #define vornq_u8(__a, __b) __arm_vornq_u8(__a, __b) #define vmulltq_int_u8(__a, __b) __arm_vmulltq_int_u8(__a, __b) #define vmullbq_int_u8(__a, __b) __arm_vmullbq_int_u8(__a, __b) @@ -1499,13 +1493,6 @@ __arm_vst4q_u32 (uint32_t * __addr, uint32x4x4_t __value) __builtin_mve_vst4qv4si ((__builtin_neon_si *) __addr, __rv.__o); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq_s32 (int32x4_t __a) -{ - return __builtin_mve_vaddlvq_sv4si (__a); -} - __extension__ extern __inline int16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vmovlbq_s8 (int8x16_t __a) @@ -1632,13 +1619,6 @@ __arm_vmvnq_n_u32 (const int __imm) return __builtin_mve_vmvnq_n_uv4si (__imm); } -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq_u32 (uint32x4_t __a) -{ - return __builtin_mve_vaddlvq_uv4si (__a); -} - __extension__ extern __inline mve_pred16_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vctp16q (uint32_t __a) @@ -1674,20 +1654,6 @@ __arm_vpnot (mve_pred16_t __a) return __builtin_mve_vpnotv16bi (__a); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq_p_s32 (int32x4_t __a, mve_pred16_t __p) -{ - return __builtin_mve_vaddlvq_p_sv4si (__a, __p); -} - -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq_p_u32 (uint32x4_t __a, mve_pred16_t __p) -{ - return __builtin_mve_vaddlvq_p_uv4si (__a, __p); -} - __extension__ extern __inline uint8x16_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vornq_u8 (uint8x16_t __a, uint8x16_t __b) @@ -9586,13 +9552,6 @@ __arm_vst4q (uint32_t * __addr, uint32x4x4_t __value) __arm_vst4q_u32 (__addr, __value); } -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq (int32x4_t __a) -{ - return __arm_vaddlvq_s32 (__a); -} - __extension__ extern __inline int16x8_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vmovlbq (int8x16_t __a) @@ -9691,27 +9650,6 @@ __arm_vmovlbq (uint16x8_t __a) return __arm_vmovlbq_u16 (__a); } -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq (uint32x4_t __a) -{ - return __arm_vaddlvq_u32 (__a); -} - -__extension__ extern __inline int64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq_p (int32x4_t __a, mve_pred16_t __p) -{ - return __arm_vaddlvq_p_s32 (__a, __p); -} - -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__arm_vaddlvq_p (uint32x4_t __a, mve_pred16_t __p) -{ - return __arm_vaddlvq_p_u32 (__a, __p); -} - __extension__ extern __inline uint8x16_t __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __arm_vornq (uint8x16_t __a, uint8x16_t __b) @@ -19212,16 +19150,6 @@ extern void *__ARM_undef; int (*)[__ARM_mve_type_int_n][__ARM_mve_type_int32x4_t]: __arm_vaddlvaq_p_s32 (__ARM_mve_coerce3(p0, int), __ARM_mve_coerce(__p1, int32x4_t), p2), \ int (*)[__ARM_mve_type_int_n][__ARM_mve_type_uint32x4_t]: __arm_vaddlvaq_p_u32 (__ARM_mve_coerce3(p0, int), __ARM_mve_coerce(__p1, uint32x4_t), p2));}) -#define __arm_vaddlvq(p0) ({ __typeof(p0) __p0 = (p0); \ - _Generic( (int (*)[__ARM_mve_typeid(__p0)])0, \ - int (*)[__ARM_mve_type_int32x4_t]: __arm_vaddlvq_s32 (__ARM_mve_coerce(__p0, int32x4_t)), \ - int (*)[__ARM_mve_type_uint32x4_t]: __arm_vaddlvq_u32 (__ARM_mve_coerce(__p0, uint32x4_t)));}) - -#define __arm_vaddlvq_p(p0,p1) ({ __typeof(p0) __p0 = (p0); \ - _Generic( (int (*)[__ARM_mve_typeid(__p0)])0, \ - int (*)[__ARM_mve_type_int32x4_t]: __arm_vaddlvq_p_s32 (__ARM_mve_coerce(__p0, int32x4_t), p1), \ - int (*)[__ARM_mve_type_uint32x4_t]: __arm_vaddlvq_p_u32 (__ARM_mve_coerce(__p0, uint32x4_t), p1));}) - #define __arm_vmladavaq(p0,p1,p2) ({ __typeof(p0) __p0 = (p0); \ __typeof(p1) __p1 = (p1); \ __typeof(p2) __p2 = (p2); \