aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-12-01 09:59:39 +0100
committerJan Beulich <jbeulich@suse.com>2022-12-01 09:59:39 +0100
commita4d3acd21524e9dfd7c3cef8675e71125925fbba (patch)
treef5ff3530ba4eb59574739f503c548e1b971cf3be /gas
parentf210f0a05ea30b5bca75aa516873f1784ae331b4 (diff)
downloadbinutils-a4d3acd21524e9dfd7c3cef8675e71125925fbba.zip
binutils-a4d3acd21524e9dfd7c3cef8675e71125925fbba.tar.gz
binutils-a4d3acd21524e9dfd7c3cef8675e71125925fbba.tar.bz2
x86/Intel: drop LONG_DOUBLE_MNEM_SUFFIX
With the removal of its use for FPU insns the suffix is now finally properly misnamed. Drop its use altogether, replacing it by a separate boolean instead.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386-intel.c22
-rw-r--r--gas/config/tc-i386.c26
2 files changed, 24 insertions, 24 deletions
diff --git a/gas/config/tc-i386-intel.c b/gas/config/tc-i386-intel.c
index 650a24b..54b124b 100644
--- a/gas/config/tc-i386-intel.c
+++ b/gas/config/tc-i386-intel.c
@@ -715,8 +715,10 @@ i386_intel_operand (char *operand_string, int got_a_float)
&& (current_templates->start->opcode_modifier.jump == JUMP
|| current_templates->start->opcode_modifier.jump
== JUMP_DWORD))
- suffix = flag_code == CODE_16BIT ? LONG_DOUBLE_MNEM_SUFFIX
- : WORD_MNEM_SUFFIX;
+ {
+ i.far_branch = true;
+ suffix = WORD_MNEM_SUFFIX;
+ }
else if (got_a_float == 1) /* "f..." */
suffix = SHORT_MNEM_SUFFIX;
else
@@ -733,7 +735,7 @@ i386_intel_operand (char *operand_string, int got_a_float)
{
if (flag_code == CODE_16BIT)
add_prefix (DATA_PREFIX_OPCODE);
- suffix = LONG_DOUBLE_MNEM_SUFFIX;
+ i.far_branch = true;
}
break;
@@ -774,7 +776,7 @@ i386_intel_operand (char *operand_string, int got_a_float)
break;
case O_far_ptr:
- suffix = LONG_DOUBLE_MNEM_SUFFIX;
+ i.far_branch = true;
/* FALLTHROUGH */
case O_near_ptr:
if (current_templates->start->opcode_modifier.jump != JUMP
@@ -833,10 +835,6 @@ i386_intel_operand (char *operand_string, int got_a_float)
if (t->opcode_modifier.no_ssuf)
continue;
break;
- case LONG_DOUBLE_MNEM_SUFFIX:
- if (t->opcode_modifier.no_ldsuf)
- continue;
- break;
default:
abort ();
}
@@ -916,7 +914,11 @@ i386_intel_operand (char *operand_string, int got_a_float)
return 0;
}
else if (S_GET_SEGMENT (intel_state.seg) == reg_section)
- jumpabsolute = true;
+ {
+ jumpabsolute = true;
+ if (intel_state.op_modifier == O_far_ptr)
+ i.far_branch = true;
+ }
else
{
i386_operand_type types;
@@ -943,8 +945,6 @@ i386_intel_operand (char *operand_string, int got_a_float)
this_operand = i.operands++;
i.types[this_operand].bitfield.unspecified = 1;
}
- if (suffix == LONG_DOUBLE_MNEM_SUFFIX)
- i.suffix = 0;
intel_state.seg = NULL;
intel_state.is_mem = 0;
}
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 874cf17..1a45892 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -80,9 +80,6 @@
#define SHORT_MNEM_SUFFIX 's'
#define LONG_MNEM_SUFFIX 'l'
#define QWORD_MNEM_SUFFIX 'q'
-/* Intel Syntax. Use a non-ascii letter since since it never appears
- in instructions. */
-#define LONG_DOUBLE_MNEM_SUFFIX '\1'
#define END_OF_INSN '\0'
@@ -313,6 +310,9 @@ struct _i386_insn
/* The operand to a branch insn indicates an absolute branch. */
bool jumpabsolute;
+ /* The operand to a branch insn indicates a far branch. */
+ bool far_branch;
+
/* There is a memory operand of (%dx) which should be only used
with input/output instructions. */
bool input_output_operand;
@@ -6494,14 +6494,6 @@ match_template (char mnem_suffix)
case QWORD_MNEM_SUFFIX:
suffix_check.no_qsuf = 1;
break;
- default:
- /* NB: In Intel syntax, normally we can check for memory operand
- size when there is no mnemonic suffix. But jmp and call have
- 2 different encodings with Dword memory operand size, one with
- No_ldSuf and the other without. i.suffix is set to
- LONG_DOUBLE_MNEM_SUFFIX to skip the one with No_ldSuf. */
- if (i.suffix == LONG_DOUBLE_MNEM_SUFFIX)
- suffix_check.no_ldsuf = 1;
}
for (t = current_templates->start; t < current_templates->end; t++)
@@ -6555,8 +6547,7 @@ match_template (char mnem_suffix)
|| (t->opcode_modifier.no_wsuf && suffix_check.no_wsuf)
|| (t->opcode_modifier.no_lsuf && suffix_check.no_lsuf)
|| (t->opcode_modifier.no_ssuf && suffix_check.no_ssuf)
- || (t->opcode_modifier.no_qsuf && suffix_check.no_qsuf)
- || (t->opcode_modifier.no_ldsuf && suffix_check.no_ldsuf))
+ || (t->opcode_modifier.no_qsuf && suffix_check.no_qsuf))
continue;
specific_error = progress (operand_size_mismatch);
@@ -6574,6 +6565,15 @@ match_template (char mnem_suffix)
if (i.jumpabsolute && t->opcode_modifier.jump != JUMP_ABSOLUTE)
continue;
+ /* In Intel syntax, normally we can check for memory operand size when
+ there is no mnemonic suffix. But jmp and call have 2 different
+ encodings with Dword memory operand size. Skip the "near" one
+ (permitting a register operand) when "far" was requested. */
+ if (i.far_branch
+ && t->opcode_modifier.jump == JUMP_ABSOLUTE
+ && t->operand_types[0].bitfield.class == Reg)
+ continue;
+
for (j = 0; j < MAX_OPERANDS; j++)
operand_types[j] = t->operand_types[j];