x86: Add {disp16} pseudo prefix
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 30 Jul 2020 23:13:02 +0000 (16:13 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 30 Jul 2020 23:13:17 +0000 (16:13 -0700)
commit41eb8e88859b297f59f4d093aab9306d4b7057d9
tree0e7f36e6e8fd93e43e1f3d2df22a35eaa7e74a50
parent5e500d33230ce2683001038177ad335365764793
x86: Add {disp16} pseudo prefix

Use Prefix_XXX for pseudo prefixes.  Add {disp16} pseudo prefix and
replace {disp32} pseudo prefix with {disp16} in 16-bit mode test.
Check invalid {disp16}/{disp32} pseudo prefixes.

gas/

PR gas/26305
* config/tc-i386.c (_i386_insn::disp_encoding): Add
disp_encoding_16bit.
(parse_insn): Check Prefix_XXX for pseudo prefixes.  Handle
{disp16}.
(build_modrm_byte): Handle {disp16}.
(i386_index_check): Check invalid {disp16} and {disp32} pseudo
prefixes.
* doc/c-i386.texi: Update {disp32} documentation and document
{disp16}.
* testsuite/gas/i386/i386.exp: Run x86-64-inval-pseudo.
* testsuite/gas/i386/inval-pseudo.s: Add {disp32}/{disp16}
tests.
* testsuite/gas/i386/pseudos.s: Add {disp8}/{disp32} vmovaps
tests with 128-byte displacement.  Add {disp16} tests.
* testsuite/gas/i386/x86-64-pseudos.s: Add {disp8}/{disp32}
vmovaps test.  Add (%r13)/(%r13d) tests.
* testsuite/gas/i386/x86-64-inval-pseudo.l: New file.
* testsuite/gas/i386/x86-64-inval-pseudo.s: Likewise.
* testsuite/gas/i386/inval-pseudo.l: Updated.
* testsuite/gas/i386/pseudos.d: Likewise.
* testsuite/gas/i386/x86-64-pseudos.d: Likewise.

opcodes/

PR gas/26305
* i386-opc.h (Prefix_Disp8): New.
(Prefix_Disp16): Likewise.
(Prefix_Disp32): Likewise.
(Prefix_Load): Likewise.
(Prefix_Store): Likewise.
(Prefix_VEX): Likewise.
(Prefix_VEX3): Likewise.
(Prefix_EVEX): Likewise.
(Prefix_REX): Likewise.
(Prefix_NoOptimize): Likewise.
* i386-opc.tbl: Use Prefix_XXX on pseudo prefixes.  Add {disp16}.
* i386-tbl.h: Regenerated.
16 files changed:
gas/ChangeLog
gas/config/tc-i386.c
gas/doc/c-i386.texi
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/inval-pseudo.l
gas/testsuite/gas/i386/inval-pseudo.s
gas/testsuite/gas/i386/pseudos.d
gas/testsuite/gas/i386/pseudos.s
gas/testsuite/gas/i386/x86-64-inval-pseudo.l [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-inval-pseudo.s [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-pseudos.d
gas/testsuite/gas/i386/x86-64-pseudos.s
opcodes/ChangeLog
opcodes/i386-opc.h
opcodes/i386-opc.tbl
opcodes/i386-tbl.h