From patchwork Fri May 5 16:49:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 90500 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp549407vqo; Fri, 5 May 2023 09:51:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6t/LwIgPGI9abC79z1cyACHp2xT7g1oeMFKIw4J9rG0WjCi0kHo1dkEPIOZRItvgxJHr9J X-Received: by 2002:a17:907:3609:b0:94f:4102:25c8 with SMTP id bk9-20020a170907360900b0094f410225c8mr1798177ejc.61.1683305496745; Fri, 05 May 2023 09:51:36 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id lf2-20020a170906ae4200b00965a191d5c7si1564656ejb.694.2023.05.05.09.51.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 09:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=MrJU+n9k; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A6581385416C for ; Fri, 5 May 2023 16:50:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6581385416C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683305431; bh=DDWQoRjCyOC6BSa8FrQuVeJXXMP0uf4a1PtX/SoFIcc=; 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=MrJU+n9kI+6YkkXl+Lye2m8U6TgyBWeh0WKxw3TOewRbNt8bD/vfTfsnSzrSV8/6W yYi/Y4toCQzf5qLifVlL0iXOyYFOruXh0kzxClVmNlpjZEYsgXLcGmsQV/K1M1FaOX th2JNJTBB6OgEMAwTdZ/ldKg0Wl3NU1VYlCR3qcM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2071.outbound.protection.outlook.com [40.107.7.71]) by sourceware.org (Postfix) with ESMTPS id 192313856940 for ; Fri, 5 May 2023 16:49:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 192313856940 Received: from AS9PR06CA0529.eurprd06.prod.outlook.com (2603:10a6:20b:49d::20) by DB9PR08MB8291.eurprd08.prod.outlook.com (2603:10a6:10:3dd::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.31; Fri, 5 May 2023 16:49:33 +0000 Received: from AM7EUR03FT050.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49d::4) by AS9PR06CA0529.outlook.office365.com (2603:10a6:20b:49d::20) 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 16:49:33 +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 AM7EUR03FT050.mail.protection.outlook.com (100.127.141.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.13 via Frontend Transport; Fri, 5 May 2023 16:49:33 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Fri, 05 May 2023 16:49:33 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 34b44c979954932d X-CR-MTA-TID: 64aa7808 Received: from 99ba2d2652ec.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AB1D2820-3E1C-4BD2-8EDE-79CD5AA32FD9.1; Fri, 05 May 2023 16:49:25 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 99ba2d2652ec.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 May 2023 16:49:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oaNTmrqvOsjrqC7+kjQX02dCBItOyK4oatr0d6oHtbM4nLdVn4WuDLu/+Btg9nlC0E0GmTmgQuUfPcXlQTUNVFtuFTFZk5P55yG0VN7LyCCDSGo2EYTAr0AWqTeIgHvbwqr0oRQUKcVnex6bSMSYEBt8SrKo/7XwQfk64kL3S3TxunsRpEZNZ8iMv0VbfLOI1dSkeDSyNL4F+aqCEpT4gV2Chugt+NGYBmzAPrA2hiBdOw1HukC1b2ZnlOtU9Ngkxs2r+9juyLO9nQ7S8DSMaL6iF8L4sg6TOoxitN/neEh2+GpORnavB29hyh5hTwSi6CBUK+sOhs+62F57JdQgPw== 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=DDWQoRjCyOC6BSa8FrQuVeJXXMP0uf4a1PtX/SoFIcc=; b=OBlZFEm3lp/tdJuu5j5wGsXDlW8pkSdzd6FPUq8RlBChsmcmmtY2RMXJPPmJoLMZgXzWF62Xnm/AI8G0YeWGfWJkEUTl+UsklZBViXA1zaUbJEvBWiIrBkWwjZjmbssU4N2FfcVJv9OaY9zNcgqLCqQtUj6SV7jhqTu/WCTbO97zFQX4AhIA4ntO3rlF7G66sPpAmcDBjR9mevpz1NGg80GLMbU66JUoAxH/FJ7YhFTGN0OxNt2kdXus1P8/a55JTStlqatb6SKkTyzjm1zLDy7bfOLQB5P7OvQaP8D6GuUseS6A7mtrMEMSh+iEEl3Bt4FcJcng5UMrJ/kzIda+kg== 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 DB6PR0501CA0035.eurprd05.prod.outlook.com (2603:10a6:4:67::21) by DU0PR08MB9130.eurprd08.prod.outlook.com (2603:10a6:10:474::9) 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 16:49:22 +0000 Received: from DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::b8) by DB6PR0501CA0035.outlook.office365.com (2603:10a6:4:67::21) 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 16:49:22 +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 DBAEUR03FT044.mail.protection.outlook.com (100.127.142.189) 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 16:49:22 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) 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 16:49:16 +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 16:49:16 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 05/10] arm: [MVE intrinsics] add binary_move_narrow and binary_move_narrow_unsigned shapes Date: Fri, 5 May 2023 18:49:01 +0200 Message-ID: <20230505164906.596219-5-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230505164906.596219-1-christophe.lyon@arm.com> References: <20230505164906.596219-1-christophe.lyon@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DBAEUR03FT044:EE_|DU0PR08MB9130:EE_|AM7EUR03FT050:EE_|DB9PR08MB8291:EE_ X-MS-Office365-Filtering-Correlation-Id: cf0116b4-5838-47d3-525a-08db4d88b3ed 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: Qd50Krsbt1O1i9iqSJOgwj1QpMVhbNZRD4+iMKrT+unSWk8og9Z6EYXuqzx9EqgLu7sRcww0HBJ7eqtaPi85xgmSN7hqHaC8mmDo26gE9JvntqQ+niNqjEwY8gGgbmE1VwnmMqdMyXeg9X8eY84m7h0nyfY5VT9XiynbbREGsHJD5n92icJV3Aj/AJMOyt4+7bE5WcZ6Plt5S/U3WMzwrWuPbawwPNEnT2uFaIdNVHWhLUYvQ4OGhhz7xzx2CeTzgsudCfAlEmmGO1qYhF5wRZLam9as2w9AXgs6AKGlzCzS1FvsvRBUKfXnzSJa4SOc4HNc8V1R0LwQeRCuk/OpgXrXo7NhCWiaRNMlAjEc43AlA1Z4cTuJYv8y5GN1y4+9h0DZ6Xp3ORi2BJ8qNGpuaHhuen2pCIsCHY3lxANboLLO9XcgYhgRZOpaFAHN834grVrBhOa4cPx1ejLM7jf3LDKl7fAhPh64yBfGtpyQLSqVcxxotfXfBmZcRBA0uFa2Ug6vZp7Z9KUR4GrRNPiRD77CRJ2E06mlUoxSAGZcTPEzHXTwtnMNDqaQ8EkSsJlyZ3RfEuDN0OBdPlM/i+xPpL4KbupdarCySEd6JupKxzxXK1V50imQaVvlEpdSOdl4w8GuP6MGzeEPQoTQPfiwuzQB3Q35v4nmErF3GA6/AXEMz8Lcmc+/NQuDcG7Nxh3bbJXheYxvuEh+VnHIqv2EKtOysvyZrTfKi0BwDc7tmW8= 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)(346002)(396003)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(6636002)(4326008)(44832011)(70206006)(41300700001)(70586007)(5660300002)(8936002)(8676002)(1076003)(26005)(110136005)(478600001)(316002)(6666004)(7696005)(2906002)(2616005)(47076005)(426003)(40460700003)(186003)(336012)(36860700001)(356005)(81166007)(82740400003)(40480700001)(82310400005)(86362001)(36756003)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9130 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 78d0db09-1a50-47c1-40bc-08db4d88ad5b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NVeEqJ7rr55RDqHtr2rGCofMrQ81Jj5W1PkGza7kj2JIIK+ssXU+bIASKxbNG3RoUcnQjE1yYmu6hFzy2tdL5jOpuS2LvcmEnEtyk3NwkuIVrB/DfXH0vuw1I/hKWVW5RJA9TbZz+v+aGzc/ScGQt3SYX47DUbju+t10M/4aBmJiYmfC4dQejG/+1Mu32JqVMqSPV0ZUqdMnSurDwqxI1u1MiuVWmyGfHd39OcVhD0Qa4bUQ2GGOfwvNVNQpzKH0It+sDizpN9VkzJHSv0tgaO0arv6judC39oYOPWB4leBOOGG5pEA6/oRyEaisBHL1Y40uFAnXhM5O2iulD4lyg9iCdA77e20SpDm2lNU6RsgrPq9GoSIblLyYPlmvNOHiU/DdCuhx/q/JRTZcOx25VNo4y3iLYH7Yqzy4W8U2ZKrW/VkgW14QixRBm8Dd9nTB/CSKT8Dq8FLH1XC4cyWvI80p4y2vCXk0g7G6LG8mhmAZT7LIFERwJO20mZqVxeVKqB32FCCU0SZe1y+sM+VvUpdWjRPkOVNpuljJgI0jP1aE80eIcRHhT6ntJ0mMuNxArusfMPfO+7ByD9LTNBaQWuylOrryLt+yBUp84q8OTQXDrWV6qfrnQa5U6yu3oWO3+q5mZShwnJkMHCHcMDEDcyQ3TJ3AVvbsuAeeNET6kAcK26oWpM5PuGpC0PnNqQ/eIdPIFv1Nm/8drcA93SWXRQ== 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)(346002)(376002)(396003)(136003)(451199021)(40470700004)(36840700001)(46966006)(86362001)(478600001)(6636002)(316002)(36756003)(7696005)(70586007)(4326008)(70206006)(110136005)(6666004)(8676002)(5660300002)(2906002)(44832011)(40480700001)(8936002)(186003)(82740400003)(81166007)(336012)(26005)(426003)(47076005)(82310400005)(1076003)(36860700001)(41300700001)(2616005)(40460700003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2023 16:49:33.2154 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf0116b4-5838-47d3-525a-08db4d88b3ed 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: AM7EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB8291 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765073744687961401?= X-GMAIL-MSGID: =?utf-8?q?1765073744687961401?= This patch adds the binary_move_narrow and binary_move_narrow_unsigned shapes descriptions. 2022-09-08 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (binary_move_narrow): New. (binary_move_narrow_unsigned): New. * config/arm/arm-mve-builtins-shapes.h (binary_move_narrow): New. (binary_move_narrow_unsigned): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 73 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 2 + 2 files changed, 75 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index 7d39cf79aec..e26604510a2 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -401,6 +401,79 @@ struct binary_rshift_def : public overloaded_base<0> }; SHAPE (binary_rshift) +/* _t vfoo[_t0](_t, _t) + + Example: vmovnbq. + int8x16_t [__arm_]vmovnbq[_s16](int8x16_t a, int16x8_t b) + int8x16_t [__arm_]vmovnbq_m[_s16](int8x16_t a, int16x8_t b, mve_pred16_t p) */ +struct binary_move_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_none, preserve_user_namespace); + build_all (b, "vh0,vh0,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES) + 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); + } +}; +SHAPE (binary_move_narrow) + +/* _t vfoo[_t0](_t, _t) + + Example: vqmovunbq. + uint8x16_t [__arm_]vqmovunbq[_s16](uint8x16_t a, int16x8_t b) + uint8x16_t [__arm_]vqmovunbq_m[_s16](uint8x16_t a, int16x8_t b, mve_pred16_t p) */ +struct binary_move_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_none, preserve_user_namespace); + build_all (b, "vhu0,vhu0,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + unsigned int i, nargs; + type_suffix_index type; + if (!r.check_gp_argument (2, i, nargs) + || (type = r.infer_vector_type (1)) == NUM_TYPE_SUFFIXES) + 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); + } +}; +SHAPE (binary_move_narrow_unsigned) + /* _t vfoo[_t0](_t, _t) _t vfoo[_n_t0](_t, _t) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index bd7e11b89f6..825e1bb2a3c 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -37,6 +37,8 @@ namespace arm_mve extern const function_shape *const binary; extern const function_shape *const binary_lshift; extern const function_shape *const binary_lshift_r; + extern const function_shape *const binary_move_narrow; + extern const function_shape *const binary_move_narrow_unsigned; extern const function_shape *const binary_opt_n; extern const function_shape *const binary_orrq; extern const function_shape *const binary_round_lshift;