]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gas/config/tc-i386-intel.c
x86: fold Disp32S and Disp32
authorJan Beulich <jbeulich@suse.com>
Mon, 4 Jul 2022 06:32:50 +0000 (08:32 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 Jul 2022 06:32:50 +0000 (08:32 +0200)
commita775efc84d0f15f7003fdab1592586b6fa8987cd
tree248fd99caba89a053e9409d8d438cca6ea189f76
parent02b83698ef04a33a8c606efeceb8fe7cd9a9b344
x86: fold Disp32S and Disp32

The only case where 64-bit code uses non-sign-extended (can also be
considered zero-extended) displacements is when an address size override
is in place for a memory operand (i.e. particularly excluding
displacements of direct branches, which - if at all - are controlled by
operand size, and then are still sign-extended, just from 16 bits).
Hence the distinction in templates is unnecessary, allowing code to be
simplified in a number of places. The only place where logic becomes
more complicated is when signed-ness of relocations is determined in
output_disp().

The other caveat is that Disp64 cannot be specified anymore in an insn
template at the same time as Disp32. Unlike for non-64-bit mode,
templates don't specify displacements for both possible addressing
modes; the necessary adjustment to the expected ones has already been
done in match_template() anyway (but of course the logic there needs
tweaking now). Hence the single template so far doing so is split.
gas/config/tc-i386-intel.c
gas/config/tc-i386.c
opcodes/i386-gen.c
opcodes/i386-init.h
opcodes/i386-opc.h
opcodes/i386-opc.tbl
opcodes/i386-tbl.h