From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2051.outbound.protection.outlook.com [40.107.6.51]) by sourceware.org (Postfix) with ESMTPS id 57EAD3858D39 for ; Tue, 19 Sep 2023 13:16:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 57EAD3858D39 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=WrdUWEdoYgre0VE6Li+uldWZSmQzh9jVP1hqBfluDB+dhIHcDfSWm3mr3gVjavODjz4+WLTbEejgQKsyl1le6blPejw152ccdjTiDwOWv/8zzqGWAnIq5A0O1Mbj3veBbwb6lv3GeFIkCNzpQ/WacoxSjN1XaXqUROaqtti0/yQv00nLM8A8c4DmUFNzkTO3pwIPVP9IXEWn+eiXGvPjn8hdCnnFVkIq6tB03YxAy88FsajM0fwRcWymIu/OI2iDyFxHtvAvvhaa7edbCOmi0oVD3DVJ22VD9zWlN5Ltw/nN38AcckB9o5eL4uc+lrF1ZTm5XT62OEoS0bKm853Lug== 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=1TjVNidQKXRS9/gVez5wtqnQM1sTXxuiANCp10qK984=; b=di8ZKtoYq/iU+Hhf+VZjvB33fymzBCcC/TOg4EaUhr9ZxF6btXLhfTzP6prW5v1N01lMooRYQ6GyA2ENLB38ie/AjIZukMPMR3MwDBq3lvEAFlo2UOg1kFwqQiWNLxoEGtnybjzG7OTp4F44J1Ncx6jvq9Z+RCNGDWGuFsU6zMIl/1NptIg1K26q70C9k9T1YRTGMJNggBTJTaIxQ0CtFZi+bZnKwRFeWK9pyy1V+8KHMiYgPExMPOcGLdUmfbi+FMwS3W4k5wQD8d94Em4bPDYKo8bR1/+yYt8l1MCfDKP3eymHko9H+QJSzE15jk32HjVL5ceYJgoy++T4uUKa9A== 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=1TjVNidQKXRS9/gVez5wtqnQM1sTXxuiANCp10qK984=; b=0NwH33ikoXXMZHYJtFYEEY7ZJ5imDTD663DeB9uIJKJ75b4ytIVZFijT7I3KOUBrL9qf4AsRUbi8BfXmPj/pR77kMSCqXkK2kV7jmX4uAAoaSRsGNWKeW9e7fhIijYX1gX1U3PrTVpfL0vOhzijAnQ+/DyF80VfElAwmgZvInGRfsflxRL3ytTuzX3y9LrvzAtueGpMDBVY3rVNAPph4YSlDouV2GQU51SFecWtnm8sP33QzVXsqIsJ5k1XxaHgLa2Pda/Wi9+sJEFBRwW0SrrXGY/ae2O40RHRfewBKmn1UTdF82dTUWsd7Gn4i15WS/v9MZaJoFqr5b7F1Hs39Ow== 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 DB9PR04MB9306.eurprd04.prod.outlook.com (2603:10a6:10:36e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Tue, 19 Sep 2023 13:16:53 +0000 Received: from DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654]) by DU2PR04MB8790.eurprd04.prod.outlook.com ([fe80::f749:b27f:2187:6654%6]) with mapi id 15.20.6792.026; Tue, 19 Sep 2023 13:16:51 +0000 Message-ID: Date: Tue, 19 Sep 2023 15:16:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 0/7] [RFC] Support Intel APX EGPR Content-Language: en-US To: "Cui, Lili" Cc: hongjiu.lu@intel.com, binutils@sourceware.org References: <20230919125633.491660-1-lili.cui@intel.com> From: Jan Beulich In-Reply-To: <20230919125633.491660-1-lili.cui@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FRYP281CA0002.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::12) To DU2PR04MB8790.eurprd04.prod.outlook.com (2603:10a6:10:2e1::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR04MB8790:EE_|DB9PR04MB9306:EE_ X-MS-Office365-Filtering-Correlation-Id: 33048242-4169-4df8-9ce9-08dbb912afed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XpasaDX9qaggux02su/QKELHVqExWrrag2q2YUJux2tv7UkQDV3tsF2c8zIB6bCYdie2Y9STKucmT9GaCWKp8rJPJ5u0QiwZlp2q9HxJq8KkRU2Q33/VQ90FUw+bAU/uZ44MdjqWYlbzQdLONGFxoRxlD3r04xr07v/A3lWk1vG1qVHpP1xb/fTKBNy2ZTrjzuNCseXZPFHpkIe2bDcWsYwjWhBQiaHtFGmvcpBVLku/U2IdX/KDhQWzKvLFElXdXPAcTMIMAWUKAxPGVe1hvP48nYeZyiTnEHTf0+GCjBZnVKy1iLmlkhqHRTLHCWj8a9ua7DUSQKHBG9q9fzqA61NAJpQREX8ryvbhqVoTBoCM1lxQEJeWwtCrZLYOdO6Ldfoq7ysGLCVT7KYyXVZFwZGi8y4gNNn/A8/Y+03jb8EOFCeDMP02zCMoZ9zQepolfUgz8ZX8l8S/k64YEYt0J8BZDG/8eSAqEp+0u6lp8PNeIXZ2+/1ywvtdG7gyDYkSqmAeTEjEXX0DiBPZy6vEbFwcJJXNp5rAll1JxMbwQnPUJNYoFxSEhSaCqz/Hxr8qhA/pH5B4XSb2H2Kzv6u5MCHUVC48Ud3g0MAgvM5HaMeydVE9+KF/6mm8VCn+eGKkSDGRqeO5807O6TflXfGKKQ== 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)(39860400002)(136003)(346002)(376002)(366004)(396003)(1800799009)(451199024)(186009)(66556008)(66946007)(66476007)(8676002)(316002)(8936002)(6916009)(4326008)(41300700001)(53546011)(6486002)(6506007)(6512007)(478600001)(966005)(26005)(83380400001)(2616005)(86362001)(31696002)(2906002)(38100700002)(5660300002)(31686004)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YzdQbHp2dnhPdFpnb252Z3kxdklaQm5OaURWcS9KNTY3NjVIWEJ2UUNLZXBF?= =?utf-8?B?WXl0Q0JwTit2S1A1TWFTdnhmR1hpQmVIdkZTWk1SbTI3T3l0WUUzVTRJVlN0?= =?utf-8?B?UG9Wc0ZOQWVkbERuRFhCcCsxeG13QjVDUlVRVi9HSTlJZUdkMXhoVEUrK01P?= =?utf-8?B?N0lwTjJZQkVGZ2NCb2ZUMkZ4dVdoTFdnRU5tMCtOWlRYTStsRzJFSUZYT2lM?= =?utf-8?B?U2JVZnJjcUtMZTVKYkdjallNOENDTXZoV3MyWDhrZlFQeS9tNVdsOGZjejJF?= =?utf-8?B?Nk5lOEI2dVo4ZDVjWDJIU3hFQldOaldRSHpGcTh3dlZwUld2RU9MWmx5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/GClfjwqwF?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33048242-4169-4df8-9ce9-08dbb912afed X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8790.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2023 13:16:51.6954 (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: BKmcNPDNW+axdsfn95by76RV+XHowOzPyGRXU/Mq97wWFKy0UxOHtU7x7hMfrXtR7zO/j0eMPuCJ8zkQllps1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9306 X-Spam-Status: No, score=-3027.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 19.09.2023 14:56, Cui, Lili wrote: > Intel Advanced performance extension (APX) has been released in > https://www.intel.com/content/www/us/en/developer/articles/technical/advanced-performance-extensions-apx.html. > It contains several extensions such as > 1. Support APX GPR32 with rex2 prefix (For MAP0 an MAP1 legacy instructions). > 2. Support APX GPR32 with extend evex prefix(legacy, VEX and EVEX extend to EVEX prefix to support GPR32). > 3. Support APX NDD (non-destructive destination) and it's optimized encoding. > 4. Support APX Push2/Pop2 > 5. Support APX NF > 6. Support APX JMPABS > 7. Linker support for APX encoded instructions. > 8. Support APX ZU > 9. Support APX CCMP and CTEST > > Here is an introduction to the implementation of the first two patches in Binutils > > 1. APX uses the REX2 prefix to support EGPR for map0 and map1 of legacy instructions. Only adding the No_egpr flag to the instructions (legacy map0/map1) don't support EGPR (unsupported instructions are less). For map2/map3(legacy), VEX and EVEX, we use gi386-gen.c to add No_egpr. > > 2. we created new entries in i386-opc.tbl for instructions promoted from the legacy space and VEX. > The extended EVEX prefix is based on the current 4-byte EVEX prefix with the semantics of several payload bits re-defined. > EVEX extension of legacy instructions: > All promoted legacy instructions are placed in EVEX map 4, which is > currently reserved. > EVEX extension of EVEX instructions: > All existing EVEX instructions are extended by APX using the extended > EVEX prefix, so that they can access all 32 GPRs. > EVEX extension of VEX instructions: > Promoting a VEX instruction into the EVEX space does not change the map > id, the opcode, or the operand encoding of the VEX instruction. All such information belongs in the respective patches, as descriptions. ChangeLogs alone don't really help understanding _why_ certain things are done the way they are done, yet that information can be crucial when later some kind of issue needs sorting out (i.e. it needs to be in git, not just on a mailing list thread). > To do list: > 1. For REX2, All opcodes listed map0 0x4*/0x7*/0xa* and map0 0x3*/0x8* are reserved under REX2 and triggers #UD when prefixed with REX2. It should be belong to first rex2 patch, I will creat another patch to add it. > 2. Support APX ZU -- In progress > 3. Support APX CCMP and CTEST -- In progress > 4. We haven’t disabled EGPR for 3DNOW instructions. We can disable them if AMD guys requires. Nothing should allow use of the extended registers that isn't positively known to support them. > This RFC focused on EGPR implementation in binutils. It may still have potential issues or bugs and requires futher optimization. Any comments are very appreciated. > > > Cui, Lili (1): > Support APX NF > > Hu, Lin1 (2): > Support APX NDD optimized encoding. > Support APX JMPABS > > Mo, Zewei (1): > Support APX Push2/Pop2 > > konglin1 (3): > Support APX GPR32 with rex2 prefix > Support APX GPR32 with extend evex prefix > Support APX NDD > > gas/NEWS | 3 + With work not finished, this file shouldn't be updated just yet. > gas/config/tc-i386.c | 455 +- > gas/doc/c-i386.texi | 3 +- > gas/testsuite/gas/i386/apx-jmpabs-inval.l | 3 + > gas/testsuite/gas/i386/apx-jmpabs-inval.s | 6 + > gas/testsuite/gas/i386/apx-mov-inval.l | 2 + > gas/testsuite/gas/i386/apx-push2pop2-inval.l | 5 + > gas/testsuite/gas/i386/apx-push2pop2-inval.s | 9 + > gas/testsuite/gas/i386/i386.exp | 2 + > .../i386/ilp32/x86-64-opcode-inval-intel.d | 4 +- > .../gas/i386/ilp32/x86-64-opcode-inval.d | 4 +- > .../gas/i386/x86-64-apx-egpr-inval.l | 212 + > .../gas/i386/x86-64-apx-egpr-inval.s | 210 + > .../gas/i386/x86-64-apx-egpr-promote-inval.l | 17 + > .../gas/i386/x86-64-apx-egpr-promote-inval.s | 18 + > gas/testsuite/gas/i386/x86-64-apx-evex-egpr.d | 22 + > gas/testsuite/gas/i386/x86-64-apx-evex-egpr.s | 25 + > .../gas/i386/x86-64-apx-evex-promoted-intel.d | 740 + > .../gas/i386/x86-64-apx-evex-promoted.d | 740 + > .../gas/i386/x86-64-apx-evex-promoted.s | 1464 ++ > .../gas/i386/x86-64-apx-jmpabs-intel.d | 14 + > .../gas/i386/x86-64-apx-jmpabs-inval.d | 55 + > .../gas/i386/x86-64-apx-jmpabs-inval.s | 18 + > gas/testsuite/gas/i386/x86-64-apx-jmpabs.d | 14 + > gas/testsuite/gas/i386/x86-64-apx-jmpabs.s | 10 + > gas/testsuite/gas/i386/x86-64-apx-mov-inval.l | 2 + > gas/testsuite/gas/i386/x86-64-apx-mov-inval.s | 5 + > .../gas/i386/x86-64-apx-ndd-optimize.d | 120 + > .../gas/i386/x86-64-apx-ndd-optimize.s | 115 + > gas/testsuite/gas/i386/x86-64-apx-ndd.d | 165 + > gas/testsuite/gas/i386/x86-64-apx-ndd.s | 156 + > gas/testsuite/gas/i386/x86-64-apx-nf-intel.d | 633 + > gas/testsuite/gas/i386/x86-64-apx-nf.d | 633 + > gas/testsuite/gas/i386/x86-64-apx-nf.s | 1256 + > .../i386/x86-64-apx-push2pop2-decode-inval.d | 29 + > .../i386/x86-64-apx-push2pop2-decode-inval.s | 19 + > .../gas/i386/x86-64-apx-push2pop2-intel.d | 42 + > .../gas/i386/x86-64-apx-push2pop2-inval.l | 9 + > .../gas/i386/x86-64-apx-push2pop2-inval.s | 13 + > gas/testsuite/gas/i386/x86-64-apx-push2pop2.d | 42 + > gas/testsuite/gas/i386/x86-64-apx-push2pop2.s | 39 + > .../gas/i386/x86-64-apx-rex2-inval.d | 29 + > .../gas/i386/x86-64-apx-rex2-inval.s | 25 + > gas/testsuite/gas/i386/x86-64-apx-rex2.d | 148 + > gas/testsuite/gas/i386/x86-64-apx-rex2.s | 175 + > gas/testsuite/gas/i386/x86-64-evex.d | 2 +- > gas/testsuite/gas/i386/x86-64-inval-movbe.l | 31 +- > gas/testsuite/gas/i386/x86-64-inval-movbe.s | 1 + > gas/testsuite/gas/i386/x86-64-inval-pseudo.l | 12 + > gas/testsuite/gas/i386/x86-64-inval-pseudo.s | 8 + > .../gas/i386/x86-64-opcode-inval-intel.d | 4 +- > gas/testsuite/gas/i386/x86-64-opcode-inval.d | 4 +- > gas/testsuite/gas/i386/x86-64-pseudos.d | 62 + > gas/testsuite/gas/i386/x86-64-pseudos.s | 64 + > gas/testsuite/gas/i386/x86-64.exp | 19 + > include/opcode/i386.h | 2 + > opcodes/i386-dis-evex-len.h | 20 + > opcodes/i386-dis-evex-mod.h | 60 + > opcodes/i386-dis-evex-prefix.h | 91 + > opcodes/i386-dis-evex-reg.h | 155 + > opcodes/i386-dis-evex-w.h | 10 + > opcodes/i386-dis-evex-x86.h | 150 + > opcodes/i386-dis-evex.h | 638 +- > opcodes/i386-dis.c | 437 +- > opcodes/i386-gen.c | 14 + > opcodes/i386-init.h | 514 +- > opcodes/i386-mnem.h | 3921 +-- > opcodes/i386-opc.h | 26 +- > opcodes/i386-opc.tbl | 271 +- > opcodes/i386-reg.tbl | 64 + > opcodes/i386-tbl.h | 20205 +++++++++------- > 71 files changed, 23477 insertions(+), 11018 deletions(-) Please can you avoid sending out diff-s of generated files. Without that the patches are going to be quite a bit smaller and easier to handle. Jan