From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2049.outbound.protection.outlook.com [40.107.6.49]) by sourceware.org (Postfix) with ESMTPS id 45E5C3858414 for ; Thu, 11 May 2023 08:21:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 45E5C3858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NYNgr5khCAlG4Rpouo4SNxaWOQBRZH1o+hN2b8GK+A0=; b=uf7H3oAudBbQ1xKXPzblkEwY6lTjVyL5UVXsJU2xNehRjxjhqrhN056NFXckJOmdzv+0zsWjSOcktlGMwz7HyrXOxRZ0oO8OuGG2fINEE7wDM0imfEZM70S7z9JUP0G4Dc2ZGwEcUs+j80MnIJ8JpxdCLXMqausaDDhjJwkYa0w= Received: from DU2PR04CA0333.eurprd04.prod.outlook.com (2603:10a6:10:2b4::25) by PA4PR08MB5968.eurprd08.prod.outlook.com (2603:10a6:102:e9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21; Thu, 11 May 2023 08:21:55 +0000 Received: from DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:2b4:cafe::d9) by DU2PR04CA0333.outlook.office365.com (2603:10a6:10:2b4::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21 via Frontend Transport; Thu, 11 May 2023 08:21:55 +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 DBAEUR03FT021.mail.protection.outlook.com (100.127.142.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.20 via Frontend Transport; Thu, 11 May 2023 08:21:54 +0000 Received: ("Tessian outbound 945aec65ec65:v136"); Thu, 11 May 2023 08:21:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5ad8f1b610b08140 X-CR-MTA-TID: 64aa7808 Received: from f35bf5fc19a3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F521DE8A-D1BB-4017-8D77-F87371087F96.1; Thu, 11 May 2023 08:21:48 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f35bf5fc19a3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 11 May 2023 08:21:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k58rzHBCrWP4L5LBUrv0cQJr0caM12dWshk9fZWXdq0iwmnqzUar2szAxuDW4To57WmIJpJjt+fsqfjj4EEVH5VBc9gK+y8X1eaCMbNDnhlFAYFe5wrUOIvuPuGeZlmYAvS9wMcr1uJyEdLCEb3C6u9nAPpJt0FtZL2agkj1sNxcbpNLkLnCoQIKtZG1fzZgKBBeDWPDBUbYdWMS0jz+rTw8PoVQ0NAL3d0/r6iB0C3CV651+0pNpGWiWFZFizeWKxaQ4317kfALmX3oSL7GaW81jDCytKfoPbiQh5H51xeP7q7gsWOAUqCbl46Kap3T0jU5CxzWSlnPvKnBCjmJRg== 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=NYNgr5khCAlG4Rpouo4SNxaWOQBRZH1o+hN2b8GK+A0=; b=kg5rvV+ND8wONV7YkaDu90sJR2DdTTMpipH4pk0lK4xAIvBitO70yy4wXDIloAzbMJrja9VQ1VJLwoaSVingXkdI1yNtFWourg7B6TjFmNnKTSgW/9IMwJ6BwOCDJ3f51WL5wleHvYOJo0AFDspYYK5ol8hqOIFRB0coz2dd/SdXqkx7Pn1ZKRjVrt+QQoZ1+LA5nTi9IArttz5jJvdCmN2TMrC5UIi/ezrdHKwTTPdT/0tmR5BTVIIpzRXip8bkVo3GpIWubICmZla/xT/znA4ZpZ0vucnOABxMdI5HF0ciIKIcwMKsorGuyzbxa/FIdBJrlFgHWNCLGpYQo81nPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NYNgr5khCAlG4Rpouo4SNxaWOQBRZH1o+hN2b8GK+A0=; b=uf7H3oAudBbQ1xKXPzblkEwY6lTjVyL5UVXsJU2xNehRjxjhqrhN056NFXckJOmdzv+0zsWjSOcktlGMwz7HyrXOxRZ0oO8OuGG2fINEE7wDM0imfEZM70S7z9JUP0G4Dc2ZGwEcUs+j80MnIJ8JpxdCLXMqausaDDhjJwkYa0w= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) by GVXPR08MB7845.eurprd08.prod.outlook.com (2603:10a6:150:1::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.21; Thu, 11 May 2023 08:21:43 +0000 Received: from VI1PR08MB3390.eurprd08.prod.outlook.com ([fe80::1a93:2d42:2bb5:eae9]) by VI1PR08MB3390.eurprd08.prod.outlook.com ([fe80::1a93:2d42:2bb5:eae9%2]) with mapi id 15.20.6363.033; Thu, 11 May 2023 08:21:43 +0000 Message-ID: Date: Thu, 11 May 2023 10:21:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape To: Kyrylo Tkachov , "gcc-patches@gcc.gnu.org" , Richard Earnshaw , Richard Sandiford References: <20230510133036.596530-1-christophe.lyon@arm.com> <20230510133036.596530-15-christophe.lyon@arm.com> Content-Language: en-US From: Christophe Lyon In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P302CA0015.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c2::11) To VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3390:EE_|GVXPR08MB7845:EE_|DBAEUR03FT021:EE_|PA4PR08MB5968:EE_ X-MS-Office365-Filtering-Correlation-Id: a10da525-c9b9-46a9-866f-08db51f8c7d4 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: MM5vc9Ne/UR+dkkkcBS+uk4oPD1grcu/Rd+7ZvJCWJQCWrtY/cvQKdZK5vrx2/vTiZdsSnN0i8T+XL1uROmuPVYIMHCVvLfTiVs/LW+boK7mge71KF0ws+5cuaRezBzlf8OX3DKfSQgPTDbY7Yl08i36hM86UEH7UVzJ6hS5+KXGiG+0UCf4+Jis4kF14DQYkzt6CVY6onvi8j53EO2Qq53batebHbHoIcYOvEjSrE8Z+2gcZhxHZoocXfNNnJpzK1gGYJIdAWHhVRv0E3A+ZjCfKEVnG41cRGZkD87QPSmnDg7kLINxnxS3mj5ey1WZPBRGlBt48oSHAoSh/5znx3U49HWW+lgTq2TZnGXrkTo9iE4aM7CUMKqzYKWTj0t/bhFJHEfE2yhZP2nhJqH7mNDXR09YEIV8uBfiHOvEEKHyr3ZzgopiS0n9XCyCdI1Bq4GqH8gwhv6OMh5JM6Z2RPSPJeyQMN/zI12JVoj9UhlGS7X4p7pNzGBu6l2ntUE8e4P7QFd0jQGU3G2rMAbea2K92vhVmIzYtT4zeYANHzsjWKNFMEJEastGLgCFc3PayvwnEdVh3w/pnELtoV8yd1B8YFWFDjFlS70151Tzm7szswGbEGyrxV/WCEGriyr139M+cBkTpwe99ChmrJd1Ag== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3390.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(396003)(366004)(136003)(39860400002)(346002)(451199021)(38100700002)(31696002)(36756003)(86362001)(31686004)(316002)(6636002)(41300700001)(6506007)(5660300002)(8676002)(8936002)(53546011)(26005)(186003)(4001150100001)(44832011)(6512007)(2616005)(2906002)(66476007)(966005)(478600001)(66556008)(6666004)(110136005)(83380400001)(66946007)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7845 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0328a2cd-df4d-4f5a-4a98-08db51f8c0be X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YupY/Sm/cwQ8vRp237fmlezL/wfuMgpHM/vAEOkMWe1gs3zuqavadGdyPG98JM7d9tcyt85+JPtDj0gc8/CXn2xlO1yfNjwYakrECWmqjOBwYF58CwH7A+2X6tChuEmqcNwWxuEwYH/+vBOthJ89t71zuFFargG+t4BLuL4zap/H3z3RWXzA5Pj8Fw64izEDeB6ygKA3hpCvWQooFh0KhK0CuC/IaWpbxUJJgL/3/xqNFewP07uN5QK43kA6pQiTO4LC5yKob3EWzUoawkT/oPhbCeIL5veK0qpKA4pRV83EebM4Lv1De1AgUfZtfQ1qQmUzPvzadSSFpexEJSHtLxUnpKcS2con6lf+5DPpLUVv877qjdRZg+hNXF9lBB5vsMRswWjUIdcm7c0y63uXFT1npVoSeJZbFePf8c+widO2IW9M87SBIa/4fPZ/kvrahyC7g5ekKNQBC0/iLSjcziqITslyvg0sQlR3pkXq2ZZ1W7v81tuARsd2TKmfjQh0BY24oyeIfe/IsXIt7lJ/65imy9xyC3i4Xr/4Ac9A3GK4z/MW/K5ZdySFc9hzyzOzctp82jD982Oc8SOUMUMJTY11aV6oPyt8WtqZiJ1huRZN+nbaRBdaTRKLnYpgCk3093M/EdaUhFmC2C1Ra0ozPdOI+6BeukpPH+YdxYGvvu05LIEGiofH1/wFBLeKAqmqS5nR3pWYIToZ+S7wX/pxpesF7Fu2OLuQtsFi4ppU8UIXkNJBdEZtAgQ0o4coQ1+J 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)(39860400002)(136003)(396003)(376002)(451199021)(36840700001)(46966006)(40470700004)(31696002)(6636002)(70586007)(70206006)(47076005)(31686004)(83380400001)(4001150100001)(2906002)(356005)(316002)(81166007)(336012)(36860700001)(110136005)(8936002)(8676002)(82740400003)(86362001)(2616005)(44832011)(478600001)(5660300002)(41300700001)(966005)(82310400005)(40460700003)(186003)(26005)(40480700001)(6512007)(6486002)(53546011)(6666004)(6506007)(36756003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 08:21:54.9234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a10da525-c9b9-46a9-866f-08db51f8c7d4 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: DBAEUR03FT021.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5968 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,KAM_SHORT,NICE_REPLY_A,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 List-Id: On 5/10/23 16:52, Kyrylo Tkachov wrote: > > >> -----Original Message----- >> From: Christophe Lyon >> Sent: Wednesday, May 10, 2023 2:31 PM >> To: gcc-patches@gcc.gnu.org; Kyrylo Tkachov ; >> Richard Earnshaw ; Richard Sandiford >> >> Cc: Christophe Lyon >> Subject: [PATCH 15/20] arm: [MVE intrinsics] add unary_acc shape >> >> This patch adds the unary_acc shape description. >> >> 2022-10-25 Christophe Lyon >> >> 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) >> >> +/* _t vfoo[_](_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 &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) >> + >> /* _t foo_t0[_t1](_t) >> >> where the target type 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 >