Message ID | 20230510133036.596530-15-christophe.lyon@arm.com |
---|---|
State | Committed |
Commit | 7e3c2d23cfdc479d5022fa4de56841bd032e915b |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 0250F3829BCF for <patchwork@sourceware.org>; Wed, 10 May 2023 13:33:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0250F3829BCF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683725581; bh=Gxsjh26il0b8W7cvEzU0l2TSmfrHBS+nWm9JRESHX5A=; 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=aVq/5rwliWQcqgrdDKNxof5WS2wS5givciAS1dycnn2W+vDXSw+R8gvll3muPBknE GFbyjkhcb1UpyOsMexN1LZJ40a97RkaZAKODFhhc0DoHAqg+C5HRyLJzewUlx9oaI2 1r1WFUKaCTCjfy05y4NQdJlOKAlcibQbRHX2v8xQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2053.outbound.protection.outlook.com [40.107.14.53]) by sourceware.org (Postfix) with ESMTPS id 104F23853550 for <gcc-patches@gcc.gnu.org>; Wed, 10 May 2023 13:31:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 104F23853550 Received: from DB6PR07CA0195.eurprd07.prod.outlook.com (2603:10a6:6:42::25) by AS2PR08MB9569.eurprd08.prod.outlook.com (2603:10a6:20b:60b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.32; Wed, 10 May 2023 13:31:06 +0000 Received: from DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:6:42:cafe::fc) by DB6PR07CA0195.outlook.office365.com (2603:10a6:6:42::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.18 via Frontend Transport; Wed, 10 May 2023 13:31: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 DBAEUR03FT039.mail.protection.outlook.com (100.127.142.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.19 via Frontend Transport; Wed, 10 May 2023 13:31:06 +0000 Received: ("Tessian outbound 3570909035da:v136"); Wed, 10 May 2023 13:31:06 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1d5541455cde890a X-CR-MTA-TID: 64aa7808 Received: from e33ffe5bbe1c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EF985262-2733-4B0F-B7F1-8B1E4578A978.1; Wed, 10 May 2023 13:31:00 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e33ffe5bbe1c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 10 May 2023 13:31:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j5C1Lo/bomI/Ik4VshpsE2Jf8E2Cxv16c02oZNM8d9aDGgf+MugKjheHAXciXIXOAjMovo1ITm4pGY+pMGyIiGpEFBkVNJo4enZtxout6gkP3ciI1NIwuZ4UPf7YgWkNPYLk5BaHhnGz82tXNT1xl3kN8wlw2L0EqcptIJhGWXdDUVSOUDXq/N94pEF0cHJClWyq+jilKoCRf8JXt+ISuLgegXLSDUQpau0j7gcUQefEx9ghs5Y1TI0/EvbLFGOKiVA5CCo6OqmR5P3sZEvlcODR1qoKXWWr2INAF2QDeAWCs/ehfrO6HsDd/KiU/wkvu8tykJFaUA73KuhBuJ/rzQ== 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=Gxsjh26il0b8W7cvEzU0l2TSmfrHBS+nWm9JRESHX5A=; b=esSK1p3TWMVnYTnjgLSSNLu0qTSixJiG4LHgqF30t4pvaW3WiLGAbQYFa2O/lp4BLwoAs95VhyEMvp3oAwzeq35oCV8jHmCZ81ZZy8IJBT9lRhL18Jor909bpjN5Z9m1rxH8tetzNMYmsbquLXlbnmhu962mxng9oKb0Ye+wYR/ZJ/IAR73659LAGiAaRuU4sT1DiyQBpgrNAvJxdfZvRt8ECrlT6peDfASOqKQIeN/dadvWVNUTad+WdxaRdAdTkUBr1Fz3emaSQe3t3rqIlC0CBUCF/NUZqmFbJghfoXN4HQDhoEF6yKqhv5DmT4x/JzjpF3hDvZ9246NW1FdcEQ== 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 AM8P190CA0001.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::6) by PA4PR08MB6014.eurprd08.prod.outlook.com (2603:10a6:102:ee::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Wed, 10 May 2023 13:30:53 +0000 Received: from AM7EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:219:cafe::55) by AM8P190CA0001.outlook.office365.com (2603:10a6:20b:219::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33 via Frontend Transport; Wed, 10 May 2023 13:30:53 +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 AM7EUR03FT057.mail.protection.outlook.com (100.127.140.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6387.20 via Frontend Transport; Wed, 10 May 2023 13:30:52 +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; Wed, 10 May 2023 13:30:47 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) 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; Wed, 10 May 2023 13:30:47 +0000 Received: from e129018.arm.com (10.57.23.51) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Wed, 10 May 2023 13:30:46 +0000 To: <gcc-patches@gcc.gnu.org>, <kyrylo.tkachov@arm.com>, <richard.earnshaw@arm.com>, <richard.sandiford@arm.com> CC: Christophe Lyon <christophe.lyon@arm.com> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape Date: Wed, 10 May 2023 15:30:31 +0200 Message-ID: <20230510133036.596530-15-christophe.lyon@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230510133036.596530-1-christophe.lyon@arm.com> References: <20230510133036.596530-1-christophe.lyon@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT057:EE_|PA4PR08MB6014:EE_|DBAEUR03FT039:EE_|AS2PR08MB9569:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bb0fb49-81e0-4061-39aa-08db515acf2d 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: DsFaE6FZV7rU6cGrakZBs5FEsr7r9Ipm7mOCSgmk3TcI/sZfMHquah5b4zw6mQfxtyfqKKTqWj8d96Sdl1MZ/VsVaZzYngX/NjcUKlZpmns4IaS2RrWRB2Yt9GG7ELzQNhVWKFKdm3PL2gaMU1Alfj1eclfGtl/6tuyQ59cgyRmi1rIVV65vAbd55DTj35tIQQLTSrb3Z0DUJxo8Pnqv4w+K1RQ7p362+Xa4nIQdMNxfm2HSTAmZVLftnei1dgntoYXi72rFd8ceZVv0ahMikNI/BUaBC4Rc6YTRAKG/XkdM3anQ2dOShxZuNQyGbrzvASgKVs/SIWTXKCL0NBwyVf7+WZbFY+wi7xwmXshOCPX3dAdeS7kOrMPwFFZdyxrTKJGHLqV3rmSeuE+Re5J0wUwF0U3FgFoYRxxfoLEwfTHaMM9obhwgo1MhSn1Izo8Q2aWwudz4YCZutC2KuTtojjQfU9XtZU5ZnnI47Xdnb54xjCTTVkAWbH57Aht2AGb9Dqv5PN8e7kaxDft2F4d/XPhp9nMe6+9VZGeRwYaBeWjNPnFbQ7VMypa9oqWj7/rhyrqCmmyEoIEaQ/TlH4PLktfifkaHiKByaZuYsJ1JB0gQA2fKvcd8fi9aErrz7QxBAPfvsnZ7oJM5c38cp4B1GB/RpCkzizDqvjNEJ8w7U11lp7MNM998dzsyp26UF9JPa+oN8BBWt0stvYors3dgfcRuRLCPrilOJCUoZym/yqk= 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)(136003)(346002)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(36860700001)(36756003)(7696005)(40460700003)(82310400005)(82740400003)(41300700001)(86362001)(356005)(2906002)(40480700001)(4001150100001)(5660300002)(336012)(8676002)(44832011)(81166007)(8936002)(70206006)(6636002)(316002)(70586007)(4326008)(478600001)(426003)(47076005)(186003)(6666004)(110136005)(26005)(1076003)(2616005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6014 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b0a98ff2-701e-481f-f32f-08db515ac6f4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AfvsWeF4E/XW2oxw4bHMqpOkqE3QGtTXjDEem+5oefAXQd5rIFelGK//6EMqTJoMl/gumzTIeZN4yPr+OV8iu12RMbQztePH863LuFyqeOa+Ss3FNRizh/OtUEIoawYDxrdPGMyY5UBvHZkviWrG/mr9zqFte2g0wGLA42MhOjlZ8iWgSSRFCK9i1vYkLe/3gqiPc0iu4eU7qJwCdx3Ivaw0QxmXV6F3obQgH1o2IG40HIY26TZbu2pdjvId3ULvyK9lObCYGKRgxpWXwgMWp76FlE3bUj8y6PMDY1bzuRAiZnxRfU5HCIbQfNyVSBSB0xisWdthHU1x/oDZ3qfKRkDMvDYjmaykPUNc6s1ZxAfWb8kOvpJQTcOObXtG90mVQmz9hphQfsqf5zyI3Rpd+1016A/c08EEOa6M5zitf6QK1nFjTs2sAHyiDpL2nuauCgWjj1h+2CaYL3wCYuoU7uJL1DFfhbP/PrANvTMuCiH1BwRas0xj2S4v3EQxT6tDOqd+PMKzHmUe9Qy5G1LM3/qPLTQhR653drvsIJJgGVpQRR3PxGRh7TZMw4NZZlILSN/nKzO0rNs1j6Vufl/NGD/sj84lZv35IwhI/QpnDyGByqK35glNJQFHnrdlBKORd4EyB69oZzUA+6ORWM3RQSpNEvbpNOehsiZPQ1rLzfgdBx4Lg3WSyLPjIO1k03nIWs7WUGAM+GXeHnEQWhRhUg== 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)(136003)(376002)(396003)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(4001150100001)(4326008)(8676002)(2906002)(8936002)(5660300002)(478600001)(316002)(41300700001)(110136005)(6636002)(6666004)(70586007)(70206006)(44832011)(86362001)(47076005)(1076003)(26005)(186003)(82740400003)(7696005)(40460700003)(36860700001)(426003)(36756003)(2616005)(336012)(40480700001)(82310400005)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2023 13:31:06.7655 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4bb0fb49-81e0-4061-39aa-08db515acf2d 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: DBAEUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9569 X-Spam-Status: No, score=-12.6 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Christophe Lyon via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Christophe Lyon <christophe.lyon@arm.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[01/20] arm: [MVE intrinsics] factorize vcmp
|
|
Commit Message
Christophe Lyon
May 10, 2023, 1:30 p.m. UTC
This patch adds the unary_acc shape description. 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> gcc/ * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. --- gcc/config/arm/arm-mve-builtins-shapes.cc | 28 +++++++++++++++++++++++ gcc/config/arm/arm-mve-builtins-shapes.h | 1 + 2 files changed, 29 insertions(+)
Comments
> -----Original Message----- > From: Christophe Lyon <christophe.lyon@arm.com> > Sent: Wednesday, May 10, 2023 2:31 PM > To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; > Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford > <Richard.Sandiford@arm.com> > Cc: Christophe Lyon <Christophe.Lyon@arm.com> > Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape > > This patch adds the unary_acc shape description. > > 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> > > gcc/ > * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. > * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. > --- > gcc/config/arm/arm-mve-builtins-shapes.cc | 28 +++++++++++++++++++++++ > gcc/config/arm/arm-mve-builtins-shapes.h | 1 + > 2 files changed, 29 insertions(+) > > diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm- > mve-builtins-shapes.cc > index bff1c3e843b..e77a0cc20ac 100644 > --- a/gcc/config/arm/arm-mve-builtins-shapes.cc > +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc > @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> > }; > SHAPE (unary) > > +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) > + > + i.e. a version of "unary" in which the source elements are half the > + size of the destination scalar, but have the same type class. > + > + Example: vaddlvq. > + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) > + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ > +struct unary_acc_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, "sw0,v0", group, MODE_none, preserve_user_namespace); > + } > + > + tree > + resolve (function_resolver &r) const override > + { > + /* FIXME: check that the return value is actually > + twice as wide as arg 0. */ Any reason why we can't add that check now? I'd rather not add new FIXMEs here... Thanks, Kyrill > + return r.resolve_unary (); > + } > +}; > +SHAPE (unary_acc) > + > /* <T0>_t foo_t0[_t1](<T1>_t) > > where the target type <t0> must be specified explicitly but the source > diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm- > mve-builtins-shapes.h > index fc1bacbd4da..c062fe624c4 100644 > --- a/gcc/config/arm/arm-mve-builtins-shapes.h > +++ b/gcc/config/arm/arm-mve-builtins-shapes.h > @@ -53,6 +53,7 @@ namespace arm_mve > extern const function_shape *const create; > extern const function_shape *const inherent; > extern const function_shape *const unary; > + extern const function_shape *const unary_acc; > extern const function_shape *const unary_convert; > extern const function_shape *const unary_int32; > extern const function_shape *const unary_int32_acc; > -- > 2.34.1
On 5/10/23 16:52, Kyrylo Tkachov wrote: > > >> -----Original Message----- >> From: Christophe Lyon <christophe.lyon@arm.com> >> Sent: Wednesday, May 10, 2023 2:31 PM >> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; >> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford >> <Richard.Sandiford@arm.com> >> Cc: Christophe Lyon <Christophe.Lyon@arm.com> >> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >> >> This patch adds the unary_acc shape description. >> >> 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> >> >> gcc/ >> * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. >> * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. >> --- >> gcc/config/arm/arm-mve-builtins-shapes.cc | 28 +++++++++++++++++++++++ >> gcc/config/arm/arm-mve-builtins-shapes.h | 1 + >> 2 files changed, 29 insertions(+) >> >> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm- >> mve-builtins-shapes.cc >> index bff1c3e843b..e77a0cc20ac 100644 >> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc >> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc >> @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> >> }; >> SHAPE (unary) >> >> +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) >> + >> + i.e. a version of "unary" in which the source elements are half the >> + size of the destination scalar, but have the same type class. >> + >> + Example: vaddlvq. >> + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) >> + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ >> +struct unary_acc_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, "sw0,v0", group, MODE_none, preserve_user_namespace); >> + } >> + >> + tree >> + resolve (function_resolver &r) const override >> + { >> + /* FIXME: check that the return value is actually >> + twice as wide as arg 0. */ > > Any reason why we can't add that check now? > I'd rather not add new FIXMEs here... I understand :-) That's because the resolver only knows about the arguments, not the return value: /* The arguments to the overloaded function. */ vec<tree, va_gc> &m_arglist; I kept this like what already exists for AArch64/SVE, but we'll need to extend it to handle return values too, so that we can support all overloaded forms of vuninitialized (see https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616003.html) I meant this extension to be a follow-up work when most intrinsics have been converted and the few remaining ones (eg. vuninitialized) needs an improved framework. And that would enable to fix the FIXME. Thanks, Christophe > Thanks, > Kyrill > >> + return r.resolve_unary (); >> + } >> +}; >> +SHAPE (unary_acc) >> + >> /* <T0>_t foo_t0[_t1](<T1>_t) >> >> where the target type <t0> must be specified explicitly but the source >> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm- >> mve-builtins-shapes.h >> index fc1bacbd4da..c062fe624c4 100644 >> --- a/gcc/config/arm/arm-mve-builtins-shapes.h >> +++ b/gcc/config/arm/arm-mve-builtins-shapes.h >> @@ -53,6 +53,7 @@ namespace arm_mve >> extern const function_shape *const create; >> extern const function_shape *const inherent; >> extern const function_shape *const unary; >> + extern const function_shape *const unary_acc; >> extern const function_shape *const unary_convert; >> extern const function_shape *const unary_int32; >> extern const function_shape *const unary_int32_acc; >> -- >> 2.34.1 >
> -----Original Message----- > From: Christophe Lyon <Christophe.Lyon@arm.com> > Sent: Thursday, May 11, 2023 9:21 AM > To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; gcc-patches@gcc.gnu.org; > Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford > <Richard.Sandiford@arm.com> > Subject: Re: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape > > > > On 5/10/23 16:52, Kyrylo Tkachov wrote: > > > > > >> -----Original Message----- > >> From: Christophe Lyon <christophe.lyon@arm.com> > >> Sent: Wednesday, May 10, 2023 2:31 PM > >> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; > >> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford > >> <Richard.Sandiford@arm.com> > >> Cc: Christophe Lyon <Christophe.Lyon@arm.com> > >> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape > >> > >> This patch adds the unary_acc shape description. > >> > >> 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> > >> > >> gcc/ > >> * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. > >> * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. > >> --- > >> gcc/config/arm/arm-mve-builtins-shapes.cc | 28 > +++++++++++++++++++++++ > >> gcc/config/arm/arm-mve-builtins-shapes.h | 1 + > >> 2 files changed, 29 insertions(+) > >> > >> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc > b/gcc/config/arm/arm- > >> mve-builtins-shapes.cc > >> index bff1c3e843b..e77a0cc20ac 100644 > >> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc > >> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc > >> @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> > >> }; > >> SHAPE (unary) > >> > >> +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) > >> + > >> + i.e. a version of "unary" in which the source elements are half the > >> + size of the destination scalar, but have the same type class. > >> + > >> + Example: vaddlvq. > >> + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) > >> + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ > >> +struct unary_acc_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, "sw0,v0", group, MODE_none, > preserve_user_namespace); > >> + } > >> + > >> + tree > >> + resolve (function_resolver &r) const override > >> + { > >> + /* FIXME: check that the return value is actually > >> + twice as wide as arg 0. */ > > > > Any reason why we can't add that check now? > > I'd rather not add new FIXMEs here... > > I understand :-) > > That's because the resolver only knows about the arguments, not the > return value: > /* The arguments to the overloaded function. */ > vec<tree, va_gc> &m_arglist; > > I kept this like what already exists for AArch64/SVE, but we'll need to > extend it to handle return values too, so that we can support all > overloaded forms of vuninitialized > (see https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616003.html) > > I meant this extension to be a follow-up work when most intrinsics have > been converted and the few remaining ones (eg. vuninitialized) needs an > improved framework. And that would enable to fix the FIXME. Thanks for explaining. The series is ok for trunk then. Kyrill > > Thanks, > > Christophe > > > > Thanks, > > Kyrill > > > >> + return r.resolve_unary (); > >> + } > >> +}; > >> +SHAPE (unary_acc) > >> + > >> /* <T0>_t foo_t0[_t1](<T1>_t) > >> > >> where the target type <t0> must be specified explicitly but the source > >> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h > b/gcc/config/arm/arm- > >> mve-builtins-shapes.h > >> index fc1bacbd4da..c062fe624c4 100644 > >> --- a/gcc/config/arm/arm-mve-builtins-shapes.h > >> +++ b/gcc/config/arm/arm-mve-builtins-shapes.h > >> @@ -53,6 +53,7 @@ namespace arm_mve > >> extern const function_shape *const create; > >> extern const function_shape *const inherent; > >> extern const function_shape *const unary; > >> + extern const function_shape *const unary_acc; > >> extern const function_shape *const unary_convert; > >> extern const function_shape *const unary_int32; > >> extern const function_shape *const unary_int32_acc; > >> -- > >> 2.34.1 > >
On 5/11/23 10:23, Kyrylo Tkachov wrote: > > >> -----Original Message----- >> From: Christophe Lyon <Christophe.Lyon@arm.com> >> Sent: Thursday, May 11, 2023 9:21 AM >> To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; gcc-patches@gcc.gnu.org; >> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford >> <Richard.Sandiford@arm.com> >> Subject: Re: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >> >> >> >> On 5/10/23 16:52, Kyrylo Tkachov wrote: >>> >>> >>>> -----Original Message----- >>>> From: Christophe Lyon <christophe.lyon@arm.com> >>>> Sent: Wednesday, May 10, 2023 2:31 PM >>>> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; >>>> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford >>>> <Richard.Sandiford@arm.com> >>>> Cc: Christophe Lyon <Christophe.Lyon@arm.com> >>>> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >>>> >>>> This patch adds the unary_acc shape description. >>>> >>>> 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> >>>> >>>> gcc/ >>>> * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. >>>> * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. >>>> --- >>>> gcc/config/arm/arm-mve-builtins-shapes.cc | 28 >> +++++++++++++++++++++++ >>>> gcc/config/arm/arm-mve-builtins-shapes.h | 1 + >>>> 2 files changed, 29 insertions(+) >>>> >>>> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc >> b/gcc/config/arm/arm- >>>> mve-builtins-shapes.cc >>>> index bff1c3e843b..e77a0cc20ac 100644 >>>> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc >>>> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc >>>> @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> >>>> }; >>>> SHAPE (unary) >>>> >>>> +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) >>>> + >>>> + i.e. a version of "unary" in which the source elements are half the >>>> + size of the destination scalar, but have the same type class. >>>> + >>>> + Example: vaddlvq. >>>> + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) >>>> + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ >>>> +struct unary_acc_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, "sw0,v0", group, MODE_none, >> preserve_user_namespace); >>>> + } >>>> + >>>> + tree >>>> + resolve (function_resolver &r) const override >>>> + { >>>> + /* FIXME: check that the return value is actually >>>> + twice as wide as arg 0. */ >>> >>> Any reason why we can't add that check now? >>> I'd rather not add new FIXMEs here... >> >> I understand :-) >> >> That's because the resolver only knows about the arguments, not the >> return value: >> /* The arguments to the overloaded function. */ >> vec<tree, va_gc> &m_arglist; >> >> I kept this like what already exists for AArch64/SVE, but we'll need to >> extend it to handle return values too, so that we can support all >> overloaded forms of vuninitialized >> (see https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616003.html) >> >> I meant this extension to be a follow-up work when most intrinsics have >> been converted and the few remaining ones (eg. vuninitialized) needs an >> improved framework. And that would enable to fix the FIXME. > > Thanks for explaining. > The series is ok for trunk then. Great, thanks! > Kyrill > >> >> Thanks, >> >> Christophe >> >> >>> Thanks, >>> Kyrill >>> >>>> + return r.resolve_unary (); >>>> + } >>>> +}; >>>> +SHAPE (unary_acc) >>>> + >>>> /* <T0>_t foo_t0[_t1](<T1>_t) >>>> >>>> where the target type <t0> must be specified explicitly but the source >>>> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h >> b/gcc/config/arm/arm- >>>> mve-builtins-shapes.h >>>> index fc1bacbd4da..c062fe624c4 100644 >>>> --- a/gcc/config/arm/arm-mve-builtins-shapes.h >>>> +++ b/gcc/config/arm/arm-mve-builtins-shapes.h >>>> @@ -53,6 +53,7 @@ namespace arm_mve >>>> extern const function_shape *const create; >>>> extern const function_shape *const inherent; >>>> extern const function_shape *const unary; >>>> + extern const function_shape *const unary_acc; >>>> extern const function_shape *const unary_convert; >>>> extern const function_shape *const unary_int32; >>>> extern const function_shape *const unary_int32_acc; >>>> -- >>>> 2.34.1 >>>
Christophe Lyon <christophe.lyon@arm.com> writes: > On 5/10/23 16:52, Kyrylo Tkachov wrote: >> >> >>> -----Original Message----- >>> From: Christophe Lyon <christophe.lyon@arm.com> >>> Sent: Wednesday, May 10, 2023 2:31 PM >>> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; >>> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford >>> <Richard.Sandiford@arm.com> >>> Cc: Christophe Lyon <Christophe.Lyon@arm.com> >>> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >>> >>> This patch adds the unary_acc shape description. >>> >>> 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> >>> >>> gcc/ >>> * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. >>> * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. >>> --- >>> gcc/config/arm/arm-mve-builtins-shapes.cc | 28 +++++++++++++++++++++++ >>> gcc/config/arm/arm-mve-builtins-shapes.h | 1 + >>> 2 files changed, 29 insertions(+) >>> >>> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm- >>> mve-builtins-shapes.cc >>> index bff1c3e843b..e77a0cc20ac 100644 >>> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc >>> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc >>> @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> >>> }; >>> SHAPE (unary) >>> >>> +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) >>> + >>> + i.e. a version of "unary" in which the source elements are half the >>> + size of the destination scalar, but have the same type class. >>> + >>> + Example: vaddlvq. >>> + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) >>> + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ >>> +struct unary_acc_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, "sw0,v0", group, MODE_none, preserve_user_namespace); >>> + } >>> + >>> + tree >>> + resolve (function_resolver &r) const override >>> + { >>> + /* FIXME: check that the return value is actually >>> + twice as wide as arg 0. */ >> >> Any reason why we can't add that check now? >> I'd rather not add new FIXMEs here... > > I understand :-) > > That's because the resolver only knows about the arguments, not the > return value: > /* The arguments to the overloaded function. */ > vec<tree, va_gc> &m_arglist; > > I kept this like what already exists for AArch64/SVE, but we'll need to > extend it to handle return values too, so that we can support all > overloaded forms of vuninitialized > (see https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616003.html) > > I meant this extension to be a follow-up work when most intrinsics have > been converted and the few remaining ones (eg. vuninitialized) needs an > improved framework. And that would enable to fix the FIXME. We can't resolve based on the return type though. It has to be arguments only. E.g.: decltype(foo(a, b)) has to be well-defined, even though decltype (by design) provides no context about "what the caller wants". Thanks, Richard
On 5/11/23 10:30, Richard Sandiford wrote: > Christophe Lyon <christophe.lyon@arm.com> writes: >> On 5/10/23 16:52, Kyrylo Tkachov wrote: >>> >>> >>>> -----Original Message----- >>>> From: Christophe Lyon <christophe.lyon@arm.com> >>>> Sent: Wednesday, May 10, 2023 2:31 PM >>>> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; >>>> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford >>>> <Richard.Sandiford@arm.com> >>>> Cc: Christophe Lyon <Christophe.Lyon@arm.com> >>>> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >>>> >>>> This patch adds the unary_acc shape description. >>>> >>>> 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> >>>> >>>> gcc/ >>>> * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. >>>> * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. >>>> --- >>>> gcc/config/arm/arm-mve-builtins-shapes.cc | 28 +++++++++++++++++++++++ >>>> gcc/config/arm/arm-mve-builtins-shapes.h | 1 + >>>> 2 files changed, 29 insertions(+) >>>> >>>> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm- >>>> mve-builtins-shapes.cc >>>> index bff1c3e843b..e77a0cc20ac 100644 >>>> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc >>>> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc >>>> @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> >>>> }; >>>> SHAPE (unary) >>>> >>>> +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) >>>> + >>>> + i.e. a version of "unary" in which the source elements are half the >>>> + size of the destination scalar, but have the same type class. >>>> + >>>> + Example: vaddlvq. >>>> + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) >>>> + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ >>>> +struct unary_acc_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, "sw0,v0", group, MODE_none, preserve_user_namespace); >>>> + } >>>> + >>>> + tree >>>> + resolve (function_resolver &r) const override >>>> + { >>>> + /* FIXME: check that the return value is actually >>>> + twice as wide as arg 0. */ >>> >>> Any reason why we can't add that check now? >>> I'd rather not add new FIXMEs here... >> >> I understand :-) >> >> That's because the resolver only knows about the arguments, not the >> return value: >> /* The arguments to the overloaded function. */ >> vec<tree, va_gc> &m_arglist; >> >> I kept this like what already exists for AArch64/SVE, but we'll need to >> extend it to handle return values too, so that we can support all >> overloaded forms of vuninitialized >> (see https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616003.html) >> >> I meant this extension to be a follow-up work when most intrinsics have >> been converted and the few remaining ones (eg. vuninitialized) needs an >> improved framework. And that would enable to fix the FIXME. > > We can't resolve based on the return type though. It has to be > arguments only. E.g.: > > decltype(foo(a, b)) > > has to be well-defined, even though decltype (by design) provides no > context about "what the caller wants". > So in fact we can probably get rid of (most of) the remaining definitions of vuninitializedq in arm_mve.h, but not by looking at the return type (re-reading this I'm wondering whether I overlooked this when I started the series....) But for things like vaddlvq, we can't check that the result is actually written in a twice-as-large as the argument location? Thanks, Christophe > Thanks, > Richard
Christophe Lyon <christophe.lyon@arm.com> writes: > On 5/11/23 10:30, Richard Sandiford wrote: >> Christophe Lyon <christophe.lyon@arm.com> writes: >>> On 5/10/23 16:52, Kyrylo Tkachov wrote: >>>> >>>> >>>>> -----Original Message----- >>>>> From: Christophe Lyon <christophe.lyon@arm.com> >>>>> Sent: Wednesday, May 10, 2023 2:31 PM >>>>> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; >>>>> Richard Earnshaw <Richard.Earnshaw@arm.com>; Richard Sandiford >>>>> <Richard.Sandiford@arm.com> >>>>> Cc: Christophe Lyon <Christophe.Lyon@arm.com> >>>>> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >>>>> >>>>> This patch adds the unary_acc shape description. >>>>> >>>>> 2022-10-25 Christophe Lyon <christophe.lyon@arm.com> >>>>> >>>>> gcc/ >>>>> * config/arm/arm-mve-builtins-shapes.cc (unary_acc): New. >>>>> * config/arm/arm-mve-builtins-shapes.h (unary_acc): New. >>>>> --- >>>>> gcc/config/arm/arm-mve-builtins-shapes.cc | 28 +++++++++++++++++++++++ >>>>> gcc/config/arm/arm-mve-builtins-shapes.h | 1 + >>>>> 2 files changed, 29 insertions(+) >>>>> >>>>> diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm- >>>>> mve-builtins-shapes.cc >>>>> index bff1c3e843b..e77a0cc20ac 100644 >>>>> --- a/gcc/config/arm/arm-mve-builtins-shapes.cc >>>>> +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc >>>>> @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> >>>>> }; >>>>> SHAPE (unary) >>>>> >>>>> +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) >>>>> + >>>>> + i.e. a version of "unary" in which the source elements are half the >>>>> + size of the destination scalar, but have the same type class. >>>>> + >>>>> + Example: vaddlvq. >>>>> + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) >>>>> + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ >>>>> +struct unary_acc_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, "sw0,v0", group, MODE_none, preserve_user_namespace); >>>>> + } >>>>> + >>>>> + tree >>>>> + resolve (function_resolver &r) const override >>>>> + { >>>>> + /* FIXME: check that the return value is actually >>>>> + twice as wide as arg 0. */ >>>> >>>> Any reason why we can't add that check now? >>>> I'd rather not add new FIXMEs here... >>> >>> I understand :-) >>> >>> That's because the resolver only knows about the arguments, not the >>> return value: >>> /* The arguments to the overloaded function. */ >>> vec<tree, va_gc> &m_arglist; >>> >>> I kept this like what already exists for AArch64/SVE, but we'll need to >>> extend it to handle return values too, so that we can support all >>> overloaded forms of vuninitialized >>> (see https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616003.html) >>> >>> I meant this extension to be a follow-up work when most intrinsics have >>> been converted and the few remaining ones (eg. vuninitialized) needs an >>> improved framework. And that would enable to fix the FIXME. >> >> We can't resolve based on the return type though. It has to be >> arguments only. E.g.: >> >> decltype(foo(a, b)) >> >> has to be well-defined, even though decltype (by design) provides no >> context about "what the caller wants". >> > > So in fact we can probably get rid of (most of) the remaining > definitions of vuninitializedq in arm_mve.h, but not by looking at the > return type (re-reading this I'm wondering whether I overlooked this > when I started the series....) > > But for things like vaddlvq, we can't check that the result is actually > written in a twice-as-large as the argument location? No. All we can/should do is to resolve the typeless builtin to a fully-typed builtin, based on the argument types. The return type of that fully-typed builtin determines the type of the function call expression (the CALL_EXPR). It's then up to the frontend to do semantic/type checking of the resolved expression type. In other words, information only flows in one direction: argument types -> function overloading -> function return type Thanks, Richard
diff --git a/gcc/config/arm/arm-mve-builtins-shapes.cc b/gcc/config/arm/arm-mve-builtins-shapes.cc index bff1c3e843b..e77a0cc20ac 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.cc +++ b/gcc/config/arm/arm-mve-builtins-shapes.cc @@ -1066,6 +1066,34 @@ struct unary_def : public overloaded_base<0> }; SHAPE (unary) +/* <S0:twice>_t vfoo[_<t0>](<T0>_t) + + i.e. a version of "unary" in which the source elements are half the + size of the destination scalar, but have the same type class. + + Example: vaddlvq. + int64_t [__arm_]vaddlvq[_s32](int32x4_t a) + int64_t [__arm_]vaddlvq_p[_s32](int32x4_t a, mve_pred16_t p) */ +struct unary_acc_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, "sw0,v0", group, MODE_none, preserve_user_namespace); + } + + tree + resolve (function_resolver &r) const override + { + /* FIXME: check that the return value is actually + twice as wide as arg 0. */ + return r.resolve_unary (); + } +}; +SHAPE (unary_acc) + /* <T0>_t foo_t0[_t1](<T1>_t) where the target type <t0> must be specified explicitly but the source diff --git a/gcc/config/arm/arm-mve-builtins-shapes.h b/gcc/config/arm/arm-mve-builtins-shapes.h index fc1bacbd4da..c062fe624c4 100644 --- a/gcc/config/arm/arm-mve-builtins-shapes.h +++ b/gcc/config/arm/arm-mve-builtins-shapes.h @@ -53,6 +53,7 @@ namespace arm_mve extern const function_shape *const create; extern const function_shape *const inherent; extern const function_shape *const unary; + extern const function_shape *const unary_acc; extern const function_shape *const unary_convert; extern const function_shape *const unary_int32; extern const function_shape *const unary_int32_acc;