From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060.outbound.protection.outlook.com [40.107.22.60]) by sourceware.org (Postfix) with ESMTPS id 8645F3856261 for ; Fri, 5 May 2023 08:40:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8645F3856261 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u/AZiEt46rcPS72xhriXngOIRVQe8itx/PGq1PTxRKk=; b=VxtfRmNmNdooPHJf064tmbGnC5pU1+ZPkdSYOhr6X7V88ffgsglTXVThKX71kMB0a1H1458oNmruKG4eCM4H6N+3nL9nnDDJw5m/8KTkWtk5Mb1b3E73HQmeBlVqfeq/FT1Vo1kU1F1/EIP4gRTKreOUdD6uy1ZBmjSAozgJGIQ= Received: from DB6PR07CA0072.eurprd07.prod.outlook.com (2603:10a6:6:2a::34) by GV2PR08MB8629.eurprd08.prod.outlook.com (2603:10a6:150:b9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.25; Fri, 5 May 2023 08:40:06 +0000 Received: from DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:2a:cafe::b) by DB6PR07CA0072.outlook.office365.com (2603:10a6:6:2a::34) 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:40:06 +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 DBAEUR03FT052.mail.protection.outlook.com (100.127.142.144) 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:06 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 05 May 2023 08:40:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5390424c0342dbaa X-CR-MTA-TID: 64aa7808 Received: from b0bba195e064.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3CFD0B39-D2C0-41E6-812A-391F534E838B.1; Fri, 05 May 2023 08:39:59 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b0bba195e064.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 May 2023 08:39:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E5NxAzrTEFwM654BWo3ohV5ERuQfWXOdmH3sYSw0W5vPiyZa73FIr2DzHFQx9kIBE98fUUpckksNGjFpyAf9EPcStLgdWGHkKiPGqxrEYHhHnjg1F0yGczmOD1GNor4B7yI1L0bSjuXaWaNXdm/BEd50BaYPrX8eJWTlMyAdsxLmEg6LTZZtQ5Crx1qNbEwkv3vNutyy8f4yh5+lWcnIxAC2QPFClykrzzMHp9RETuJJTwUBVBGwpT8bUf2HxH6wlDCt/dUdr5ENiCy5YuRqFKSd4pFH6HxyWBdfblYkCIqvFYLqhoCIOWiUvq9M+Tz3wmYDe3OQ41dpKhXh4iPzMA== 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=u/AZiEt46rcPS72xhriXngOIRVQe8itx/PGq1PTxRKk=; b=EoLuP8TGsJeOMWTCOvFeWBbpy6+fvvkZA52vvQTb6Z1BRULO1KsYYr+CkeMacuThnuk7U6Lki2z9hZscEYvDJXFZXQ7Wf3qgA0XGvEizCoLhT94c9FjOCj8IcAjvWU5o/oFnO62FZFQJs9WmhCP8hUGJp/25usUlBQotTzSjonZifaxaX5TWHVir+QforQgRjsUVXUn8JtrlRoBUEhVSCZlc5ZSu9Onq06Ki0dxL7OtLIQSkIYAjnN+NvpGj5ccLWNEJ3O5DktYHj7Q9BPrkTijZ2mwipVX2BNIgniCXIrERorXl54AwwOBxeGfCrnMuWoz34zajexCn9s6f6H2p8w== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u/AZiEt46rcPS72xhriXngOIRVQe8itx/PGq1PTxRKk=; b=VxtfRmNmNdooPHJf064tmbGnC5pU1+ZPkdSYOhr6X7V88ffgsglTXVThKX71kMB0a1H1458oNmruKG4eCM4H6N+3nL9nnDDJw5m/8KTkWtk5Mb1b3E73HQmeBlVqfeq/FT1Vo1kU1F1/EIP4gRTKreOUdD6uy1ZBmjSAozgJGIQ= Received: from AS9PR07CA0008.eurprd07.prod.outlook.com (2603:10a6:20b:46c::6) by PA4PR08MB6301.eurprd08.prod.outlook.com (2603:10a6:102:e9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.27; Fri, 5 May 2023 08:39:57 +0000 Received: from AM7EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:46c:cafe::7e) by AS9PR07CA0008.outlook.office365.com (2603:10a6:20b:46c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.11 via Frontend Transport; Fri, 5 May 2023 08:39:57 +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:57 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:53 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) 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:53 +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:53 +0000 From: Christophe Lyon To: , , , CC: Christophe Lyon Subject: [PATCH 18/23] arm: [MVE intrinsics] add binary_rshift_narrow_unsigned shape Date: Fri, 5 May 2023 10:39:25 +0200 Message-ID: <20230505083930.101210-18-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT024:EE_|PA4PR08MB6301:EE_|DBAEUR03FT052:EE_|GV2PR08MB8629:EE_ X-MS-Office365-Filtering-Correlation-Id: 22b91fbf-539d-46b1-7a0b-08db4d4453c7 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: hBFjZ07BNLIjHNv5hleqf+FnzVR9iMZoU+oljpJAEnJbuZBexiucQ8lbVuq1Vws4wQkFbAzWLmv3DzkSfH/o7pcSlXQX2a0upndP5MSon075a5m4nPfChRFqfMel4NM7l19RoMvS6TAiNu2Y0UwqyBg2EipafAP0GNxbcZao1fm4N+m29jit3ebTvtnRSXAgVfbpwMWm+bNi2bSlvQVBykAqmCEcgfgbR32X8sSidWDev59kPRY5f6goJ571nh/5asakAWGAe/Ez2kyWFUCDRd23p+U7RiLXNHV4ybbPXFFwlCrEdSc42+YcBEfg7avX1w0dmEkNPlWceeZdgMcet4o1CznyiSxsMkKFcYxjx0Z1RclqGj6VpN10dOOX/bqqmhpS1onjvqN+x2Pc9hZP7bj1HiBX9G9Rgj3egd2kZd2MrQtYfvbBFAh/TXzEZWpdiBeqdlEmbcGZ+rMqHascmyfB0dtpVtE0ntHY77OlNau63UPc2W9NvjcKQ0T43ihpdKNpxfEjxFCbayvnnGyIpPPgS8jYWzgD0Gjp+p5p2gYH/qtfQYOgBDQ6NZg6cAlo/j+woYFXphAHtr2Z3sGdAOToioQgs0X9FpaEnF7gBf+v3UxKJhp4pDlx+Gc6LDg0AahYV86BzbQFerlSA8anO0TQ600BuCXlpOAxaFuUG1ADZc1pJqbrI3nFRcSYrKAB+FWuH9hiWQdzmHXi6D1g4o/UlmkwnFgO1jpYFu2aRe2a/DTp+a9i89orRimM99BDcX6SiGspS/acSvefIVyc4Q== 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)(376002)(39860400002)(346002)(396003)(451199021)(36840700001)(40470700004)(46966006)(4326008)(6636002)(44832011)(70206006)(41300700001)(70586007)(5660300002)(8936002)(8676002)(26005)(1076003)(110136005)(6666004)(478600001)(316002)(7696005)(2906002)(2616005)(47076005)(336012)(40460700003)(426003)(186003)(36860700001)(81166007)(356005)(82740400003)(40480700001)(34020700004)(86362001)(82310400005)(36756003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6301 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 84ac4347-f428-4794-b75d-08db4d444e89 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MhNyt0lFigCopXc0uVxX/0PfBqgkSjfDiNODhwY3amPoNOY0f+QyTD3mrSvCmHgG/brJ0NNO+DgwjDh1LuSc/EGRMT+YGILuTwIVcCvGBYDqXpH9b876a0hpeWhXAE/kAwFcdlwWr7pNuGNqrEV4lqof3OuAaRZUZ9Vi2S1vUllnrMoXZbFWpeHs6bBr2T9GJkGSHcigKpsUcSvz8T/KLKWuhr0mI6adm3S1IY67rxqJKxP4uyIrWahnfvRT+a5DlYLDMgIxUuy4SQe9t8ozFwrZ7C3n2QLfplyKG4U+BKTPnLpuDMHYmipJjDTp+P2c2sWJ9zxS5Z9J1R1BtBZhK20yhj2MOw2i0S5WcYFZUOEO8gIPcQDBynpB0bmTcVp1HXZMTk0fBXFim0r/zPcNJ234/FM8EuL0NIVyUPNQw6QKBurOJC+7mb4zIf2RkqcJoBphS46K+4aUEnczsuXkeOA74dY0j/kxv9UH5iRJ/XmWAsl6wkYBeO9MqDgs/W+Jv+UQ6TQtdYFjFUaF2FP9uUZ5Z1nRxPnt4pbp5N8PMY/p13BZir7nKG/VOLogFmMmtUWvuUMV6UzHvbpvJgWR7pT6GE/nRuqGPpX6xsyXXz1RTU1SeyZ1s9jLim6tb2TXIvTb/Sn/CRu+lScJcjYwe8zGhRMdyPUGTKGZYHU71kinogZtysyoQwS4hDvAg9vMIdPHp+gvszGZwb2v22nQqIl0h3GuPbPM4Y5P309RKCQ= 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)(396003)(376002)(346002)(136003)(451199021)(46966006)(36840700001)(40470700004)(34020700004)(44832011)(478600001)(81166007)(40480700001)(40460700003)(82740400003)(8936002)(5660300002)(8676002)(82310400005)(86362001)(6666004)(70586007)(47076005)(70206006)(7696005)(4326008)(6636002)(336012)(426003)(26005)(1076003)(2906002)(316002)(186003)(41300700001)(110136005)(36756003)(2616005)(36860700001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 08:40:06.1597 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22b91fbf-539d-46b1-7a0b-08db4d4453c7 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: DBAEUR03FT052.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8629 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 List-Id: This patch adds the binary_rshift_narrow_unsigned shape description. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_rshift_narrow_unsigned): New. * config/arm/arm-mve-builtins-shapes.h (binary_rshift_narrow_unsigned): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 48 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 49 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 88934e1ca15..e3bf586565c 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -664,6 +664,54 @@ struct binary_rshift_narrow_def : public overloaded_base<0> }; SHAPE (binary_rshift_narrow) +/* _t vfoo[_n_t0](_t, _t, const int) + + Vector saturating rounding shift right and narrow. + Check that 'imm' is in the [1..#bits/2] range. + + Example: vqshrunbq. + uint8x16_t [__arm_]vqshrunbq[_n_s16](uint8x16_t a, int16x8_t b, const int imm) + uint8x16_t [__arm_]vqshrunbq_m[_n_s16](uint8x16_t a, int16x8_t b, const int imm, mve_pred16_t p) */ +struct binary_rshift_narrow_unsigned_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, "vhu0,vhu0,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_unsigned, + 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_unsigned) + /* 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 d72686d187b..ca1c1017e8e 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -41,6 +41,7 @@ namespace arm_mve 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 binary_rshift_narrow_unsigned; extern const function_shape *const create; extern const function_shape *const inherent; extern const function_shape *const unary_convert; -- 2.34.1