[PATCH 1/8] x86: move insn mnemonics to a separate table
Jan Beulich
jbeulich@suse.com
Fri Jan 13 11:12:19 GMT 2023
On 13.01.2023 12:06, Jan Beulich via Binutils wrote:
> Using full pointers to reference the insn mnemonic strings is not very
> efficient. With overall string size presently just slightly over 20k,
> even a 16-bit value would suffice. Use "unsigned int" for now, as
> there's no good use we could presently make of the otherwise saved 16
> bits.
>
> For 64-bit builds this reduces table size by 6.25% (prior to the recent
> ISA extension additions it would have been 12.5%), with a similar effect
> on cache occupation of table entries accessed. For PIE builds of gas
> this also reduces the number of base relocations quite a bit (obviously
> independent of bitness).
> ---
> An alternative to introducing i386-mnem.h would of course be to put the
> #define-s in i386-init.h. That would look like an abuse of the file to
> me, but I'd be okay switching to such an approach.
>
> As to further shrinking mnem_off (to 16 bits): I'm intending to drop
> i386_opcode_modifier as a separate struct, embedding the fields directly
> in insn_template. i386_opcode_modifier presently using only 6 bits from
> its 3rd word will allow to shrink insn_template by another word then.
> (This would also benefit readabilty of tc-i386*.c, as all the uses of
> "opcode_modifier." would go away. This would additionally reduce the
> apparent discrepancy between e.g. opcode_modifier.opcode_space and
> opcode_modifier.opcode_prefix vs base_opcode and extension_opcode.)
And of course this is patch 2/8; I'm sorry for the typo.
Jan
More information about the Binutils
mailing list