From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150055.outbound.protection.outlook.com [40.107.15.55]) by sourceware.org (Postfix) with ESMTPS id 38221381D455 for ; Wed, 26 Oct 2022 08:49:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 38221381D455 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b6C62LFMg7MKEIceRQaLQdpWD1xBxOX2NVCW3dGaWBMgKcYAm5UlcuHwl2NVs2v0cPY9xgHfO6kQpepna5R2AHe+H+PU0abr6++zTYvmJQsTBss7J0qFpviEvt5AkN1n1a2ye0P/B/99B8vK7QltuV70TT+EofE4dQWQV5xYX/leChyHqcn7FcFb1IkF5kmaZPusvd1180ZrH3BVlg43F3o/IQZDVaZvAyzwhDZUiIMdBZSKj4fg91Jg2Rik/SJa966k4qNfEDJPP3tiMbTWqqYXx3igulrK/cGkP0WEpSN8s9NSITctklIlJIODtEyI3m519IJC+nBzjK1xvcxNQQ== 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=vFQCb8Ua9PxsWp/DhOpRzrCSFZJUOqFJWyXhlJeh4Fw=; b=HdhrIQnUuWDjyqHgp5ajoEPBVnweJwo1ziC0MohisHxpzYInt7Gh5UlcADoO/oSdwN37pxN3tH7Vy5JsuDp6NC6Bspe4EVhp2kn1MJnCsPCQ+9uDTw+XKrotOygGOaXkv7381y0WS0ocWZ/hGoG2L6xxzKiMPAigG22XDwdQ5L0XyoWpWwIA42I2mB/MBmmTv2yroHzD5MJ+gc4wFF72AhUm//duUcOvOMgZhXlSFLVyo2zZu8un2HhOUmfAjy9yqhq0/VbcBtIKmTnPapTSmoHrxLDkV2sCcU9XPpiYZYIrADFPWHic7tDiJlZxkRF8x2k1T8b6tV08KLgpT1/uyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vFQCb8Ua9PxsWp/DhOpRzrCSFZJUOqFJWyXhlJeh4Fw=; b=Mrgd3Aogw0TUUIE93F5nKQUc6IiZO+k3l/nH2T59fbX96dmvxFg9broLrxzjb5HU7TQGYsgzZCZBWIDdMBzoI7vDBHbkJ/yP1ormQp3w3zwkETSaOiiutZjMHM/DD0S6ERSf88g0nXk1X1TcpHW7T4FP6F1C+jgjm8CeOj0v0JKuD6wAwkZFSglJLgkPt4LRzw3aSd5BGKx+Jr+M6BMjszRC/2oCFLY03NzlbDuQQQTk58TNfTPUolk/35WHLU0Tw+SwmXVVSQ6LSyt/qTKVkgI4LMVNvecaAxRyp7CLMkj2golCe35rMWvKLWxyaxg1qbo9lcwzOb7cJx3pFb0A8Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by PA4PR04MB7648.eurprd04.prod.outlook.com (2603:10a6:102:e4::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Wed, 26 Oct 2022 08:49:56 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::4da2:ea8b:e71e:b8d8%4]) with mapi id 15.20.5746.021; Wed, 26 Oct 2022 08:49:56 +0000 Message-ID: <45712e4e-b75b-03e3-22c2-6264783466e2@suse.com> Date: Wed, 26 Oct 2022 10:49:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: [PATCH 04/10] Support Intel CMPccXADD Content-Language: en-US To: "Jiang, Haochen" Cc: "hjl.tools@gmail.com" , "binutils@sourceware.org" References: <20221014091248.4920-1-haochen.jiang@intel.com> <20221014091248.4920-5-haochen.jiang@intel.com> <1d847a52-b1ff-b816-1507-7077724901bb@suse.com> <789f9132-88b4-1c41-0d1c-e7c2626fa8d4@suse.com> From: Jan Beulich In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR0P281CA0126.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::6) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|PA4PR04MB7648:EE_ X-MS-Office365-Filtering-Correlation-Id: 506150e1-9c8e-4a9b-bd44-08dab72f0ea4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V4LfOtvkQhlSQXO22q6pVcz6Q/HUT+q2fWvAxk98RdALKeAUe9BGUQlYZmVfTnZ6v6cqIFiFnH1R4iyufiSLncNEkTUpm8yw/SoojRkup1J5f5xoy+zx6HT7d7jzjFeuL5aPwi1AacvFvTkr84DTxFh4WdnDWUwVqEtMqNy42JBfL/Klni4Wsdd9eWWEjrLPZABaygVI/CFzfAU2HUlJ2cUjedDbwwZItH23ucs+dS+CQGNrWqkDalZbs/cE8WWnhSx4xFn6UWOMqnZvTt8XPaSiwvYfAxUgrPf/MQo2o9mXnajQZQBLo+1HkdnN7ON+PE9XDS4ayC1PcucjkeiLZZD2pzb+9gxjXaeYhG5XW5rCGxYdZ+Jaxur/uUgEQIHcnbyDmndauKAa2iOa0u7MZJ7HiCqidxOqzNBrmwaRESE+YuxSMdfdRiS/Nu1u6rMISuaTpLxdponOan0G16wymT3WnfUWaPvZ14wDiZSnvVWSNgD68k/tPxPm2V+qz9BI0KB35C+xtCRJ8JTunVfvWfNAUjjORT7VISpotx7xawvxVQWNeKSWOMCYsX+/Vg/RhTEhNl42d7Tjd3iU9DsnbTXZ9VPN+Q+o3JQ1s9LC+SQvzk2sHrp5Ggakctevk1Fb7Dc1rruCQ9fw+R4Q15yEsotJb6MHO6kKL0lhxI9PlpX2YeJo8PiCZi4x1cHWpWgZStDUE7eaJGc7nbBniKlq79XeCdIh8dNx9ZBAnAqXlC1rBkEzBda/2zRixYMtKK+yXVUdFRfWfnpXHd9Lggcmgs0eim0ZvRdvBFyQfBmjuoE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(346002)(39860400002)(136003)(376002)(396003)(451199015)(86362001)(31696002)(36756003)(38100700002)(31686004)(2616005)(2906002)(53546011)(6506007)(6512007)(26005)(186003)(478600001)(83380400001)(8936002)(66946007)(6486002)(4326008)(5660300002)(316002)(8676002)(54906003)(6916009)(41300700001)(66476007)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SXJQaHVQNVQ0STNzWjVPNDgxa2JiMmRuSkRaeGU2Nm5kVUhuZEtVc2FQVjFp?= =?utf-8?B?VU9XRGkyOG9Xd1BmOXJMckxOMkJ0R0ZPUFhadUdkWGJJaXdVS2draEFDd1ZG?= =?utf-8?B?aGEyU1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lmWU5C?= =?utf-8?B?S2Q3T3BTRnIvK1VscGt2RC9JTVBpS3RsMmgxTVZXN01NWHpjZ0RsTEZnbmZJ?= =?utf-8?B?RXoyanh6NDVST0ZkbDRSTTF4Y0dnN1BNY3ZZUnBTTklZWXVucERXUGNGUzht?= =?utf-8?B?Zy9ibVRpdkdReEIzRkRIeUhDTGJWejRlbWo5RnNnbnI2S2IvZWlSS1RTUVps?= =?utf-8?Q?eL7wUY5zcYCF9VzEzIXCbmGVi?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 506150e1-9c8e-4a9b-bd44-08dab72f0ea4 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2022 08:49:56.5557 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: hmxC00x9GbyuoVypnJxOZtJGq3RdQBVmBymVopEEQlE+ZhOkxRc3Wop0P9rILNH70/fXYxOT8Tzndz1ixJE85Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7648 X-Spam-Status: No, score=-3029.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP 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 26.10.2022 05:03, Jiang, Haochen wrote: >> -----Original Message----- >> From: Jan Beulich >> Sent: Tuesday, October 25, 2022 2:53 PM >> To: Jiang, Haochen >> Cc: hjl.tools@gmail.com; binutils@sourceware.org >> Subject: Re: [PATCH 04/10] Support Intel CMPccXADD >> >> On 24.10.2022 07:55, Jiang, Haochen wrote: >>>> -----Original Message----- >>>> From: Jan Beulich >>>> Sent: Friday, October 14, 2022 9:47 PM >>>> >>>> On 14.10.2022 11:12, Haochen Jiang wrote: >>>> And finally - is SwapSources really appropriate to use here? There's only >> one >>>> pure source operand, the other two are also serving as destinations. >>>> I wonder whether an attribute is necessary here in the first place: Vex- >> encoded >>>> insns with a memory destination never have two further register >> operands, so >>>> that property should suffice for identifying the case in >> build_modrm_byte(). >>>> Alternatively you could also simply use the CPU flag. >>> >>> We may need a special identifier for CMPccXADD since we have VVVV at >>> operand 3, where it is always at operand 2 for all other insts which >>> have VVVV. That is the reason we reuse SwapSources. It might be not >>> that same as the original meaning. But we want to avoid adding a bit >>> for this very rare case. Do we need to change that? >> >> Re-using existing attributes is certainly preferred. But the question here >> was whether _any_ special attribute is needed. Did you try out my >> suggestion, >> and it didn't work out for some reason? Avoiding the (ab)use of an >> inappropriately (for the purpose here) named attribute would imo be >> preferable. > > Actually we have some similar instructions. For example, vmaskmovps/d. > It could also take one memory operand as dest and two register operands > as source. As you say there are two _source_ operands here, whereas ... > However, cmpxadd has a different encoding pattern with it. The default > behavior for previous insts like vmaskmovps/d in Intel syntax is to encode > first register operand as vvvv and second register operand as modrm:reg. > In cmpxadd, it is swapped, with first register operand as modrm:reg and > second register operand as vvvv. I suppose it makes sense to use SwapSource > and it is quite hard or might be dirty to just use the number of registers to > identify them in build_modrm_byte(). ... this has two destinations (memory and a register). Which is why using SwapSource at best is a slight abuse (which, as said, I'd prefer to avoid). But yes, I agree that going _just_ from a memory destination with two further register ops is not sufficient. Seeing what H.J. and I are suggesting for the PREFETCHI change: How about using the CPU flag in the conditional that you add? Jan