From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2071.outbound.protection.outlook.com [40.107.241.71]) by sourceware.org (Postfix) with ESMTPS id 932603858C83 for ; Thu, 11 May 2023 09:55:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 932603858C83 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=wTuo7uK0NpmSA4mXHuGxwgcn+PKe0ZXDNpkNkToRtug=; b=oBE8B15utlxLTXY+yqsh5YXCGyX7SjpWpvg7JbAc8Bn5fgoll5UNA9UMuq1pTK7PTecQN8JMNEnEImYF18l6iGoFmVSLZ68zQOuJpYXNp2x8UGmzVkyTA2aESBCC31MP6siOeTybMQ3tk3iI+sQHK5a6KoUEKB/E7ffCLlU0Usg= Received: from DB6P18901CA0014.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::24) by PAWPR08MB10060.eurprd08.prod.outlook.com (2603:10a6:102:35a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Thu, 11 May 2023 09:55:05 +0000 Received: from DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:16:cafe::e4) by DB6P18901CA0014.outlook.office365.com (2603:10a6:4:16::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.19 via Frontend Transport; Thu, 11 May 2023 09:55:05 +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 DBAEUR03FT046.mail.protection.outlook.com (100.127.142.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.22 via Frontend Transport; Thu, 11 May 2023 09:55:05 +0000 Received: ("Tessian outbound 3a01b65b5aad:v136"); Thu, 11 May 2023 09:55:05 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 240aeef80b4cc682 X-CR-MTA-TID: 64aa7808 Received: from 76931a682bc8.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7FBB3A26-8F88-43E7-9DE3-D99DF0B67439.1; Thu, 11 May 2023 09:54:58 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 76931a682bc8.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 11 May 2023 09:54:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FDVaEGVFcIGQpUvJbGpU6cWpIMwFwbbqJW3mp16z0LgAC2vSRvRvDGP93937BZFbejPz16ulLvOqghIojIKQHByd3CeXr6fe2cttkv+Hfv8LF1zmgPaugRHdxr4lG1GQU3a6iJHUQQeC0hpZemq8yZItW7DwPYnLeCWAdMz9Epyp+jE07/nNS8vcEphqX77WuTDhwb1txkhCjdmswICimm0q7RKRpI2wBxuW6cOb4pX7tmCN3H+JwEEvGepE+W40mYB2su3ZHv3DELr2SYQkLNnpk67iryRqrLfPrxy49l18xR89S12tW+F26GKvFbPCUPnMfvage8L/t1TFnoeZ+w== 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=wTuo7uK0NpmSA4mXHuGxwgcn+PKe0ZXDNpkNkToRtug=; b=GPFKO8bEulQJnap1V3f/wv7FGEfRd3cU4gEJ8tay0iAYKKamU6wVZjVzjuxVhuR1XpLXtQbSL5ne8z/wlZzNwGbbxz4ZAvwKwP53IZl1MrnoVKIEW6L0RA21B1jj83lJR98RRLamAymBqkmIYbn9ehzTuPAOlXIw+rXtroLwWqkvEIs3X1MuuwiVpSAc1HbLnr5smxnl0xym1z+H/rtlK/03XC6/YEmyYb8YBdToVp27a3bkYPuOq3lFxf66aYQZw7z0bW0ZfK0zcOGvkDPSBSNkV/AHKZw9yrptHG0CHog4sJvvVJDUu5v81VTHMVjsRBBQHtHNUkAokyBI1tT+dw== 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=wTuo7uK0NpmSA4mXHuGxwgcn+PKe0ZXDNpkNkToRtug=; b=oBE8B15utlxLTXY+yqsh5YXCGyX7SjpWpvg7JbAc8Bn5fgoll5UNA9UMuq1pTK7PTecQN8JMNEnEImYF18l6iGoFmVSLZ68zQOuJpYXNp2x8UGmzVkyTA2aESBCC31MP6siOeTybMQ3tk3iI+sQHK5a6KoUEKB/E7ffCLlU0Usg= 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 AS8PR08MB8184.eurprd08.prod.outlook.com (2603:10a6:20b:561::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6363.33; Thu, 11 May 2023 09:54:57 +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 09:54:57 +0000 Message-ID: Date: Thu, 11 May 2023 11:54:48 +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 Content-Language: en-US To: Kyrylo Tkachov , "gcc-patches@gcc.gnu.org" , Richard Earnshaw , richard.sandiford@arm.com References: <20230510133036.596530-1-christophe.lyon@arm.com> <20230510133036.596530-15-christophe.lyon@arm.com> From: Christophe Lyon In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P123CA0010.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:338::14) To VI1PR08MB3390.eurprd08.prod.outlook.com (2603:10a6:803:7d::27) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3390:EE_|AS8PR08MB8184:EE_|DBAEUR03FT046:EE_|PAWPR08MB10060:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b00ab13-b152-4e52-c3b7-08db5205cc02 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: 7cb0NOAVNG1IjPJASAYWzp6AWnaIw6j5tCgPELW9UAECCEpnytz2yyDiy8rZ+MkuBp8GaYlpE25z51db3ZbgIiwrc7r7+/9uLg+4uhwBSAIOJjJsNfXHQR7V06VECfmPVpYEqg0P8T9EwXWgM/9dzyay4MuU6w3Qvweyt28MBy4utfwWHDkUtC5C0HM+fpFNy71TJxavvmGY2TrmF8GSyD2V9yxUVoFXSnzsQFZErW1DwCw71+D8+gm94eWO3R0sKN1aSdBqcqsxua9hhw433NQ4oweY08YoQBeci9yjfDfN3WwvSUhGrbsG8xWH7i/K/R7MnRnmrXPG6rGsVf3zN3Qs4irp+hA91jFIOduKlpxIy42drxzrQYMZzgpfqyFhVQuhFU7wP8RHQZssIxh4KgWXB2iaenSr6QnSuDo18BeXSwReh/qWyAA3rdkfj4zn2GcXToyd9wadtNXeeSKyLdOB3tpHD6abR0ZD17tMecnZlN4B3BFOIRVkQZz/2FiDGtPO5xeRRjCEik4wcPmFO35rUwvMDjIBbZwjGowzLNwpjzs/o5wmTVGSi3pRYrg8lqipsKe/X84PkZ6DVeNXqxxq6P2MEZyrFdiVpxeH/L71xXB+X0RjFcqdOHcSWw6mbq5CiYmyvXMjC6rOWFMwvQ== 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)(396003)(366004)(376002)(39860400002)(136003)(346002)(451199021)(31686004)(110136005)(38100700002)(316002)(83380400001)(6506007)(26005)(41300700001)(53546011)(5660300002)(31696002)(86362001)(8936002)(8676002)(66556008)(66476007)(66946007)(6636002)(6512007)(966005)(4001150100001)(44832011)(478600001)(36756003)(2616005)(2906002)(186003)(6666004)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8184 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: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 2304953e-8e16-47fe-2803-08db5205c6fc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 56h2Gt/8Eq9LuuwA8yGNYO+xVs1i/lGmGrValrx3g+lZrxWQi8bg8AiISJE99ZwNkpLewImAt0sRKF8N9yaAb3LXcq5RuVmiFxEIArtinWhOTBZkGX6IIu90jDtzKBVJ3nhlx8kdKF7fY/sxxhboduCyoVxoUxENwY0xqjsYxdW8O19Sq3Xak6/oXr8/hZrSY+oVimJNH3TqBZeNpRqU+C6V/uZUPvIqigI8koLLHrG5bPMz+INY2+mRyMM3D4rOE1nWyamlsKBFctZeuYxvlgu3vcXg7+E/HUXmeisnCyc5iiwhDbgDl0/yVq7whJdfBMHJj/ggrPM0we+ftjl7LjsInRoH5IR2WUPMcb4ulnfVj4NxYkk3TqaTFKGBLi7DgTgrPUqsbd1hQeiVxBtcUT6B6+JmcDoxwjPdIiG/B/fLsLWyd2HlJaK2nyAPbNaX0X9v10r2x6LtWECnND6UbTI9OJwgNNaA6mQHFZU3FayAz4VMwlTJThwiXGhiZk/4+Pdgnq9LkJq/lmujUKGRMQ1mW8iol7djtEUzjxdXN6OdkrC5PUuw4ZJZQu0ZUijCJFovt85c097ZOULW+e/Tfn1sCu7CgThI4k5KxtdXg087Cl94ai8a25BEavrUJcSM1fQXXCzXcNTUr57QNI2B4+9TzBTK4Hhj11lFNfaQAQI0dD7acjqMZ3c499LohgH79Uyf/w0DjBo+V9QSOp+3u89RMWQVi+iDT3VwX7TLY2M= 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)(39860400002)(346002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(36860700001)(40460700003)(36756003)(47076005)(6666004)(83380400001)(110136005)(478600001)(6486002)(70206006)(6636002)(336012)(70586007)(2616005)(6512007)(186003)(53546011)(966005)(26005)(6506007)(316002)(31696002)(40480700001)(8676002)(82310400005)(2906002)(4001150100001)(82740400003)(41300700001)(356005)(81166007)(44832011)(5660300002)(86362001)(8936002)(31686004)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2023 09:55:05.4104 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5b00ab13-b152-4e52-c3b7-08db5205cc02 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: DBAEUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB10060 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/11/23 10:30, Richard Sandiford wrote: > Christophe Lyon writes: >> 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. > > 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