From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2044.outbound.protection.outlook.com [40.107.22.44]) by sourceware.org (Postfix) with ESMTPS id 718C73858C78 for ; Tue, 28 Nov 2023 13:54:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 718C73858C78 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-Filter: OpenARC Filter v1.0.0 sourceware.org 718C73858C78 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.44 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701179676; cv=pass; b=KVPkhO7lbNLlb3bXupGGj9nV3DR40LzZvHLyFmusVrcblW1QbqR6Jj9dPUAO07Dpq+TSnwFo8ES+r2/zy9o7KKKpzu/JxWnhFJ1SFGx1Dib1pRlWBZCnuJJMvRYVFncu7yNxSjGJFndKhr0F61jgprG4T2qdeC7rdQXagQiEiF4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1701179676; c=relaxed/simple; bh=wNwp57zb8nSz7ApGSIbVJo8fRJ2JPMgu+21KGnp+Jcs=; h=DKIM-Signature:Message-ID:Date:Subject:To:From:MIME-Version; b=tkPYp0bshyAR6VQD/Z05DxorzdonS1AxNJQerAvWLmsnJq+cPPx2Qw/65UKKXqZ+FWF9QJO8Q1gSdyyQ+f0pnArOeESHRG9LfRHWJOYq+fzahyMOsq62Ywcu0kHE0XKUcpuuOw7WkQxI1bf3pkzy+YjhZiSMRP9y0MKRTS8x57U= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b9MumnavYGQKlUrOQF35kFNN4Eb/gAHTe5rTzPQhTToN0PpkuNqDmSMgkwRrSxdlExz8ox+BGMYXA2hTp2gGtqimHTavr6uV8eJ4ybGE6hP6+T9J4ZRSArOTTQSVW0TzcIEb8MNvR/rP4if4JfeeLxq2hbtMAyyQI9kvIqtoBAR95W/uXMR5eJqSKomR5c02+oIaWxjfH92V3Wrhgs65WlWGWnRuEyycHXqq3J+gXBHVc11CzRhirTl0z1NfJzoJGO/mwzEeCvdoFcn+vYobZc4Z+Z3buJQD7YR8LX0Q42dQHz1pAoBLdbXptUZt5bfFVD5hxOp6XHW6p/lmEUkURQ== 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=tOrve9pQ9Qv1J7Yljk9rniC5Uuvt4GVMaU5zT5TXGsc=; b=m0pEqbu1GZTw8OO5z2JcpJgM/WTktuQrI+sX2O9bF4l2tRJ7vepc/49KO39NHpXK+StTJvVma+UbvKIwxBusVojIgJvG5zLwer53z9joAL2T2NechCsO43CC4HbgUmwlIeUHd7z63Kc0WL+7EbEjHFik3t7Di0vjR6JSU+6kHI42Gy82gFHjVRLyavbZkEjIndF5EAMKFO7n5VS/tr4oYo8det5MfsQF5fnw0g+7wGXe8UrNGtEIJtuR+ilnlNQi56/hxOrNLDjsPjLQuyGWxnAfAF9rRkf7dlar9lZZflkVE8H1VPht9Q1puyTo5D/JGOJwX1z3kmKl+VH6vTUW7g== 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=tOrve9pQ9Qv1J7Yljk9rniC5Uuvt4GVMaU5zT5TXGsc=; b=vkS07cDb26SWgxXxBvysTkp6TL75wcd/yugYsy/A1qMwdnamh7xHx9z5OoHbKHeMHsl1gPDyBsvgc+hs3+Ci9DvQtH8l5SO+ua54egxSZORuJLO08V9M2dTgPgJKkSoQyZBLpS2afgkjzwSkKzQJtMFQc5K+fZoR9PkKcUSk6C21hDt3rVR35XidSTjHDpLn3pv4o/BIkOhLyN6aOG3LsbGFgFYoNhT/3mHSRZ8eyoZVT0SAc53jSJjJrIHUFqX6CYZu1J5rluaz6JCY/1s2UnOEGQ3LR6w5uf08/imGirTwhdHu7XRqVQmkIiS9Sr17UCKf3aCwaZQniQNqAtGo/g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) by AM9PR04MB8276.eurprd04.prod.outlook.com (2603:10a6:20b:3e7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.21; Tue, 28 Nov 2023 13:54:32 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::eb8e:fa24:44c1:5d44]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::eb8e:fa24:44c1:5d44%3]) with mapi id 15.20.7046.015; Tue, 28 Nov 2023 13:54:32 +0000 Message-ID: <83c937ed-48e4-4f38-96ec-aab662ae97ac@suse.com> Date: Tue, 28 Nov 2023 14:54:30 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Support APX PUSHP/POPP Content-Language: en-US To: "Cui, Lili" Cc: "Lu, Hongjiu" , "ccoutant@gmail.com" , "binutils@sourceware.org" References: <20231127123106.3600817-1-lili.cui@intel.com> <4f005f5c-52c4-4631-bee7-6396add7c5df@suse.com> <3abc4b98-59ab-48b4-8690-99d00e55ad1f@suse.com> <8858e7c5-97b2-4ec4-bd21-6371f92493bb@suse.com> From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk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v1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0117.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:bb::6) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|AM9PR04MB8276:EE_ X-MS-Office365-Filtering-Correlation-Id: b562d253-37bb-4f12-02f1-08dbf0198c2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1B5ug5MlLz7v8H2lLneQqhRgcQaiw2XRWqop146rQmLcY7ruC/gKaDOydmwW72TEB44lvryeRp/qRiebrxcqhpjSQzVvAd7uk6tdUsXkxGw6uhmE6208gBVN370MGfAxh2prMzJjxSa+/H81wm4ZRBNcHO0dby9XyPqURWiG6KL1f3xeumndzK2OxydS8dNv2m9DKSL5c3WP1Yct/s7abEB2ExRgTohmXxNxd/hbUM200xHolfDx9Go0kcBrYiXARe37doh3/s5Vptw5wgsZw87WZkhOjC/KK8SUBBoNuQMm1McEsp6iISvlXRIKk6I6ArTzbCbvD3BL2OB5XLFXIt/uaM5mQhcPPX0UUqjCQNRbYxpEH0/NDY4XkIHyZKHf4k4CHZ9Uvk4Ceo8kOkL0B/yS9XEMVF4FiU4SYERqQupyc9EeYLV/NUC7hehUChpw3qRuL9CqhnyB6xt4nSUoNwQjFOOMnIWwfdFpXtSZjjFWK5w5iJIumfc3obe5OGmCxHzKMRUUqPVYExbo+33ZYpfmFH06jEK3v5i2RhKYa5bgZFPLVTZcgSarSmGYmExHyOaMpYDPdR2KjCET9vKM+rEruUFNpzOOKNwq3A2Z0RX8hnV/IAZ2do6B0QLhneA9H6hQHcDDerlODZAjQ0DhmA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8790.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(376002)(136003)(366004)(346002)(39860400002)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(31686004)(26005)(66899024)(53546011)(2616005)(478600001)(6486002)(6506007)(6512007)(38100700002)(86362001)(5660300002)(31696002)(36756003)(41300700001)(2906002)(66946007)(83380400001)(66476007)(66556008)(316002)(8676002)(6916009)(54906003)(8936002)(4326008)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L3hJU2FyOTFZUE81bjdoV1ZMRHc2cTNsL01LM3BCbCtmZ2JIOEVXTkZ6RUVh?= =?utf-8?B?djFBbVR0QU5IYTlybFk3VktnRGp6YTJha25ldzZyWHV5QnY2OGREY2oyM0Fs?= =?utf-8?B?WHJvS0ZlOFRuMXE0UzEyczh6Q2FZdWcrRHR2K0EvanJoZnY1NVp4a3hBOXhW?= =?utf-8?B?SmE3enF2Qkg2cGRkbmE4cjZ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f-8?B?QVlDNXV3QVRib3ZmVFpBYkIwZnh6MDVMQzNYL2xZMHZCT25BU08rSFBaQTNh?= =?utf-8?B?M2VsZXRqYzZ4clFsSE1sbWQ3RUZrVitzVXZTRUViQmpxMmFaNHdUMk9iVWVI?= =?utf-8?Q?uy3iCWEEQPVbu6zN9OP2tH25j?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: b562d253-37bb-4f12-02f1-08dbf0198c2c X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2023 13:54:32.0416 (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: ByRWKq2s1IlYjYALVoKiY2Xzst6JkeKGqFiNGEx+wEzVvkE9aENh041TUQPlsgJVH0YmBYz5PFGYViQwI1dnww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8276 X-Spam-Status: No, score=-3032.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 28.11.2023 14:14, Cui, Lili wrote: >> >>>>>>> @@ -10621,6 +10621,19 @@ putop (instr_info *ins, const char >>>>>> *in_template, int sizeflag) >>>>>>> case 'P': >>>>>>> if (l == 0) >>>>>>> { >>>>>>> + /* For pushp and popp, do not print {rex2} for them. */ >>>>>>> + if (ins->address_mode == mode_64bit && !cond >>>>>> >>>>>> I don't think the mode_64bit check is needed here, as without that >>>>>> REX.W cannot possibly be set (nor can a REX2 prefix be present). >>>>> >>>>> Done. >>>>> >>>>>> >>>>>>> + && ins->last_rex2_prefix >= 0 && (ins->rex & REX_W)) >>>>>>> + { >>>>>>> + *ins->obufp++ = 'p'; >>>>>>> + ins->rex2 |= 16; >>>>>> >>>>>> Please no new use of magic constants. Have a #define with a >>>>>> suitable name, and use that here. Also I think the comment you have >>>>>> ahead of the if() actually belongs here? >>>>>> >>>>> >>>>> How about " #define IMPLICIT_REX2 16", PUSHP/POPP can share it with >>>> JMPABS. >>>> >>>> But what's implicit about the REX2 prefix here? >>> >>> PUSHP/POPP requires rex2.w ==1 and we don't want to print {rex2} for it. >> JMPABS has the same need, so I want to define a common macro for them, or >> NO_NEED_PRINT_REX2? >> >> Yes, we want a shared constant here (as much as we want a shared way of >> dealing with the need to emit REX2 in the assembler). Still, the naming wants >> to fit not only the goal (to suppress the printing of {rex2}), but also where the >> bit is actually stored (in ->rex2). Therefore its name wants to fit with the other >> names used for bits in that field. Which (to me) first of all means it wants to >> start with REX_ (or REX2_). >> REX_SPECIAL or REX2_SPECIAL might be an option, but might also be too >> generic (i.e. becoming an issue down the road). But I think this should give you >> an idea ... > > How about REX2_ IGNORED ? Perhaps. It's no better or worse than REX2_SPECIAL. Just make sure you add a comment explaining what it's to be used for. >> Then again, why is this constant needed for PUSHP/POPP, which have REX2.W >> set anyway, and hence that bit alone (when properly marked as >> consumed) should already allow to omit {rex2}. The question of adding a new >> constant (and how to suitably name it) would then be fully constrained to the >> JMPABS patch (for now, i.e. until such time that a 2nd insn appears which >> requires an otherwise empty REX2 prefix). >> > > The current implementation is that no matter whether rex.w is consumed or not, {rex2} will be printed as long as there is no Egpr. Of course, this place may be changed as discussed later. That's a bug then. If there is a REX2 prefix with just REX2.W set, and if that bit is properly consumed, no {rex2} should be printed imo. That's despite the same thing being expressable (in the common case; not here) with REX.W. Anything beyond that depends on the wider question of how to deal with _unused_ REX2 payload bits. >>>>>> The new Rex2 attribute is not only wasteful (it can easily be a new >>>>>> enumerator used with OperandConstraint), but also misleading. We >>>>>> don't just need REX2 here, but we need it with REX2.W set. Even if >>>>>> from the tc-i386.c changes it looks as if that was happening >>>>>> implicitly (presumably due to the absence of NoRex64), naming still >>>>>> needs >>>> to properly reflect the purpose. >>>>>> >>>>> >>>>> You are right, rex2.w is set in process_suffix, since there is no NoRex64. >>>>> >>>>> How about Rex2W? >>>>> if (i.tm.opcode_modifier.rex2w) >>>>> { >>>>> i.rex2_encoding = true; >>>>> i.rex |= REX_W; // add NoRex64 back, and set REX_W here. >>>>> } >>>>> >>>>> >>>>> Or just add a special judgment? >>>>> >>>>> if (t->mnem_off == MN_pushp || t->mnem_off == MN_popp) { >>>>> i.rex2_encoding = true; >>>>> i.rex |= REX_W; // add NoRex64 back, and set REX_W here. >>>>> } >>>> >>>> I'd prefer the latter over a new attribute (albeit once again with >>>> the comment actually matching code), and perhaps I view the latter >>>> equal to my earlier suggestion. >>>> >>> >>> Ok, put them in process_operands, there's already a special handler here to >> change the prefix. >>> >>> diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index >>> 0dde2a9ad44..2f2b1b04d10 100644 >>> --- a/gas/config/tc-i386.c >>> +++ b/gas/config/tc-i386.c >>> @@ -8715,6 +8715,13 @@ process_operands (void) >>> i.tm.operands++; >>> } >>> >>> + /* PUSHP/POPP requires rex2.w == 1. */ if (i.tm.mnem_off == >>> + MN_pushp || i.tm.mnem_off == MN_popp) >>> + { >>> + i.rex2_encoding = true; >>> + i.rex |= REX_W; >>> + } >> >> Well, I'm sorry for not considering JMPABS earlier on, but with that also >> needing dealing with, I think I view my alternative suggestion as preferable. >> That'll scale better when also considering that down the road further such >> insns may appear. Whether it's actually OperandConstraint that we leverage >> here is secondary (it's not ideal because there's nothing operand related here). >> I'd be perfectly okay with some other attribute being suitably overloaded, >> whereas I continue to think that introducing new attributes should preferably >> be limited to either cases where more than just two or three templates use >> them or cases where otherwise it's impossible to avoid ambiguities. From >> earlier changes of mine the underlying reason ought to be pretty clear: Each >> new attribute consumes storage, and with thousands of templates growth of >> storage requirements should be balanced with how frequently an attribute is >> actually going to have a non-zero value. For example, with is_evex_encoding() >> gone a brief inspection suggests that it might be possible to overload Masking >> (or maybe Broadcast): They're applicable to EVEX templates only, and the class >> of insns we're discussing here is never going to be EVEX (or VEX). IOW not >> much different from the overloading of StaticRounding. Such an overload may >> then well be named Rex2 (as you had it, and considering its intended use also >> for JMPABS, plus taking into consideration that REX2.W will be set simply >> because of the absence of NoRex64). >> > > Haha, StaticRounding is really special, I tried "#define Rex2Req Masking" and found that it will be used in i386-gen.c to identify EVEX (Broadcast...), then I tried VexW and SIB found that they are all used without precheck whether it was an vex instruction. Finally I wanted to re-use StaticRounding and found out that hulin already uses it for legacy insns. Hmm, I'm sorry for the trouble. I'm inclined to say OperandConstraint with a new #define it is then. Once everything's in I could then still see whether I can (reasonably) make e.g. Masking work here. Jan