[6/8] x86: embed register names in reg_entry

Message ID 1c763a63-05e0-33e8-c9c4-48a26cbc5db7@suse.com
State Unresolved
Headers
Series x86: mnemonic and register string literals |

Checks

Context Check Description
snail/binutils-gdb-check warning Git am fail log

Commit Message

Jan Beulich Jan. 13, 2023, 11:10 a.m. UTC
  Register names are (including their nul terminators) on average almost 4
bytes long. Otoh no register name is longer than 7 bytes. Hence even for
32-bit builds using a pointer is only slightly more space efficient than
embedding the strings. A level of indirection can be also avoided by
embedding the names as an array of 8 characters directly in the struct,
and the number of base relocations in PIE builds of gas goes down as
well.
  

Patch

--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -987,7 +987,7 @@  insn_template;
 /* these are for register name --> number & type hash lookup */
 typedef struct
 {
-  const char *reg_name;
+  char reg_name[8];
   i386_operand_type reg_type;
   unsigned char reg_flags;
 #define RegRex	    0x1  /* Extended register.  */