aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2022-11-30 09:06:59 +0100
committerJan Beulich <jbeulich@suse.com>2022-11-30 09:06:59 +0100
commit4943d587f9a908bd8e05bb4312b4bebcc15992bb (patch)
tree01cab28fa7d026c216aec53a897d74b2d994bd0c /gas
parentac9226cf8c496b15e369b2fcae95066f4a597a5b (diff)
downloadgdb-4943d587f9a908bd8e05bb4312b4bebcc15992bb.zip
gdb-4943d587f9a908bd8e05bb4312b4bebcc15992bb.tar.gz
gdb-4943d587f9a908bd8e05bb4312b4bebcc15992bb.tar.bz2
x86: clean up after removal of support for gcc <= 2.8.1
At the very least a comment in process_operands() is stale. Beyond that there are effectively two options: 1) It is possible that FADDP and FMULP were mistakenly not marked as being in need of dealing with the compiler anomaly, and hence the respective templates weren't removed at the time when they should have been. 2) It is also possible that there are indeed uses known beyond compiler generated output for these two commutative opcodes, and hence the templates need to stay. To be on the safe side assume 2: Update the comment and fold the templates into their "normal" ones (utilizing D), adjusting consuming code accordingly. For FMULP also add a comment paralleling a similar one FADDP has.
Diffstat (limited to 'gas')
-rw-r--r--gas/config/tc-i386.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 8dc7425..874cf17 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -6806,7 +6806,8 @@ match_template (char mnem_suffix)
found_reverse_match = 0;
else if (operand_types[0].bitfield.tbyte)
{
- found_reverse_match = Opcode_FloatD;
+ if (t->opcode_modifier.operandconstraint != UGH)
+ found_reverse_match = Opcode_FloatD;
/* FSUB{,R} and FDIV{,R} may need a 2nd bit flipped. */
if ((t->base_opcode & 0x20)
&& (intel_syntax || intel_mnemonic))
@@ -7997,29 +7998,31 @@ process_operands (void)
{
/* The register or float register operand is in operand
0 or 1. */
- unsigned int op = i.tm.operand_types[0].bitfield.class != Reg;
+ const reg_entry *r = i.op[0].regs;
+ if (i.imm_operands
+ || (r->reg_type.bitfield.instance == Accum && i.op[1].regs))
+ r = i.op[1].regs;
/* Register goes in low 3 bits of opcode. */
- i.tm.base_opcode |= i.op[op].regs->reg_num;
- if ((i.op[op].regs->reg_flags & RegRex) != 0)
+ i.tm.base_opcode |= r->reg_num;
+ if ((r->reg_flags & RegRex) != 0)
i.rex |= REX_B;
if (!quiet_warnings && i.tm.opcode_modifier.operandconstraint == UGH)
{
- /* Warn about some common errors, but press on regardless.
- The first case can be generated by gcc (<= 2.8.1). */
- if (i.operands == 2)
- {
- /* Reversed arguments on faddp, fsubp, etc. */
- as_warn (_("translating to `%s %s%s,%s%s'"), i.tm.name,
- register_prefix, i.op[!intel_syntax].regs->reg_name,
- register_prefix, i.op[intel_syntax].regs->reg_name);
- }
- else
+ /* Warn about some common errors, but press on regardless. */
+ if (i.operands != 2)
{
/* Extraneous `l' suffix on fp insn. */
as_warn (_("translating to `%s %s%s'"), i.tm.name,
register_prefix, i.op[0].regs->reg_name);
}
+ else if (i.op[0].regs->reg_type.bitfield.instance != Accum)
+ {
+ /* Reversed arguments on faddp or fmulp. */
+ as_warn (_("translating to `%s %s%s,%s%s'"), i.tm.name,
+ register_prefix, i.op[!intel_syntax].regs->reg_name,
+ register_prefix, i.op[intel_syntax].regs->reg_name);
+ }
}
}