This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] MIPS gas breaks for -march=r3000 -mtune=r3900
- From: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- To: binutils at sources dot redhat dot com
- Date: Tue, 20 Jan 2004 11:05:15 +0100
- Subject: [PATCH] MIPS gas breaks for -march=r3000 -mtune=r3900
Hello All,
MIPS gas tries currently to optimize for r3900 interlocks if
-march=r3000 -mtune=r3900 is given. Thus the resulting code is
broken for r3000 CPUs. The appended patch restricts the
optimization to the -march=3900 case.
Thiemo
2004-01-20 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
/gas/ChangeLog
* config/tc-mips.c (append_insn): Don't do r3900 interlock
optimization for -mtune=r3900, as this will break on other CPUs.
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/uberbaum/gas/config/tc-mips.c,v
retrieving revision 1.246
diff -u -p -r1.246 tc-mips.c
--- gas//config/tc-mips.c 14 Jan 2004 18:01:07 -0000 1.246
+++ gas//config/tc-mips.c 20 Jan 2004 09:51:24 -0000
@@ -1708,7 +1711,7 @@ append_insn (char *place, struct mips_cl
though the tx39's divide insns still do require the
delay. */
if (! (hilo_interlocks
- || (mips_tune == CPU_R3900 && (pinfo & INSN_MULT)))
+ || (mips_opts.arch == CPU_R3900 && (pinfo & INSN_MULT)))
&& (mips_optimize == 0
|| (pinfo & INSN_WRITE_LO)))
nops += 2;
@@ -1730,7 +1733,7 @@ append_insn (char *place, struct mips_cl
insert a NOP. Some newer processors have interlocks.
Also the note tx39's multiply above. */
if (! (hilo_interlocks
- || (mips_tune == CPU_R3900 && (pinfo & INSN_MULT)))
+ || (mips_opts.arch == CPU_R3900 && (pinfo & INSN_MULT)))
&& (mips_optimize == 0
|| (pinfo & INSN_WRITE_HI)))
nops += 2;
@@ -1768,11 +1771,11 @@ append_insn (char *place, struct mips_cl
|| ((prev_prev_insn.insn_mo->pinfo & INSN_READ_LO)
&& (pinfo & INSN_WRITE_LO)
&& ! (hilo_interlocks
- || (mips_tune == CPU_R3900 && (pinfo & INSN_MULT))))
+ || (mips_opts.arch == CPU_R3900 && (pinfo & INSN_MULT))))
|| ((prev_prev_insn.insn_mo->pinfo & INSN_READ_HI)
&& (pinfo & INSN_WRITE_HI)
&& ! (hilo_interlocks
- || (mips_tune == CPU_R3900 && (pinfo & INSN_MULT)))))
+ || (mips_opts.arch == CPU_R3900 && (pinfo & INSN_MULT)))))
prev_prev_nop = 1;
else
prev_prev_nop = 0;
@@ -2297,7 +2307,7 @@ append_insn (char *place, struct mips_cl
| INSN_WRITE_COND_CODE))
&& ! cop_interlocks)
|| (! (hilo_interlocks
- || (mips_tune == CPU_R3900 && (pinfo & INSN_MULT)))
+ || (mips_opts.arch == CPU_R3900 && (pinfo & INSN_MULT)))
&& (prev_pinfo
& (INSN_READ_LO
| INSN_READ_HI)))