aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-01-20 10:15:48 +0100
committerJan Beulich <jbeulich@suse.com>2023-01-20 10:15:48 +0100
commit5c1392029158fa5b2946953394e566c83a0602e1 (patch)
tree5f79804018ce30301d631fb85a437ff91d26e930 /gas
parent76d3f746c538af9204bbf5d7f90188a65048c0da (diff)
downloadfsf-binutils-gdb-5c1392029158fa5b2946953394e566c83a0602e1.zip
fsf-binutils-gdb-5c1392029158fa5b2946953394e566c83a0602e1.tar.gz
fsf-binutils-gdb-5c1392029158fa5b2946953394e566c83a0602e1.tar.bz2
x86: move insn mnemonics to a separate table
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).
Diffstat (limited to 'gas')
-rw-r--r--gas/Makefile.am2
-rw-r--r--gas/Makefile.in2
-rw-r--r--gas/config/tc-i386.c3
3 files changed, 4 insertions, 3 deletions
diff --git a/gas/Makefile.am b/gas/Makefile.am
index 03f51c7..f8770e8 100644
--- a/gas/Makefile.am
+++ b/gas/Makefile.am
@@ -453,7 +453,7 @@ i386_tbl_deps = $(srcdir)/../opcodes/i386-opc.tbl \
$(srcdir)/../opcodes/i386-reg.tbl \
$(srcdir)/../opcodes/i386-gen.c $(srcdir)/../opcodes/i386-opc.h
-$(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h: @MAINT@ $(i386_tbl_deps)
+$(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h $(srcdir)/../opcodes/i386%mnem.h: @MAINT@ $(i386_tbl_deps)
@echo '"$@" is outdated wrt "$?"' >&2
@echo 'Please rebuild from the top level or in $(CURDIR)/../opcodes/' >&2
@false
diff --git a/gas/Makefile.in b/gas/Makefile.in
index c86d333..d8d4953 100644
--- a/gas/Makefile.in
+++ b/gas/Makefile.in
@@ -2070,7 +2070,7 @@ development.exp: $(BFDDIR)/development.sh
config/tc-i386.o: $(srcdir)/../opcodes/i386-init.h $(srcdir)/../opcodes/i386-tbl.h
-$(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h: @MAINT@ $(i386_tbl_deps)
+$(srcdir)/../opcodes/i386%init.h $(srcdir)/../opcodes/i386%tbl.h $(srcdir)/../opcodes/i386%mnem.h: @MAINT@ $(i386_tbl_deps)
@echo '"$@" is outdated wrt "$?"' >&2
@echo 'Please rebuild from the top level or in $(CURDIR)/../opcodes/' >&2
@false
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index e755869..6929ffa 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -34,6 +34,7 @@
#include "sframe.h"
#include "elf/x86-64.h"
#include "opcodes/i386-init.h"
+#include "opcodes/i386-mnem.h"
#include <limits.h>
#ifndef INFER_ADDR_PREFIX
@@ -2428,7 +2429,7 @@ offset_in_range (offsetT val, int size)
static INLINE const char *insn_name (const insn_template *t)
{
- return t->name;
+ return &i386_mnemonics[t->mnem_off];
}
enum PREFIX_GROUP