x86: shrink prefix related disassembler state fields
authorJan Beulich <jbeulich@suse.com>
Mon, 13 Jun 2022 07:52:33 +0000 (09:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 13 Jun 2022 07:52:33 +0000 (09:52 +0200)
commiteebc56d682ddc8da6c9caa50bee4225926e3accd
tree0e9ec396074943eafc2b181a0b97c1c7bdd12f62
parent384e201e5aec29412a18b8386aa0a1ab6743e6cb
x86: shrink prefix related disassembler state fields

By changing the values used for "artificial" prefix values,
all_prefixes[] can be shrunk to array of unsigned char. All that
additionally needs adjusting is the printing of possible apparently
standalone prefixes when recovering from longjmp(): Simply check
whether any prefixes were successfully decoded, to avoid converting
opcode bytes matching the "artificial" values to prefix mnemonics.

Similarly by re-arranging the bits assigned to PREFIX_* mask values
we can fit all segment register masks in a byte and hence shrink
active_seg_prefix to unsigned char.

Somewhat similarly with last_*_prefix representing offsets into the
opcode being disassembled, signed char is sufficient to hold all possible
values.
opcodes/i386-dis.c