public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@linux-mips.org>
To: Thiemo Seufer <ica2_ts@csv.ica.uni-stuttgart.de>
Cc: binutils@sources.redhat.com
Subject: Re: [PATCH] MIPS gas: Fix macro expansions for .set noat
Date: Thu, 17 Feb 2005 00:25:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.61L.0502161745010.3450@blysk.ds.pg.gda.pl> (raw)
In-Reply-To: <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

  reply	other threads:[~2005-02-16 18:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-16 23:51 Thiemo Seufer
2005-02-17  0:25 ` Maciej W. Rozycki [this message]
2005-02-17  1:31   ` Maciej W. Rozycki
2005-02-17  1:34     ` Thiemo Seufer
2005-02-17  2:02       ` Maciej W. Rozycki
2005-02-17  7:10         ` Thiemo Seufer
2005-02-17 13:53           ` Eric Christopher
2005-02-17 20:50             ` Maciej W. Rozycki
2005-02-17 21:33               ` Thiemo Seufer
2005-02-18  0:21                 ` Maciej W. Rozycki
2005-02-21  2:57                   ` Thiemo Seufer
2005-02-18 23:01                 ` Eric Christopher
2005-02-21  8:21                 ` Thiemo Seufer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61L.0502161745010.3450@blysk.ds.pg.gda.pl \
    --to=macro@linux-mips.org \
    --cc=binutils@sources.redhat.com \
    --cc=ica2_ts@csv.ica.uni-stuttgart.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).