This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] MIPS gas: Fix macro expansions for .set noat
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 16 Feb 2005 18:01:44 +0000 (GMT)
- Subject: Re: [PATCH] MIPS gas: Fix macro expansions for .set noat
- References: <20050216154924.GG1757@rembrandt.csv.ica.uni-stuttgart.de>
On Wed, 16 Feb 2005, Thiemo Seufer wrote:
> @@ -5762,11 +5761,19 @@ macro (struct mips_cl_insn *ip)
> case M_LWU_AB:
> s = "lwu";
> ld:
> - if (breg == treg || coproc || lr)
> + /* XXX Why don't we try to use AT for all expansions? */
Because we don't have to and it helps in cases like:
.set noat
ld k0,foo
> + if (!mips_opts.noat && (breg == treg || coproc || lr))
> {
> tempreg = AT;
> used_at = 1;
> }
> + else if (breg == treg
> + && (offset_expr.X_op != O_constant
> + || (offset_expr.X_add_number > 0x7fff
> + || offset_expr.X_add_number < -0x8000)))
> + {
> + as_bad(_("load expansion needs $at register"));
> + }
> else
> {
> tempreg = treg;
This looks broken -- you can only use treg as a scratch pad if it's a
GPR.
> @@ -5840,8 +5847,23 @@ macro (struct mips_cl_insn *ip)
> case M_SDR_AB:
> s = "sdr";
> st:
> - tempreg = AT;
> - used_at = 1;
> + if (!mips_opts.noat)
> + {
> + tempreg = AT;
> + used_at = 1;
> + }
> + else if (breg == treg
> + && (offset_expr.X_op != O_constant
> + || (offset_expr.X_add_number > 0x7fff
> + || offset_expr.X_add_number < -0x8000)))
> + {
> + as_bad(_("store expansion needs $at register"));
> + }
> + else
> + {
> + tempreg = treg;
> + used_at = 0;
> + }
> ld_st:
> /* Itbl support may require additional care here. */
> if (mask == M_LWC1_AB
This is yet more broken -- treg can never be used, because it contains
the value to be stored! And of course it's not expected to get trashed
anyway.
Maciej