From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id 9D625385800E; Mon, 17 Oct 2022 06:27:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D625385800E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jan Beulich To: bfd-cvs@sourceware.org Subject: [binutils-gdb] x86: fold AVX512-VNNI disassembler entries with AVX-VNNI ones X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: 07a33c2bc17fc86bbd0e8ad08f3649d852f4965f X-Git-Newrev: 995bca23f1240fa0cf0431550be581898a664037 Message-Id: <20221017062743.9D625385800E@sourceware.org> Date: Mon, 17 Oct 2022 06:27:43 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2022 06:27:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D995bca23f124= 0fa0cf0431550be581898a664037 commit 995bca23f1240fa0cf0431550be581898a664037 Author: Jan Beulich Date: Mon Oct 17 08:27:03 2022 +0200 x86: fold AVX512-VNNI disassembler entries with AVX-VNNI ones =20 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. =20 For the AVX-VNNI ones further make sure only VEX.66 forms are actually decoded. Diff: --- opcodes/i386-dis-evex-prefix.h | 4 ++-- opcodes/i386-dis-evex.h | 4 ++-- opcodes/i386-dis.c | 29 ++++++++++++++++++----------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/opcodes/i386-dis-evex-prefix.h b/opcodes/i386-dis-evex-prefix.h index 7c2fb484f95..91471723cdc 100644 --- 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 */ diff --git a/opcodes/i386-dis-evex.h b/opcodes/i386-dis-evex.h index 176529a475c..9353c9c3125 100644 --- a/opcodes/i386-dis-evex.h +++ b/opcodes/i386-dis-evex.h @@ -383,8 +383,8 @@ static const struct dis386 evex_table[][256] =3D { { "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 }, diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c index 98d3ecd9f05..83290700c65 100644 --- a/opcodes/i386-dis.c +++ b/opcodes/i386-dis.c @@ -1755,7 +1755,7 @@ struct dis386 { "XD" =3D> print 'd' if !EVEX or EVEX.W=3D1, EVEX.W=3D0 is not a valid e= ncoding "XH" =3D> print 'h' if EVEX.W=3D0, EVEX.W=3D1 is not a valid encoding (= for FP16) "XS" =3D> print 's' if !EVEX or EVEX.W=3D0, EVEX.W=3D1 is not a valid e= ncoding - "XV" =3D> print "{vex3}" pseudo prefix + "XV" =3D> print "{vex} " pseudo prefix "LQ" =3D> 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[][2] =3D { }, { /* 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_template, = int sizeflag) case 'V': if (l =3D=3D 0) abort (); - else if (l =3D=3D 1 - && (last[0] =3D=3D 'L' || last[0] =3D=3D 'X')) + else if (l =3D=3D 1) { - if (last[0] =3D=3D 'X') + switch (last[0]) { + case 'X': + if (ins->vex.evex) + break; *ins->obufp++ =3D '{'; *ins->obufp++ =3D 'v'; *ins->obufp++ =3D 'e'; *ins->obufp++ =3D 'x'; *ins->obufp++ =3D '}'; - } - else if (ins->rex & REX_W) - { + *ins->obufp++ =3D ' '; + break; + case 'L': + if (!(ins->rex & REX_W)) + break; *ins->obufp++ =3D 'a'; *ins->obufp++ =3D 'b'; *ins->obufp++ =3D 's'; + break; + default: + abort (); } } else