From patchwork Fri May 5 08:39:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 68798 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 4781C382BC36 for ; Fri, 5 May 2023 08:45:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4781C382BC36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683276327; bh=+M+LjVJ3jR3BhE50ruW81XRkUZ4JQnliyAzUyuqMn4g=; 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=iFjHdvhwJaKW4gfUsTXj6lwiS46nOV2uNnK2y2YixL/rUm0ECb6vMXrNibGLOQbmL S+e5ucgM7dNVS5Ypc/j1X9kH+qFJp39sPSvY4s2PDPC+ZLFcX46bvamWXZ44yVjT6a aQF8M40IyVCdzqvq0lmp6dB1A6idS85pQgBL/hXU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2073.outbound.protection.outlook.com [40.107.20.73]) by sourceware.org (Postfix) with ESMTPS id 55C5E3856956 for ; Fri, 5 May 2023 08:40:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55C5E3856956 Received: from AM6PR10CA0062.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:80::39) by AS2PR08MB9199.eurprd08.prod.outlook.com (2603:10a6:20b:578::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.26; Fri, 5 May 2023 08:40:09 +0000 Received: from AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:80:cafe::c2) by AM6PR10CA0062.outlook.office365.com (2603:10a6:209:80::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27 via Frontend Transport; Fri, 5 May 2023 08:40:09 +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 AM7EUR03FT013.mail.protection.outlook.com (100.127.140.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27 via Frontend Transport; Fri, 5 May 2023 08:40:09 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 05 May 2023 08:40:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d86d896fc7eeba92 X-CR-MTA-TID: 64aa7808 Received: from 703ee610aa5b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1E683ACA-A05A-422E-8607-4A6C155FBBF4.1; Fri, 05 May 2023 08:39:58 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 703ee610aa5b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 May 2023 08:39:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gTbLVkCx9NMKaaUipverWU8k7/FOXHP20jTwTVhiG77doKhkze584k32oIi+bmHfCJI6xvzSdM1uaQlrzyoOwcqDqwjiDsMT7U0Om3NkSuTb1fer6ltMdqr4AjON8FwxR+pYOmKYbU4Fjjffecq2fS6KFUwzEhcYCZd2jVR2eTU1dObPMMY/YuWzrYu+qyUic1nYBV5T8k2E7pKoaoK8lRNvcPjGhQM8Os5jXjbfr4aU0vLKRamYvc7PtwK4wBRcUuTNE+g/ZBmmTKGmUDiUf2W/P0dZPpL8TaTNZF2a+Q8iZ4kFwQ9U7GiFLHsGV4pOT7UXVVcqaxbqNeM35gfd2A== 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=+M+LjVJ3jR3BhE50ruW81XRkUZ4JQnliyAzUyuqMn4g=; b=Pm1AX/Z7owfJ8CMfksaAYY99ioZnyyCXJI7jHLEWp9cO6Z4obYTdAiskFdZOqEXJwtUSep21Eugt+d1TwTAK+GCC1TrUOqRzQ5ps9ss/FY6dQpDKy3dj67P9VWyNBNgDUroou+jSp5SbA04OLKnGHFJoYbpA0kD6CZkMjvXoR5Nl+Fc09AmdlzRgoPoa3ZMV/IYIMJGj0eAnJlht5Cir9bOyoaMmlQwHk5cSAeY4cxmB1Gc5GmoAwJCbv8clRDKuq3/JMI8Q9O3TXZ/Bze1DEq0qz/nOxqcU9SYRx4XZZdSnyLpTSEaSjvHxjHSN/M0gD70vBInxQ6jyvMZddsi7fw== 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 AS9PR07CA0021.eurprd07.prod.outlook.com (2603:10a6:20b:46c::26) by PAVPR08MB9530.eurprd08.prod.outlook.com (2603:10a6:102:314::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.22; Fri, 5 May 2023 08:39:56 +0000 Received: from AM7EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46c:cafe::21) by AS9PR07CA0021.outlook.office365.com (2603:10a6:20b:46c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.12 via Frontend Transport; Fri, 5 May 2023 08:39:55 +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 AM7EUR03FT024.mail.protection.outlook.com (100.127.140.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6363.27 via Frontend Transport; Fri, 5 May 2023 08:39:55 +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; Fri, 5 May 2023 08:39:52 +0000 Received: from e129018.arm.com (10.57.22.112) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 5 May 2023 08:39:51 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 15/23] arm: [MVE intrinsics] add binary_rshift_narrow shape Date: Fri, 5 May 2023 10:39:22 +0200 Message-ID: <20230505083930.101210-15-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230505083930.101210-1-christophe.lyon@arm.com> References: <20230505083930.101210-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT024:EE_|PAVPR08MB9530:EE_|AM7EUR03FT013:EE_|AS2PR08MB9199:EE_ X-MS-Office365-Filtering-Correlation-Id: 7f196a87-d9de-4f7e-179f-08db4d4455bd 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: u2nYfArKStzP+rC58BWQekPcLkGWUdmTRt0KIBZgdt0PKiaf/sl9QInf2ywPE2Z1eRybvtCQjeKtT3F3QyUZ8/y1dEXOjJW6SWOcKZO1HUQ+xPukrThGhLMacTb9BghjTHXvgYA1RfAcFoVlzUQbpty4Idh78gkQLVF4zJd7f/PfyUjbbitxu4NoAC87WXcwUTRRDyF1GsvPfESpPNSWSlK8mN46CgurC1L12uq+X8PPYsRKAtuUNvPXB34i+KX//jyhho0obIT+9etdoZBznla98pGpMfuQj2sPPIy9alWJP5RpHu0K5ueCPjH9jTDK/B6tnajw6AuqAey6nn2cQV+fuImhmM7ImAqMiuz6Be09/PTxpxP2tOrwapjt637Em3hW0mo4Ky9reL1ixdFLlbYB16EQgzSVzFXHMVzH8ezyXzJB/qRCBMBWqADFeQu/G9aFz6Xoz1slO1lPplOfED0Ejw5rMP3WtJelTyRz04zuj+yG2Lrvkh7UYG44f4ZlYqSfHlPKtaphjvmb9E0+LRPMxABc8ZT1SpDY8BQcYZ7cQMlhmlXq+U9A23oHwq9ZbIXZ1wIm7m3WOz6Os+z+olNJiYORyvjCywoM0J3A9whli7/ylN8eL1YN82VgoMoQ0PUovxp6R/blOmCPEfFy8a3ueMQH50FVfKY9L1qWXFXP+qBAQOetq7izYTy/GMA0hwLJxDCd9w653GtQ7MF0BoRbe7HLb6cp4IBSCbU53ScxRNRjK1EdblOOvzs3S6GvFsEW/DeQzE/UsmUkONfLnA== 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)(346002)(376002)(136003)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(8676002)(8936002)(36860700001)(40480700001)(36756003)(356005)(41300700001)(82310400005)(82740400003)(6636002)(70206006)(81166007)(34020700004)(6666004)(70586007)(4326008)(316002)(86362001)(478600001)(110136005)(40460700003)(7696005)(2906002)(2616005)(5660300002)(336012)(426003)(1076003)(26005)(186003)(47076005)(44832011)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9530 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 869f6f90-43d8-4d10-8a11-08db4d444db5 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92rkeVIlWeVuqrCztuEEHVymdol50yQF+pDhmCvUnX3Bw4ZYZRWBHzPLEzBbR1cPA7avmJQysDObX2EpP6Cg91SrlKjGM17ZRi/Zgsa8wkRs0v85EwJObkZrQzfA8nA20uxkjQICFaQrPt1yJJ644q5UyLSuPZFI58xVdOCG4JmRRbwiUtBTwtztoKkQ3aLBObiA2AB1D9fY1JejqPZiPyJpOwOKA8fHgt0VhSvZggq10YXJ1z9DI5q+KIto7TV24GhoQUdP/YVFRlFP16w7DpU8Rff8ZEKCNDscD44qDTd25E35NH2gHuZXp9tar1rjpM2zB56LUwY/R6cdaCYZZPEGALcNRRFD0aR2r1e7O5G9Jqjz+Mf12rSl4/NCXgBvY2tVWhlv6D02fWWSrFG8XtBe0KSzb5rQMOLTIgXGZXSp24NvEFArpZ2aOeEMm58agWNifnWNhzr3wrs250JycDzXNffOcCMjaduaBiSvWaet3XIEs1aXOwijHIzjREUM/7FCQTpteUkA2D/tz9AK4lCqBInp3v5Qp9sFXjRvXPE14EjR/dffWjVyDydYotjP7FSJrOqcsIwke12Rjzx9nEOOtzw1oXt2suY2hGdhS2Yjwyw9f21KLFoN9LhsEzr0n9HIq7CnCB2JgG2hf2QLqcd+XSJrQe+5K2jz2bRkHozsgjMTpd0OcqI3uiclxiZJACVC54ET6+OU+rYRoShNOj+apoB8vGwdMKdiPDwSvbw= 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)(346002)(396003)(136003)(39860400002)(376002)(451199021)(40470700004)(36840700001)(46966006)(5660300002)(186003)(34020700004)(2906002)(478600001)(82740400003)(110136005)(81166007)(8936002)(8676002)(1076003)(7696005)(2616005)(44832011)(26005)(40460700003)(70586007)(70206006)(82310400005)(336012)(40480700001)(6666004)(41300700001)(36860700001)(86362001)(4326008)(426003)(36756003)(6636002)(47076005)(316002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 08:40:09.4159 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7f196a87-d9de-4f7e-179f-08db4d4455bd 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: AM7EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9199 X-Spam-Status: No, score=-12.5 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" This patch adds the binary_rshift_narrow shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_rshift_narrow): New. * config/arm/arm-mve-builtins-shapes.h (binary_rshift_narrow): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 47 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 48 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 4ecb612ece5..88934e1ca15 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -617,6 +617,53 @@ struct binary_lshift_r_def : public overloaded_base<0> }; SHAPE (binary_lshift_r) +/* _t vfoo[_n_t0](_t, _t, const int) + + Narrowing right shifts. + Check that 'imm' is in the [1..#bits/2] range. + + Example: vqrshrnbq. + int8x16_t [__arm_]vqrshrnbq[_n_s16](int8x16_t a, int16x8_t b, const int imm) + int8x16_t [__arm_]vqrshrnbq_m[_n_s16](int8x16_t a, int16x8_t b, const int imm, mve_pred16_t p) */ +struct binary_rshift_narrow_def : public overloaded_base<0> +{ + void + build (function_builder &b, const function_group_info &group, + bool preserve_user_namespace) const override + { + b.add_overloaded_functions (group, MODE_n, preserve_user_namespace); + build_all (b, "vh0,vh0,v0,ss32", group, MODE_n, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (3, i, nargs) + || (type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES + || !r.require_integer_immediate (i)) + return error_mark_node; + + type_suffix_index narrow_suffix + = find_type_suffix (type_suffixes[type].tclass, + type_suffixes[type].element_bits / 2); + + if (!r.require_matching_vector_type (0, narrow_suffix)) + return error_mark_node; + + return r.resolve_to (r.mode_suffix_id, type); + } + + bool + check (function_checker &c) const override + { + unsigned int bits = c.type_suffix (0).element_bits; + return c.require_immediate_range (2, 1, bits / 2); + } +}; +SHAPE (binary_rshift_narrow) + /* xN_t vfoo[_t0](uint64_t, uint64_t) where there are N arguments in total. diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 25d9b60a670..d72686d187b 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -40,6 +40,7 @@ namespace arm_mve extern const function_shape *const binary_opt_n; extern const function_shape *const binary_orrq; extern const function_shape *const binary_round_lshift; + extern const function_shape *const binary_rshift_narrow; extern const function_shape *const create; extern const function_shape *const inherent; extern const function_shape *const unary_convert;