From patchwork Fri Oct 14 10:22:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 2643 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp102743wrs; Fri, 14 Oct 2022 03:23:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ZglDjpZDSKjVYgj/PP+RDambPuBxzETH9O5SlPNHKwubSiCU0jSe99rlcacxagzxvQQsL X-Received: by 2002:aa7:c78e:0:b0:456:c524:90ec with SMTP id n14-20020aa7c78e000000b00456c52490ecmr3660564eds.192.1665742991480; Fri, 14 Oct 2022 03:23:11 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id qw22-20020a1709066a1600b0078dcf11ccf7si1942261ejc.802.2022.10.14.03.23.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 03:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=kmh44z1G; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE25A3850400 for ; Fri, 14 Oct 2022 10:23:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE25A3850400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665742989; bh=hXnf4Ww/Nzlusbu+lDwMQulErZH8V0CvscvN7tAmdqo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=kmh44z1GMpx8EnXglWX7AWBXvgVRc2CbOgVPU0Jn3coe45pVoJKmiMVhNKeRI/S0N wId96YRTvYMcdzn1NdeH4E8gNupDdrXN51oLRYhig+eoudcYLh9nb/OARQzSC5iHcA Rk02ynqzUy5EtpTRPQtVz8+gxDG3od2e94uyY/84= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2083.outbound.protection.outlook.com [40.107.103.83]) by sourceware.org (Postfix) with ESMTPS id 79F4E385414E for ; Fri, 14 Oct 2022 10:22:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79F4E385414E ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzfGOOmfVN2K1cahXd8/gtzl+73rzLZ4F1njQ7jRu1sLfXqnWI7HDYqVP8uRzrqmb82Ty4nwBXkrs+/43UvDGOv404kdmQQmQYgqyDPdjlcn/Zf2oCc0Bxo//nVeHeg1M2eqL0y7hU+bGiTy766gOXhQdYMk+s9Sc9PHjNYq/WDF+Yd6CvRaJimyOaE5iyJJ/RcGAS4KmFOKeYeKKhBHNT91wcGxAYT551Vsdk72w6UXrSAyfH/LS7nTkMcu0IiYqa4pqG63tuIYUT4NYMTZAX0DUIbedfZ/a+967Qto3tMoMPe9dPNMsR8zr3Oy9rGssZ0NYcTv8oxjV9bZxmmy3w== 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=hXnf4Ww/Nzlusbu+lDwMQulErZH8V0CvscvN7tAmdqo=; b=LKCUhbeoG9STPyF3Prr3swQY1RT78Jw+sY8F+LEyxJ2WurCMLojQq6ZcFI+ippTD1h11bJZPc0HUm3HU1ZwX91uU/0UyiZdoUOwhQiScra61KEry3dY/rWXPlvDV2cYwSzzw4paZXJJJfkfx2V3IzocqFFMHcLfQsjNQ6MpIuWA+iOupa0k7EDPRvx8nfy/nvIR3yU83Cf6nXRdXQJvsWCSe/C42CWqEnYE9PgAxpyrMXSePlbLqxckgohJgZaHUWW3Uef/1XGOau27jBtrTp3kU8TnvhPCRdto4peavGAeg/Zuol3wLws8KQKuUvhXk0D/X8t4Meemr6EAYVctuFw== 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 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AM7PR04MB6903.eurprd04.prod.outlook.com (2603:10a6:20b:10d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 14 Oct 2022 10:22:36 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2459:15ae:e6cb:218a]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::2459:15ae:e6cb:218a%7]) with mapi id 15.20.5723.026; Fri, 14 Oct 2022 10:22:36 +0000 Message-ID: <7bac66be-535e-9051-d674-f2f5ba180e17@suse.com> Date: Fri, 14 Oct 2022 12:22:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Content-Language: en-US To: Binutils Subject: [PATCH] x86: fold AVX512-VNNI disassembler entries with AVX-VNNI ones X-ClientProxiedBy: FR0P281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:15::22) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AM7PR04MB6903:EE_ X-MS-Office365-Filtering-Correlation-Id: 3913ef88-866c-465c-54a2-08daadce0374 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4/llVuz+/xIvnZetsc8pA8jx9c+GSeiGT+/BbRG1aJrdK8SrTYpwzkjQBfLoKj+Ae9BMR5F5T+PV3P1BF3+wTc/bqjeW01c0at1bCCy516uh9rPAbTRICJNRRoFKMYZT52YsW7VWD/h+oILWMAWGoYChx+O1iNSwZxPYVBUdcIrc+N7AAIj8/74TAuiddJOhx4fL2Pa/J6llvgrZCRSMIrD9hvB5tDLvMlXX4pu+pppDNZxPCCkhwXLVV0otRyXuFu22/OsknlbpxtM7SFn2x182Zf5cdb6gzxEUKEDERT15MN1Al+qKN21bFyMbwPQF0HkCaaUTeiPi9gpc5vGG9IyizAdKaL0wbkL+a42GmTuPQ8cQr52BFlXldszoNNvL2Cbwn5C+5pzpc8tACLdR5zv/zSaIh7dLcSZsTAiuywqKo6p5598ZE3hI1juqMsE748UEl4V9CbyzmLwZ110CJd0LcTnQCJwXJFHnzuc/wZb4IoALAuf7Nt5R7r2+k0GIcL8JfnxSck7mM78I1tKr9pRFgMAnczz4y1wtjFFwRIvYLBm2JeLpC2cEb4oWgDm4TdvQg5SoQYRbOGVj+PkiSZNX1Rm4Gkd4A6jkTrXFk710cI0CxPpR+mPvusyBZc09AnXtdhG7W0K0z/BGaLPPuYRbs6Qk5C3nTM2LEV2Wm+tVoq5Nl6lAPWhUDa2JlUIddhUBBgDsPS0V1rkdcxLD2rSqvwmF5Xgx0C997J7PVO1kVXfOIPrCK+X137DgnHQLvW3wOmDdZPcWv/Ee9kdJMBc4Qms7or3UF8bGWjJ04I4= 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)(39860400002)(376002)(136003)(396003)(346002)(451199015)(6916009)(54906003)(5660300002)(186003)(8936002)(26005)(6512007)(2906002)(6486002)(2616005)(6506007)(86362001)(41300700001)(36756003)(31696002)(478600001)(38100700002)(316002)(31686004)(66556008)(66946007)(4326008)(8676002)(66476007)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?qw+GsnWkk00bjkbLkgQ1Q7v3fdT4?= =?utf-8?q?CGdOOnjodDjuIOOXmAO5UiVKcDdmQ0IdLoliX5hF6br71Wo5nMOO9CdCNPRX5a6/r?= =?utf-8?q?49eMFsGjiuYa/qlTx26tOP8lkpRBhqTB6zE1GzAoHJICs7ZL6vK1X1HPU8m0Kt8V+?= =?utf-8?q?MuLKIn93NysLehJnZgMP1ESsczRrb4d17wrGCVqN0gOQPtd6JjPz6Um6RQtIWb+Dc?= =?utf-8?q?zKNSYra3dO63gpNcBT2RH2Im+IHxLWRKcfwhyQS9AFdY5mGPF+74tMsMQoi1hDjCG?= =?utf-8?q?SufmSLdvuLurFLr8ALRXlJBfVvqbNORzLmSPm4FLKhoXhSJC4s7Bks6Sa+4DT3kVD?= =?utf-8?q?8QdsjEfdysJykUsFZs6xJf2ZtFjMsJy5w3kT1zQdDoMpDQAh7ZRTMvclGVvyK0DVd?= =?utf-8?q?A1sXthsCXWDUREJnzfj61GD4lU8oWQcbwJE8TQ7oCqkVVNQaFs/hgDpb8sOXIymiE?= =?utf-8?q?ex4atWDaLiqaTrNC01WtkIoXN18PCghUE15q6n605+Kyyj+dejBsFFg8OEp9z0j+t?= =?utf-8?q?kb3xwIdsgrH6KM7vN+vDvsYQGse1vZzLrPd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M?= =?utf-8?q?t3a1v1c35/lmf81XMWFMCKUp50TWWWKKtvWRVpFna1fxAojIpLGrUldtJBwY67XOG?= =?utf-8?q?0Mcoin+TKVvJ?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3913ef88-866c-465c-54a2-08daadce0374 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2022 10:22:36.0107 (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: RWSUAy/FURiR89rjWsWjTNCFTdXrSgn+WNoCueIdsVslc+2D7W3AynTblz5MrSSnz8NOAfZ0LyY7xNLW8MQUig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6903 X-Spam-Status: No, score=-3029.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jan Beulich via Binutils From: Jan Beulich Reply-To: Jan Beulich Cc: "Jiang, Haochen" , wwwhhhyyy Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746658123235980257?= X-GMAIL-MSGID: =?utf-8?q?1746658123235980257?= Make %XV also print the separating blank in the VEX case, while making it do nothing for EVEX-encoded insns. This way the AVX-VNNI entries can be re-used for AVX512-VNNI, at the same time fixing the lack of EVEX.W decoding. For the AVX-VNNI ones further make sure only VEX.66 forms are actually decoded. --- Irrespective of this change I continue to disagree with the arbitrary printing of "{vex}" for the AVX-VNNI insns: If that's meant for disambiguation purposes, then EVEX-encoded insns not using EVEX-specific functionality by having VEX counterparts (vaddps %xmm0, %xmm0, %xmm0) should also be prefixed by "{evex}". --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1755,7 +1755,7 @@ struct dis386 { "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16) "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding - "XV" => print "{vex3}" pseudo prefix + "XV" => print "{vex} " pseudo prefix "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond being false, or no operand at all in 64bit mode, or if suffix_always is true. @@ -7545,19 +7545,19 @@ static const struct dis386 vex_w_table[] }, { /* VEX_W_0F3850 */ - { "%XV vpdpbusd", { XM, Vex, EXx }, 0 }, + { "%XVvpdpbusd", { XM, Vex, EXx }, PREFIX_DATA }, }, { /* VEX_W_0F3851 */ - { "%XV vpdpbusds", { XM, Vex, EXx }, 0 }, + { "%XVvpdpbusds", { XM, Vex, EXx }, PREFIX_DATA }, }, { /* VEX_W_0F3852 */ - { "%XV vpdpwssd", { XM, Vex, EXx }, 0 }, + { "%XVvpdpwssd", { XM, Vex, EXx }, PREFIX_DATA }, }, { /* VEX_W_0F3853 */ - { "%XV vpdpwssds", { XM, Vex, EXx }, 0 }, + { "%XVvpdpwssds", { XM, Vex, EXx }, PREFIX_DATA }, }, { /* VEX_W_0F3858 */ @@ -10711,22 +10711,29 @@ putop (instr_info *ins, const char *in_t case 'V': if (l == 0) abort (); - else if (l == 1 - && (last[0] == 'L' || last[0] == 'X')) + else if (l == 1) { - if (last[0] == 'X') + switch (last[0]) { + case 'X': + if (ins->vex.evex) + break; *ins->obufp++ = '{'; *ins->obufp++ = 'v'; *ins->obufp++ = 'e'; *ins->obufp++ = 'x'; *ins->obufp++ = '}'; - } - else if (ins->rex & REX_W) - { + *ins->obufp++ = ' '; + break; + case 'L': + if (!(ins->rex & REX_W)) + break; *ins->obufp++ = 'a'; *ins->obufp++ = 'b'; *ins->obufp++ = 's'; + break; + default: + abort (); } } else --- a/opcodes/i386-dis-evex.h +++ b/opcodes/i386-dis-evex.h @@ -383,8 +383,8 @@ static const struct dis386 evex_table[][ { "vrsqrt14p%XW", { XM, EXx }, 0 }, { "vrsqrt14s%XW", { XMScalar, VexScalar, EXdq }, PREFIX_DATA }, /* 50 */ - { "vpdpbusd", { XM, Vex, EXx }, PREFIX_DATA }, - { "vpdpbusds", { XM, Vex, EXx }, PREFIX_DATA }, + { VEX_W_TABLE (VEX_W_0F3850) }, + { VEX_W_TABLE (VEX_W_0F3851) }, { PREFIX_TABLE (PREFIX_EVEX_0F3852) }, { PREFIX_TABLE (PREFIX_EVEX_0F3853) }, { "vpopcnt%BW", { XM, EXx }, PREFIX_DATA }, --- a/opcodes/i386-dis-evex-prefix.h +++ b/opcodes/i386-dis-evex-prefix.h @@ -233,14 +233,14 @@ { { Bad_Opcode }, { "vdpbf16p%XS", { XM, Vex, EXx }, 0 }, - { "vpdpwssd", { XM, Vex, EXx }, 0 }, + { VEX_W_TABLE (VEX_W_0F3852) }, { "vp4dpwssd", { XM, Vex, EXxmm }, 0 }, }, /* PREFIX_EVEX_0F3853 */ { { Bad_Opcode }, { Bad_Opcode }, - { "vpdpwssds", { XM, Vex, EXx }, 0 }, + { VEX_W_TABLE (VEX_W_0F3853) }, { "vp4dpwssds", { XM, Vex, EXxmm }, 0 }, }, /* PREFIX_EVEX_0F3868 */