From: Richard Henderson Date: Thu, 24 Feb 2000 00:43:29 +0000 (+0000) Subject: * config/tc-i386.c (md_assemble): When swapping operands for X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7e0527420a4b51c074a523285d0fc88ca9eb539e;p=binutils-gdb.git * config/tc-i386.c (md_assemble): When swapping operands for intel_syntax, assume everything that's not Imm or Disp is a register. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 4a9b1a321f7..6d7868a1bd9 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2000-02-23 Richard Henderson + + * config/tc-i386.c (md_assemble): When swapping operands for + intel_syntax, assume everything that's not Imm or Disp is a + register. + 2000-02-23 Linas Vepstas * config/tc-i370.c, config/tc-i370.h: New files. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 43886d1efe8..d762d5f7aab 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -1298,21 +1298,16 @@ md_assemble (line) if (i.operands > 1) { temp_type = i.types[xchg2]; - if (temp_type & (Reg | FloatReg)) - temp_reg = i.regs[xchg2]; - else if (temp_type & Imm) + if (temp_type & Imm) temp_imm = i.imms[xchg2]; else if (temp_type & Disp) temp_disp = i.disps[xchg2]; + else + temp_reg = i.regs[xchg2]; i.types[xchg2] = i.types[xchg1]; - if (i.types[xchg1] & (Reg | FloatReg)) - { - i.regs[xchg2] = i.regs[xchg1]; - i.regs[xchg1] = NULL; - } - else if (i.types[xchg2] & Imm) + if (i.types[xchg2] & Imm) { i.imms[xchg2] = i.imms[xchg1]; i.imms[xchg1] = NULL; @@ -1322,14 +1317,13 @@ md_assemble (line) i.disps[xchg2] = i.disps[xchg1]; i.disps[xchg1] = NULL; } - - if (temp_type & (Reg | FloatReg)) + else { - i.regs[xchg1] = temp_reg; - if (! (i.types[xchg1] & (Reg | FloatReg))) - i.regs[xchg2] = NULL; + i.regs[xchg2] = i.regs[xchg1]; + i.regs[xchg1] = NULL; } - else if (temp_type & Imm) + + if (temp_type & Imm) { i.imms[xchg1] = temp_imm; if (! (i.types[xchg1] & Imm)) @@ -1341,6 +1335,12 @@ md_assemble (line) if (! (i.types[xchg1] & Disp)) i.disps[xchg2] = NULL; } + else + { + i.regs[xchg1] = temp_reg; + if (i.types[xchg1] & (Imm | Disp)) + i.regs[xchg2] = NULL; + } i.types[xchg1] = temp_type; }