summaryrefslogtreecommitdiff
path: root/gas/config/tc-i386-intel.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-07-04 08:32:50 +0200
committerJan Beulich <jbeulich@suse.com>2022-07-04 08:32:50 +0200
commita775efc84d0f15f7003fdab1592586b6fa8987cd (patch)
tree248fd99caba89a053e9409d8d438cca6ea189f76 /gas/config/tc-i386-intel.c
parent02b83698ef04a33a8c606efeceb8fe7cd9a9b344 (diff)
downloadbinutils-gdb-a775efc84d0f15f7003fdab1592586b6fa8987cd.tar.gz
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.
Diffstat (limited to 'gas/config/tc-i386-intel.c')
-rw-r--r--gas/config/tc-i386-intel.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c
index 0991f4f687c..8a4ca1a3525 100644
--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -963,7 +963,6 @@ i386_intel_operand (char *operand_string, int got_a_float)
i.flags[0] &= ~Operand_Mem;
i.types[0].bitfield.disp16 = 0;
i.types[0].bitfield.disp32 = 0;
- i.types[0].bitfield.disp32s = 0;
return 1;
}
}
@@ -1011,13 +1010,9 @@ i386_intel_operand (char *operand_string, int got_a_float)
if (flag_code == CODE_64BIT)
{
+ i.types[this_operand].bitfield.disp32 = 1;
if (!i.prefix[ADDR_PREFIX])
- {
- i.types[this_operand].bitfield.disp64 = 1;
- i.types[this_operand].bitfield.disp32s = 1;
- }
- else
- i.types[this_operand].bitfield.disp32 = 1;
+ i.types[this_operand].bitfield.disp64 = 1;
}
else if (!i.prefix[ADDR_PREFIX] ^ (flag_code == CODE_16BIT))
i.types[this_operand].bitfield.disp32 = 1;