From patchwork Fri May 12 09:38:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Lyon X-Patchwork-Id: 93052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4972810vqo; Fri, 12 May 2023 02:51:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6CtG0i5H9JFLTmA9beFqA24APeFXDjslsfqt9eX6fIJKgMnSY7J5c8aOzYNV9rJ7Ksnq4o X-Received: by 2002:aa7:df11:0:b0:505:4f7:8a50 with SMTP id c17-20020aa7df11000000b0050504f78a50mr17907524edy.5.1683885092439; Fri, 12 May 2023 02:51:32 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id g17-20020a056402181100b0050bfbad179asi7075497edy.274.2023.05.12.02.51.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 02:51:32 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=fRPbCS9m; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 A76B83855598 for ; Fri, 12 May 2023 09:44:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A76B83855598 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683884682; bh=eO0tlQWSvNGC5MKALFFPtPNsCuN2HXP1IZPdtE5cm0Y=; 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=fRPbCS9mztEsbJBeKPtxrvcErn811O0UlI7gxR0rWUaONHpt/65OtwUxfAxaRQVwl c0FIRB0+lOUz5WjN7gE0WTT7VNCxwjk+0hjj2Nk+Gs+rgm2VZNLDgBWKcnqzYJ8oif lmk+A7AuVQxOCk1TvpuOkSRqrhYL1EOtUajgrFqI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2069.outbound.protection.outlook.com [40.107.249.69]) by sourceware.org (Postfix) with ESMTPS id E465E385558A for ; Fri, 12 May 2023 09:39:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E465E385558A Received: from DUZPR01CA0175.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::19) by PAWPR08MB8936.eurprd08.prod.outlook.com (2603:10a6:102:340::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20; Fri, 12 May 2023 09:39:20 +0000 Received: from DBAEUR03FT026.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::1b) by DUZPR01CA0175.outlook.office365.com (2603:10a6:10:4b3::19) 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:20 +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 DBAEUR03FT026.mail.protection.outlook.com (100.127.142.242) 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:20 +0000 Received: ("Tessian outbound 3570909035da:v136"); Fri, 12 May 2023 09:39:20 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2cd2bb2e1a3817b6 X-CR-MTA-TID: 64aa7808 Received: from ac1b347065e1.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4ACAA154-257B-4DC0-B70D-ECCF30644627.1; Fri, 12 May 2023 09:39:13 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ac1b347065e1.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 12 May 2023 09:39:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UG3Z5dL92Qd6mTkXyAy+QJ/n1r1U6m2hY4U785oA4MO/zkHD6o9MoXeKwmrrjs+KyOmTC/rifvhv6sefPoiygDo03gi3DseZvTAl0WGUoaJ+ITY4n++4pSiUQwp1NtmpQWLDM8E91Zx9FGiCt/XZNCNCRX4Taj9PmUPXyljnbBFDdtR1Yhyw99muadaLr/bXFJYW9uCkFSsOLFcVnRLwENo7c83F1rp9oDMqIAXsN20tm/WIhQs7TaI8QmqepjFZCEvMHqVSf3AObSkPmB76VM6NeDzujfA83rEyC0x3leSFEssAgkoj1TyC/KPi8lGKi61B0MeLi70TGTh+al5Lcg== 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=eO0tlQWSvNGC5MKALFFPtPNsCuN2HXP1IZPdtE5cm0Y=; b=ZUh6+i4KvuT7EyuQNtyuazzynR69+eJdCE2ZmCE/d8XKhRkcrefcv0h9jZf8nbpOEj9YRmw6YpGq9WuhUx578fAmhgE7wjRX3gRp7oVdBZWOGNaz3p6EaekhoN4580oannQK8CckNyvj53a7N43yl3T28d2DA5z/v7e5WZ2p45L86iZ5GY+7HJ0sw37mkdjpHaxtjkeOmaHckQDo99sZoChR4fDWuysyu6JXPJ33cSU1onCmca25Prtsfx7IJFJwKXGqwGfZr+nNuO2NqUBcX8oXk9J+dVCE+o/J8CDNYKYk9PCAyECKA1spwdLBygzHbPIPn+Zxz3vetIO3gbjuqA== 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 AM0PR06CA0105.eurprd06.prod.outlook.com (2603:10a6:208:fa::46) by PA4PR08MB7548.eurprd08.prod.outlook.com (2603:10a6:102:26e::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:11 +0000 Received: from AM7EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:fa:cafe::59) by AM0PR06CA0105.outlook.office365.com (2603:10a6:208:fa::46) 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:11 +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 AM7EUR03FT006.mail.protection.outlook.com (100.127.141.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.22 via Frontend Transport; Fri, 12 May 2023 09:39:10 +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:38:59 +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:38:59 +0000 To: , , , CC: Christophe Lyon Subject: [PATCH 12/26] arm: [MVE intrinsics] add mvn shape Date: Fri, 12 May 2023 11:38:41 +0200 Message-ID: <20230512093855.79529-12-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: AM7EUR03FT006:EE_|PA4PR08MB7548:EE_|DBAEUR03FT026:EE_|PAWPR08MB8936:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f856a9c-5007-4130-ded7-08db52ccc2fe 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: sk+F3Z/U7RP71atlt8i+9GGKe7zXy1ErAEmoqatHrvU6yr0b8pr6xCm7VUeYQvQnVDZXyF/1Cs5HltJSyVfVoFdthRPQevbpCtJ4Phjn2ZkPzgslVhPRyyyjXfEE8tPw2qKeoqex6jx/0njyF01v9UVSdEkFg2GS2qx98GlkV/rv/AGblJHBJ1EsHO86vWBimTkhDN9LMUHxb31JA3xAyM57W1N5oXsknUbsFNlf6PpjKNTIICR3jbsc9POlebjxCMPAksVSBEo+c2Zag/1+VubyL90NkngwCkmbNAEIVocg1FbshdTCDO+wccfPK8A8PJ1mJKoAxRwcz1xBc34tf+Zh4sQ+DNq1tVpSD0MoBcBL74TVj85PweX6DoLRLr6qLddUNI5GDSC/zI7Uq2ju6DA1lSNIBNaxNDVq/gKUg9rA2hheFCO12m2XUZclplSqCyATWP7+5AvIqJcy1oaIVVE7lPgDAOAJ1dnPbepRbQR+W6ZcugHiAWV5MWJkPERihfjrEWEOMjOywrLTXdAtmueXBByVfI8OJs/M/MZYyBYKpudcuqlHiR3i6LR78k4vSieXEgpA0mKFZG6lPOB4B14XID86rCE3/DsxjrfZ4RSxuI17cYQcyJRukWD13x6NHo8E7+vaNoGFRn97UIrkL2OnNfjiBMAmt1Bcceke1DUUS6TJS5wJtzu7HlN2jeuK/ChZGPZk0Q3H0WVcR+x679rYq8AcJRaMElf9qfUVvokgyduVTQuzWIcIUZ2LW459 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)(376002)(346002)(136003)(39860400002)(451199021)(46966006)(36840700001)(2616005)(47076005)(426003)(336012)(36860700001)(41300700001)(4001150100001)(186003)(40480700001)(2906002)(82740400003)(5660300002)(70206006)(81166007)(6636002)(70586007)(8936002)(44832011)(26005)(316002)(356005)(4326008)(8676002)(1076003)(110136005)(86362001)(478600001)(36756003)(7696005)(82310400005)(6666004)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB7548 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: ebb83748-127e-436e-7ec0-08db52ccbd8a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AnQdFi3EBhKybOj569Xv4ykXbbK1Ki7lWOoplbxOzKk+U3wUst3rhb/kLsfBpBNbFDt/HM4VUbGRx/ugeum+bxIgDY+TBGwIP1mEL1/a3+ylMfsSGIp1AclvChKYNqkfC1RSeGMRVC5jN5448thYSYzZWskijF1oltfD1YjOMjqXQF0hjEI68LA6pmL5PxvEfxsFwzRmsrrSTzmsOCEEVtOHHIm3xIH6t1798CL3KB+e9PhfiIiruKb/QSS62+e9u9d36p/OUpX8GoahBY7HrNj6dkPF5xZvsqrKO1ulPxlX9dGlouGTpdGJkIgPlb/pavp6UywVyI2YYGAQktB7oZmtmRdXBpgwHn4mtjzedT2gc7f/JSTPV8RhlsWVZSy2OYLUzwjAmaRtkO1IlRf5P8ubBuJHaE0CTCD3GFKu18Z3Kf0/zOb0djqlvZm/ta8S5GSmoyPMJMpy/yczQFnhCzTqKajaA3UHj2XqrcNUHO7y8QMyBkphGYSlwzvvSpJPKgn1wNJXZI/Ot1kdzlzfMlROBEpCSEph8Hi3tZRz1WrHqn5/7Cd8XU9NrrRAOO3lSwtZ9Xg34Kwdz4zyRp1Q0m9w6GCLytG4czdOpUNKJJi537pWFCwOkK4ggbuiFKG1xAXjXUgQF45oiFuGFxExJ7F1uIl98CEmYd1ZtEwHFmz5BI8FR03b/Yy2unP2fHGLR/WNUmsi2N2KOzVgvfT/RkLS5OnN3Ngz/uOroUqapj8r0rGn7ONK9Uz29DFJ2GSQ 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)(376002)(136003)(39860400002)(346002)(396003)(451199021)(36840700001)(46966006)(40470700004)(6666004)(7696005)(8676002)(40460700003)(70586007)(82740400003)(6636002)(70206006)(36756003)(110136005)(2906002)(4326008)(4001150100001)(44832011)(41300700001)(86362001)(8936002)(82310400005)(81166007)(316002)(40480700001)(5660300002)(478600001)(1076003)(186003)(426003)(336012)(47076005)(36860700001)(2616005)(26005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2023 09:39:20.1190 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5f856a9c-5007-4130-ded7-08db52ccc2fe 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: DBAEUR03FT026.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB8936 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765681494915180700?= X-GMAIL-MSGID: =?utf-8?q?1765681494915180700?= This patch adds the mvn shape description. 2022-12-12 Christophe Lyon gcc/ * config/arm/arm-mve-builtins-shapes.cc (mvn): New. * config/arm/arm-mve-builtins-shapes.h (mvn): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 49 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 50 insertions(+) diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index c2e138c12e1..6401a79c570 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1297,6 +1297,55 @@ struct inherent_def : public nonoverloaded_base }; SHAPE (inherent) +/* _t vfoo[_t0](_t) + _t vfoo_n_t0(_t) + + For MODE_n, define only the 16 and 32 bits versions. + + Example: vmvnq. + int16x8_t [__arm_]vmvnq[_s16](int16x8_t a) + int16x8_t [__arm_]vmvnq_m[_s16](int16x8_t inactive, int16x8_t a, mve_pred16_t p) + int16x8_t [__arm_]vmvnq_x[_s16](int16x8_t a, mve_pred16_t p) + int16x8_t [__arm_]vmvnq_n_s16(const int16_t imm) + int16x8_t [__arm_]vmvnq_m[_n_s16](int16x8_t inactive, const int16_t imm, mve_pred16_t p) + int16x8_t [__arm_]vmvnq_x_n_s16(const int16_t imm, mve_pred16_t p) */ +struct mvn_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); + /* Do not build a separate instance for MODE_n, since we want to + share vmvnq_m[_n_s16] with vmvnq_m[_s16]. */ + build_all (b, "v0,v0", group, MODE_none, preserve_user_namespace); + build_16_32 (b, "v0,s0", 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 (1, i, nargs) + /* Same type for arg 0 and 1 if _m, so using 0 is OK */ + || (type = r.infer_vector_type (0)) == NUM_TYPE_SUFFIXES) + return error_mark_node; + + /* Skip last argument, may be scalar. */ + unsigned int last_arg = i; + for (i = 0; i < last_arg; i++) + if (!r.require_matching_vector_type (i, type)) + return error_mark_node; + + if (last_arg == 0) + return r.resolve_to (r.mode_suffix_id, type); + + return r.finish_opt_n_resolution (last_arg, 0, type); + } +}; +SHAPE (mvn) + /* _t vfoo[_t0](_t, _t, _t) i.e. the standard shape for ternary 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 bba38194ce2..ba53e8cc52e 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -59,6 +59,7 @@ namespace arm_mve extern const function_shape *const cmp; extern const function_shape *const create; extern const function_shape *const inherent; + extern const function_shape *const mvn; extern const function_shape *const ternary; extern const function_shape *const ternary_n; extern const function_shape *const unary;