From patchwork Fri May 12 09:38:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 69236 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 7160838D025A for ; Fri, 12 May 2023 09:45:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7160838D025A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683884721; bh=nihsl+iLDLGdTES/3KPLBWEtltN8YMgwjws7kautOEI=; 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=EsPAofaijHJBMMtUaXZDdv7pftN9Wc9LCuLOAUAbn4vnIktLva8MYriu1qr/AffPS 3Y+7DfhmdWqZVD0Vn+rSbD95ZE2YGwE+OqgLLwkp4elq6nXDsdzDPZ5ychb78IYxVW LZgp5WnUta4/hqltKrESIu8P46GP6yElskmBkucY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2070.outbound.protection.outlook.com [40.107.105.70]) by sourceware.org (Postfix) with ESMTPS id 3E7F8385414C for ; Fri, 12 May 2023 09:39:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E7F8385414C Received: from DB6PR0501CA0022.eurprd05.prod.outlook.com (2603:10a6:4:8f::32) by GV1PR08MB8619.eurprd08.prod.outlook.com (2603:10a6:150:83::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.19; Fri, 12 May 2023 09:39:23 +0000 Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:8f:cafe::4d) by DB6PR0501CA0022.outlook.office365.com (2603:10a6:4:8f::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Fri, 12 May 2023 09:39:23 +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 DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18 via Frontend Transport; Fri, 12 May 2023 09:39:23 +0000 Received: ("Tessian outbound 99a3040377ca:v136"); Fri, 12 May 2023 09:39:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4f962b8026394b6c X-CR-MTA-TID: 64aa7808 Received: from 478c02f6f2ff.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 432F9F73-D812-472B-9708-A3723803496E.1; Fri, 12 May 2023 09:39:16 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 478c02f6f2ff.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 May 2023 09:39:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDHWJccXnqNQbB8nvSad+Oq8BRY+nIYbNpxk60kut+0XMCLOns+/FPhZLjK8FOYhb6+DHmbmPIwwLp3Wafu+rJIuwmkx61qyZoo/7Dbb+DGMq5vYm2gl4bvpwkooSRcgkBDRn3YRXm4wWyDNEfqSD+2ck1hIQOo3+ZvsR5pl9XeOjfBXSM6biaVku2NqAAF02FjVktg/30smYw7udPjo19OCi3su05SK3qt6MfGkolPHC0mN/qw4kjWDNKRULW1rk2JfzfUoQV/Nb94PsFudm7dAderLMUymRDUCw88MeyRd4KWUly4p4en6HM6LkZz91DniO/FmnlCAI1EtSEMEXg== 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=nihsl+iLDLGdTES/3KPLBWEtltN8YMgwjws7kautOEI=; b=ElPPziAHNXt07g8iozWjj11qNpQex74QB16S+Q6ijB9rItHSqcmaM9vvDkH+ebrT4ms/wFXd7x4gY2s9t/y4z1a+b1WwLixsfE3h1WzD7BwnCNqPlgtM0fippVyBj57pqG0rjG+YbCCpBjKW1PTyqFitJm/vop97go9Vn0t0sMBvGF9RTB08Qi9sl03M66kl2nvyLgR0fcbpiIFF9z7bdScsQ0lICBDptriSA5++5UPuiY9QkFm5+eiL9TK1MxIMxVCs6QmWP9w++/Nx2oSBXPeK5ij6I/WpUTJ9k2axsWhamUdb7TI7j7U6GQdwD5ypGdPG349754mJeGwm95B+sQ== 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 AM8P251CA0013.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::18) by VI1PR08MB5439.eurprd08.prod.outlook.com (2603:10a6:803:13b::18) 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:14 +0000 Received: from AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:21b:cafe::cb) by AM8P251CA0013.outlook.office365.com (2603:10a6:20b:21b::18) 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:14 +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 AM7EUR03FT011.mail.protection.outlook.com (100.127.140.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.18 via Frontend Transport; Fri, 12 May 2023 09:39: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; Fri, 12 May 2023 09:39:03 +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:02 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 21/26] arm: [MVE intrinsics] add ternary_lshift shape Date: Fri, 12 May 2023 11:38:50 +0200 Message-ID: <20230512093855.79529-21-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: AM7EUR03FT011:EE_|VI1PR08MB5439:EE_|DBAEUR03FT013:EE_|GV1PR08MB8619:EE_ X-MS-Office365-Filtering-Correlation-Id: 8c6245ea-d6dd-414f-f88e-08db52ccc4c9 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: DkHPeeiGPtqvB7Ej8IUZ+SYg/SMDyWPTy+hO1Svo2uTJXnZ+HSwK0kWmI6LSx7NLDbrGiyQ3vkJlRKf8aLpkX/UqjpU7/8qL7g3MdIsaAkdeLxLrOd39d5K9bOTqZJb04WXZJKkHh/FAFip6ww+AP0DFJSsrJuG1GKKQO2WPLhh732pHuHNIYObGTlzAZau10Dhyl2QZH4Q5esHNapJYm4i1SRX/VZw28RrSYHIAGVORbAw3+2SK7F6M6DBDZ3yhcAac5DnI347z0bNsnuYQlIuU1jSbj8ftxqf6ZmB25to8W6gWwlz6HT9BSZ+vhiDIQkzSDBncK0wQRpMixSgVoU4DX5GVuGep7cfSWGsiiWTH6R4y4Smt14C1gWjly6zx22RaHUXCl4/U1V/KMJOXc1DC12WhGscBaDOtxdOy3arzRa6TF9lgn4nZIvXxURsRivTipbDG/En1BATzNRUNzcgJEH+1oFMJYbwbjxC/9KVDLJ2dGl7BmQOdyIC5odMNHanK979olpSWx+MdIOE2jgLrYlUVopE13rWndgA+78QFYIBeBm7e0v8JRPmk0/6n+588P+rY1xULifm90KUWwH8BdOUwX0WLF08VoNnkqgq1G/H8bzT1IR0xRYwzw5Mj8VM4KncfxBLLrnm9Rup7hfbHZDfWEwaYa46RldpCllpiZyvdhCHw/X8Q2XbHGivR0z+Zr4+Dg7FXYpybNj8utNZAxUxKu7wEa7pxpJl3SdQ3Wf4Zzei6qy4B0XdY9+R2 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)(396003)(346002)(39860400002)(376002)(451199021)(46966006)(36840700001)(36860700001)(336012)(426003)(2616005)(47076005)(186003)(40480700001)(70586007)(70206006)(41300700001)(81166007)(6636002)(356005)(44832011)(2906002)(5660300002)(8936002)(8676002)(1076003)(26005)(4326008)(316002)(82740400003)(110136005)(86362001)(478600001)(6666004)(7696005)(4001150100001)(82310400005)(36756003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5439 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 286a3850-f0fd-481a-3ae6-08db52ccbf5b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: idvG549TOGBA2YZRq7QZPHgSxKgKtNZH9HGDpEWnFb0iolaYtgL2RMz2d61Lam+cYvlX4+DuYnL+BdwnoVfhRnrC+hVJjfJc1M5SZb20AC28p7yLNd20JEK4SUmTTsD4VS1F8DQEiepNI3e2tZmbuc9E+6iWQVAfl9daDu46AoPPhMRwAFbdOc0/R0rAxnbwAKR3ZrSnpUrpv4SCVm+A3knV4ykw0dXXgGiUr0EkRPJofpXhE4w1kE14ykMthKAIvWIEl03DY9E7e4iE5pjKE6JsU3RituoRuxKEvj/tl0Rsn6OX3pwko68BIHlH5UTyvU9JbjvDKCd+ThBOEFkdP3x39qJeoNST79zKjtigTYA70qDk2ifxbIyC4eumLavFgh1G0Nkxfc2R0NlyrcQV5/vJ2aw5N7CnTClH6qA2LLlQciY8hAUyqoeiNDJ3KAGKnN6TA76EVIKvJ/B1W6NAwfAYZbYAssrKaO9YT+J5Lch6wO32OsrEpdTsbBcpGLr+V8eulkYU++xp4H88ZH8ArW0Z7myjivB2r+cLFWwO/2ebOZOst1qfX3ZKKw6DT0nvoCIzPueKMY2sG6PojxnSMPZkwGimePWHyd+4QjrOW6G1xe+6SxoNqjpOG8R3xR057ztHxm1Y2WDxRSdaYyBVjLV2drTf2qCrdQ5MJTEEEizbb1db2RRt055SONMCfMp9JsPCvDOfWkczZbxzcFoQFkxxGUIxj0SaUwf9/1z2vQfCa69wromMNLD5Tq45uLAW 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)(36840700001)(46966006)(40470700004)(41300700001)(40460700003)(2906002)(40480700001)(336012)(47076005)(478600001)(426003)(70206006)(4001150100001)(2616005)(36860700001)(70586007)(6666004)(186003)(110136005)(6636002)(4326008)(316002)(26005)(5660300002)(1076003)(7696005)(8676002)(44832011)(8936002)(82740400003)(82310400005)(36756003)(81166007)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 09:39:23.1277 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c6245ea-d6dd-414f-f88e-08db52ccc4c9 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: DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8619 X-Spam-Status: No, score=-12.7 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 ternary_lshift shape description. 2022-12-12 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (ternary_lshift): New. * config/arm/arm-mve-builtins-shapes.h (ternary_lshift): 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 012cf3ef4c0..a8e94b4f8f8 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1372,6 +1372,44 @@ struct ternary_def : public overloaded_base<0> }; SHAPE (ternary) +/* _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 [0..#bits-1] range. + + Example: vsliq. + int16x8_t [__arm_]vsliq[_n_s16](int16x8_t a, int16x8_t b, const int imm) + int16x8_t [__arm_]vsliq_m[_n_s16](int16x8_t a, int16x8_t b, const int imm, mve_pred16_t p) */ +struct ternary_lshift_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, 0, bits - 1); + } +}; +SHAPE (ternary_lshift) + /* _t vfoo[_n_t0](_t, _t, _t) i.e. the standard shape for ternary operations that operate on a diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index 6e818092a87..73375186d82 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -61,6 +61,7 @@ namespace arm_mve extern const function_shape *const inherent; extern const function_shape *const mvn; extern const function_shape *const ternary; + 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 unary;