x86: Allow 16-bit register source for LAR and LSL
authorH.J. Lu <hjl.tools@gmail.com>
Sat, 3 Dec 2022 02:43:20 +0000 (18:43 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sat, 3 Dec 2022 16:55:40 +0000 (08:55 -0800)
commit859aa2c86dc9721424d96584879385a18ccf76ed
treeac18e5d21dbd85c8ddf575ed9b698a2c3fbc6cb5
parent8169d2a118c45f8a79cb3e00039ec1d01e994d9c
x86: Allow 16-bit register source for LAR and LSL

Since LAR and LSL only access 16 bits of the source operand, regardless
of operand size, allow 16-bit register source for LAR and LSL, and always
disassemble LAR and LSL with 16-bit source operand.

gas/

PR gas/29844
* testsuite/gas/i386/i386.s: Add tests for LAR and LSL.
* testsuite/gas/i386/x86_64.s: Likewise.
* testsuite/gas/i386/intelbad.s: Remove "lar/lsl eax, ax".
* testsuite/gas/i386/i386-intel.d: Updated.
* testsuite/gas/i386/i386.d: Likewise.
* testsuite/gas/i386/intel-intel.d: Likewise.
* testsuite/gas/i386/intel.d: Likewise.
* testsuite/gas/i386/intelbad.l: Likewise.
* testsuite/gas/i386/x86_64-intel.d: Likewise.
* testsuite/gas/i386/x86_64.d: Likewise.

opcodes/

PR gas/29844
* i386-dis.c (MOD_0F02): Removed.
(MOD_0F03): Likewise.
(dis386_twobyte): Restore larS and lslS.
(mod_table): Remove MOD_0F02 and MOD_0F03.
* i386-opc.tbl: Allow 16-bit register source for LAR and LSL.
* i386-tbl.h: Regenerated.
13 files changed:
gas/testsuite/gas/i386/i386-intel.d
gas/testsuite/gas/i386/i386.d
gas/testsuite/gas/i386/i386.s
gas/testsuite/gas/i386/intel-intel.d
gas/testsuite/gas/i386/intel.d
gas/testsuite/gas/i386/intelbad.l
gas/testsuite/gas/i386/intelbad.s
gas/testsuite/gas/i386/x86_64-intel.d
gas/testsuite/gas/i386/x86_64.d
gas/testsuite/gas/i386/x86_64.s
opcodes/i386-dis.c
opcodes/i386-opc.tbl
opcodes/i386-tbl.h