]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/config/tc-i386.c
x86: derive opcode length from opcode value
authorJan Beulich <jbeulich@suse.com>
Wed, 24 Mar 2021 07:33:33 +0000 (08:33 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 24 Mar 2021 07:33:33 +0000 (08:33 +0100)
commit9a182d0461cc34912da51f445a242b392389edd6
tree23378054b7425ee896162d67940c240b42064d61
parent3564871692e324301c2950679aa0fbb04c6d12dc
x86: derive opcode length from opcode value

In the majority of cases we can easily determine the length from the
encoding, irrespective of whether a prefix is specified there as well.
We further don't even need to record the value in the table entries, as
it's easy enough to determine it (without any guesswork, unless an insn
with major opcode 00 appeared that requires a 2nd opcode byte to be
specified explicitly) when installing the chosen template for further
processing.

Should an encoding appear which
- has a major opcode byte of 66, F3, or F2,
- requires a 2nd opcode byte to be specified explicitly,
- doesn't have a mandatory prefix
we'd need to convert all templates presently encoding a mandatory prefix
this way to the Prefix_0X<nn> model to eliminate the respective guessing
i386-gen does.
gas/ChangeLog
gas/config/tc-i386.c
opcodes/ChangeLog
opcodes/i386-gen.c
opcodes/i386-opc.h
opcodes/i386-opc.tbl
opcodes/i386-tbl.h