From patchwork Fri May 12 09:38: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: 69231 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 8DF0A3815FDB for ; Fri, 12 May 2023 09:44:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8DF0A3815FDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683884648; bh=qJgIykeGs2OCn9NTydR8V+Rtioo78iDF+s4oqUDj3TI=; 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=qDRwmIpZRFGGX6JyIjwi1ID2sLHd+o+0D9zPbMAIP08hhoFPJt0ISZq3deyP4kWJv hwEwGT+bKeJ7A2r8IwWDEIEYtrG8IT8DdqQVwLGNEAHa3WUHPumtgrsEOxxV7ijpCJ CC+HOI5GiP39opCy5yIvOmBuwFekxBD+BKGRUesw= 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-dbaeur03on2041.outbound.protection.outlook.com [40.107.104.41]) by sourceware.org (Postfix) with ESMTPS id C222C3853814 for ; Fri, 12 May 2023 09:39:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C222C3853814 Received: from AM0PR02CA0175.eurprd02.prod.outlook.com (2603:10a6:20b:28e::12) by AS8PR08MB9145.eurprd08.prod.outlook.com (2603:10a6:20b:57c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.23; Fri, 12 May 2023 09:39:30 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:28e:cafe::ac) by AM0PR02CA0175.outlook.office365.com (2603:10a6:20b:28e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.23 via Frontend Transport; Fri, 12 May 2023 09:39:30 +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 AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.22 via Frontend Transport; Fri, 12 May 2023 09:39:29 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 12 May 2023 09:39:29 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2368e48d5d1c9147 X-CR-MTA-TID: 64aa7808 Received: from 94208f6501f5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 08533297-71FA-4761-9F49-DE5250070A1A.1; Fri, 12 May 2023 09:39:18 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 94208f6501f5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 May 2023 09:39:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zt7XAwpbExUJ3ygdHG7J+eKk1J4MwGHfA0C7IJYWqu70Jbyrd72B+RPmwKsG5cUu6uiAj6L/1IAl+VPGKUdmTGN7LSkZi5+yB/Og3gUssrLi83+5ajBrxh1uI5uYYK2+mvofgLUGsS6BT8fEDy0/Nb5Wb2AHZ1znIN1Wby4qe8hmxMjp9uK5hlXY8Seh76nhPIiOimzV1wyOzQLU0up4dNe5WGY7oH5bUKOW5V6WjGi/+UE2azKuVO+kvmlbckSUKMQWCaeG2uHPz7fSSimrZFlo+KLxmeIl6JYcxuW20QSy3KHFqusFJUHjJq7cw+Or7iDTUzuqzr47jspQ5msWsA== 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=qJgIykeGs2OCn9NTydR8V+Rtioo78iDF+s4oqUDj3TI=; b=GkjmR87v0w6cOq5JhiocrjHCrOC9tfScAHoItPyhMzYV+NteN/09iVXepnm/veJD0xh38dmD4vMlTny4GSeQsXTuOSO6mx2zqcWjgqV90JzgmFNejJ2niJQ+cuPgt+AZrMdwBRTh0PeaO2LX0AZel9FiOD8JM5oY3XedeURKrK4UOu45sM/i974WCz9fG18hwLsjAwcMQ84E+WyiOdHWyluXWc0YUbrNAKrJ6xGhI4V/xog51BNsg1ujs4/Xr8uae1D7W2jT5ZtfprtHPfh/Oe5Ai/jjbuKcR3j9Efb3MLwVzu75suuaXjygVylr46hE0Zy7xV1EvFeTEF5wcOuJQg== 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 AS9PR06CA0459.eurprd06.prod.outlook.com (2603:10a6:20b:49a::8) by DB9PR08MB7724.eurprd08.prod.outlook.com (2603:10a6:10:393::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Fri, 12 May 2023 09:39:16 +0000 Received: from AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::1e) by AS9PR06CA0459.outlook.office365.com (2603:10a6:20b:49a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.24 via Frontend Transport; Fri, 12 May 2023 09:39:16 +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 AM7EUR03FT039.mail.protection.outlook.com (100.127.140.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.24 via Frontend Transport; Fri, 12 May 2023 09:39:16 +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; Fri, 12 May 2023 09:39:04 +0000 Received: from e129018.arm.com (10.57.21.161) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 12 May 2023 09:39:03 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 24/26] arm: [MVE intrinsics] add ternary_rshift shape Date: Fri, 12 May 2023 11:38:53 +0200 Message-ID: <20230512093855.79529-24-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230512093855.79529-1-christophe.lyon@arm.com> References: <20230512093855.79529-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT039:EE_|DB9PR08MB7724:EE_|AM7EUR03FT009:EE_|AS8PR08MB9145:EE_ X-MS-Office365-Filtering-Correlation-Id: aa2cbb98-9065-4992-182e-08db52ccc8e5 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: cU8joh7oK7fBmkLzfx7uHprXHQeH30sSbX8tztI6UH+xBK8kZ7Kw+QAuaibEHJtXVfrUsHTDfxSAhyVa6TY6DugQS4J16IxNsMMWghaZTd7CX8mmGsj2HCT2TvMJdgvxv7v7TlSlt0fHMN7WrHtgAC0DAcGu8xqEw1AhdJXDWXYTkoL6EkWNf4n6dPsrJR8iTH2UNvJuDiv5Gz25Q9WajlhtbmBDsg5XiyHE6w5RkRnDbf6u3vxy7cjy3ty16esvDwOuxrRmXy7zc9fZrgfFCTziBNATDcB1P/jpfPQgTa2hJCk25ckXKU2eEgTvaCyf3kdv76ZnfNNRBFOP41g3bgfX5JL/pcAWbNK/dJKu7VihAi3VKYjBrvQGkKqbjkuv5KvZfoL7G0A0bB4xMn8wWbMyY4BivocPqzEfwZEwfgW1HtkQalrZWB7cH7Y8tI5RquKjcoW4sVWMICIv4sG1LZCuulVZ94vyqGd4PAjgDtQ2otyik+HUcTrzzsrhFBA1Aa5RPmWv5Dshc1SUKPtSWEX1nevp6JLdYn4PsArw4CLOc1PdOybH54pv736SLystxZrPzu9s/ESODnrWaSMJnRXIp8VeZgg2lkYxa6x3043QDLbQUM6Yyc6xfIghS6rRBdSBja9bYkXHkdHR5iCZwVUDgQlj25z3gJ+4OTjZlos5gu2pe9TJ8FpLvnobVaAVgDhVxxeaGYX3mOPI8umuRFouLkrC39FsoNwK4m89+t4= 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)(376002)(39860400002)(396003)(346002)(136003)(451199021)(46966006)(40470700004)(36840700001)(36860700001)(40460700003)(36756003)(6666004)(47076005)(426003)(478600001)(70206006)(110136005)(6636002)(336012)(70586007)(4326008)(2616005)(1076003)(186003)(7696005)(26005)(316002)(2906002)(40480700001)(82310400005)(4001150100001)(41300700001)(82740400003)(356005)(81166007)(44832011)(5660300002)(86362001)(8676002)(8936002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7724 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: dd89f50c-1ac4-4ee5-510d-08db52ccc0bc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MNzQ2EuORIhP/zuB9ttfJwfsC/6wVIlR5kbOQHMO786EIVzt1Cbqleo/d5EESAMBrYFW37fO07WLJ4X7pfw76FEzODBlEbtz+/uuIcBS5nMoqPFzvmhTkfOFzYK7klaUYkcy5P8vOTvnF6f1kzkzmqKDwSUNjZJZiYuYDb9Z43aVTmTdQDoeZNdKb7yihNlnk6TolmLJ/bX5Cqu15t+OwzqvSo1vmMdVVHrnOroZRrddchDlilS04Xmz1IvVFIdN5pcpaWlLpDYEv0NrZBqfLqb4hGdYrH9jg8khB5MAMZTznGQYsynH/jzg0wogBZb945jY3Q3kjWoc2Hb7eMuMCPwhLiw0EckjXrYJp27xC/gBYXnFQyA2N8n66Pq59NfGWhKp0vOciOpvjS9XOfCJ99MOcvuPmEomyTnOw8KnlZpN4m6uQpnP8iAMQyAegyfQfjs5Yqv6sfqs9B9JOSwLlPgudgEeDDLjdOKAYSO02HFA2ZNwtriVmvEq8MtRR7Pa9+iHevq9DdLwLreQWcnrog5CS/PVMn+bBJRAdYcrkep4ZHxE+1qwwBfJzAqgHP73DEu2xsAwDgJzscR87Oo1br77b633JGL9PTKjx6fXllq1hvxzS4VVpujUIGLafHv8x+KzTz1MoCpIla7C00x4AE8yZoHpGDXDWoeito0WuOy+Lp+wOFh63CVdzSsUXTFxsza+sh66NCpyKtshCzVvbV65yJaADq/EbauPL7yjbRFPWSY4Heks7v7+l2PLcEEw 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)(39860400002)(136003)(376002)(451199021)(40470700004)(46966006)(36840700001)(81166007)(82740400003)(40480700001)(36756003)(40460700003)(86362001)(82310400005)(5660300002)(44832011)(8936002)(8676002)(26005)(1076003)(186003)(4001150100001)(2906002)(70206006)(2616005)(70586007)(478600001)(110136005)(6666004)(6636002)(4326008)(316002)(41300700001)(7696005)(36860700001)(47076005)(336012)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 09:39:29.9851 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa2cbb98-9065-4992-182e-08db52ccc8e5 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: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9145 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, 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: 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 ternary_rshift shape description. 2022-12-12 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (ternary_rshift): New. * config/arm/arm-mve-builtins-shapes.h (ternary_rshift): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 38 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 39 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index a8e94b4f8f8..d4c30ed2e8c 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1467,6 +1467,44 @@ struct ternary_opt_n_def : public overloaded_base<0> }; SHAPE (ternary_opt_n) +/* _t vfoo[_t0](_t, _t, const int) + + i.e. ternary operations that operate on a pair of vectors of the + same type as the destination, and take a third integer argument. + + Check that 'imm' is in the [1..#bits] range. + + Example: vsriq. + int8x16_t [__arm_]vsriq[_n_s8](int8x16_t a, int8x16_t b, const int imm) + int8x16_t [__arm_]vsriq_m[_n_s8](int8x16_t a, int8x16_t b, const int imm, mve_pred16_t p) */ +struct ternary_rshift_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, "v0,v0,v0,ss32", group, MODE_n, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + return r.resolve_uniform (2, 1); + } + + bool + check (function_checker &c) const override + { + if (c.mode_suffix_id != MODE_n) + return true; + + unsigned int bits = c.type_suffix (0).element_bits; + return c.require_immediate_range (2, 1, bits); + } +}; +SHAPE (ternary_rshift) + /* _t vfoo[_t0](_t) i.e. the standard shape for unary operations that operate on diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 73375186d82..a1842f5845c 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -64,6 +64,7 @@ namespace arm_mve extern const function_shape *const ternary_lshift; extern const function_shape *const ternary_n; extern const function_shape *const ternary_opt_n; + extern const function_shape *const ternary_rshift; extern const function_shape *const unary; extern const function_shape *const unary_acc; extern const function_shape *const unary_convert;