From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id 8B97C3858C5F; Fri, 10 Feb 2023 07:15:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B97C3858C5F 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: limit use of XOP2SOURCES X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: ddb62495930cc8adf4986334b49104d623b0217d X-Git-Newrev: ba3ffa6de0510892bf8020188d834f24ea8b7f75 Message-Id: <20230210071519.8B97C3858C5F@sourceware.org> Date: Fri, 10 Feb 2023 07:15:19 +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: Fri, 10 Feb 2023 07:15:19 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dba3ffa6de051= 0892bf8020188d834f24ea8b7f75 commit ba3ffa6de0510892bf8020188d834f24ea8b7f75 Author: Jan Beulich Date: Fri Feb 10 08:14:27 2023 +0100 x86: limit use of XOP2SOURCES =20 The VPROT* forms with an immediate operand are entirely standard in the way their ModR/M bytes are built. There's no reason to invoke special case code. With that the handling of an immediate there can also be dropped; it was partially bogus anyway, as in its "no memory operands" portion it ignores the possibility of an immediate operand (which was okay only because that case was already handled by more generic code). Diff: --- gas/config/tc-i386.c | 14 ++++---------- opcodes/i386-opc.tbl | 2 +- opcodes/i386-tbl.h | 8 ++++---- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 79ca9e1006a..01b10c1f190 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -8620,17 +8620,11 @@ build_modrm_byte (void) =20 if (i.tm.opcode_modifier.vexsources =3D=3D XOP2SOURCES) { - if (operand_type_check (i.types[0], imm)) - i.vex.register_specifier =3D NULL; + /* VEX.vvvv encodes one of the sources. */ + if (i.tm.opcode_modifier.vexw =3D=3D VEXW0) + i.vex.register_specifier =3D i.op[0].regs; else - { - /* VEX.vvvv encodes one of the sources when the first - operand is not an immediate. */ - if (i.tm.opcode_modifier.vexw =3D=3D VEXW0) - i.vex.register_specifier =3D i.op[0].regs; - else - i.vex.register_specifier =3D i.op[1].regs; - } + i.vex.register_specifier =3D i.op[1].regs; =20 /* Destination is a XMM register encoded in the ModRM.reg and VEX.R bit. */ diff --git a/opcodes/i386-opc.tbl b/opcodes/i386-opc.tbl index bf55fbcd002..48ccca05882 100644 --- a/opcodes/i386-opc.tbl +++ b/opcodes/i386-opc.tbl @@ -1877,7 +1877,7 @@ vpmadcsswd, 0xa6, XOP, Modrm|SpaceXOP08|VexSources=3D= 2|VexVVVV=3D1|VexW=3D1|NoSuf|Vex, vpmadcswd, 0xb6, XOP, Modrm|SpaceXOP08|VexSources=3D2|VexVVVV=3D1|VexW=3D1= |NoSuf|Vex, { RegXMM, RegXMM|Unspecified|BaseIndex, RegXMM, RegXMM } vpperm, 0xa3, XOP, D|Modrm|SpaceXOP08|VexSources=3D2|VexVVVV|VexW0|NoSuf|V= ex, { RegXMM, RegXMM|Unspecified|BaseIndex, RegXMM, RegXMM } vprot, 0x90 | , XOP, D|Modrm|Vex128|SpaceXOP09|VexW0|VexSour= ces=3D1|NoSuf, { RegXMM, RegXMM|Unspecified|BaseIndex, RegXMM } -vprot, 0xc0 | , XOP, Modrm|Vex128|SpaceXOP08|VexW0|VexSource= s=3D1|NoSuf, { Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } +vprot, 0xc0 | , XOP, Modrm|Vex128|SpaceXOP08|VexW0|NoSuf, { = Imm8, RegXMM|Unspecified|BaseIndex, RegXMM } vpsha, 0x98 | , XOP, D|Modrm|Vex128|SpaceXOP09|VexW0|VexSour= ces=3D1|NoSuf, { RegXMM, RegXMM|Unspecified|BaseIndex, RegXMM } vpshl, 0x94 | , XOP, D|Modrm|Vex128|SpaceXOP09|VexW0|VexSour= ces=3D1|NoSuf, { RegXMM, RegXMM|Unspecified|BaseIndex, RegXMM } =20 diff --git a/opcodes/i386-tbl.h b/opcodes/i386-tbl.h index 29fad3fab11..b6823f8eb59 100644 --- a/opcodes/i386-tbl.h +++ b/opcodes/i386-tbl.h @@ -43457,7 +43457,7 @@ static const insn_template i386_optab[] =3D 1, 0, 0, 0, 0, 0 } } } }, { MN_vprotb, 0xc0 | 0, 3, SPACE_XOP08, None, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -43491,7 +43491,7 @@ static const insn_template i386_optab[] =3D 1, 0, 0, 0, 0, 0 } } } }, { MN_vprotw, 0xc0 | 1, 3, SPACE_XOP08, None, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -43525,7 +43525,7 @@ static const insn_template i386_optab[] =3D 1, 0, 0, 0, 0, 0 } } } }, { MN_vprotd, 0xc0 | 2, 3, SPACE_XOP08, None, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -43559,7 +43559,7 @@ static const insn_template i386_optab[] =3D 1, 0, 0, 0, 0, 0 } } } }, { MN_vprotq, 0xc0 | 3, 3, SPACE_XOP08, None, { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,