public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Sandiford <rdsandiford@googlemail.com>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: binutils@sourceware.org
Subject: Re: [PATCH 1/5] MIPS/GAS: Fix o32 LD to the base register
Date: Mon, 01 Nov 2010 21:28:00 -0000	[thread overview]
Message-ID: <87vd4gd995.fsf@firetop.home> (raw)
In-Reply-To: <alpine.LFD.2.00.1010312127400.25426@eddie.linux-mips.org>	(Maciej W. Rozycki's message of "Sun, 31 Oct 2010 22:46:40 +0000	(GMT)")

"Maciej W. Rozycki" <macro@linux-mips.org> writes:
> binutils-2.20.51-20100925-mips-gas-ld-o-base.patch
> Index: binutils-2.20.51/gas/config/tc-mips.c
> ===================================================================
> --- binutils-2.20.51.orig/gas/config/tc-mips.c
> +++ binutils-2.20.51/gas/config/tc-mips.c
> @@ -7346,17 +7346,29 @@ macro (struct mips_cl_insn *ip)
>  
>      case M_LD_OB:
>        s = HAVE_64BIT_GPRS ? "ld" : "lw";
> +      off = 1;
> +      /* If the first load would overwrite the base register,
> +         then swap the accesses.  */
> +      if (!HAVE_64BIT_GPRS && treg == breg && breg != ZERO)
> +	{
> +	  offset_expr.X_add_number += 4;
> +	  treg += 1;
> +	  off = -1;
> +	}
>        goto sd_ob;
> +
>      case M_SD_OB:
>        s = HAVE_64BIT_GPRS ? "sd" : "sw";
> +      off = 1;
> +

Add a fallthrough comment if you're adding whitespace.  Patches 1-3
are otherwise OK.

I'm not convinced 4 is worthwhile given that these macros are really in
maintenance mode.

I still don't like the way that you're matching ECOFF and ELF offsets
in a single test, allowing two load offsets when (for each format
individually) only one offset is actually acceptable.  But patch 5
is OK nonetheless.

Richard

  reply	other threads:[~2010-11-01 21:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-17 16:22 [PATCH 1/2] " Maciej W. Rozycki
2010-10-18  7:48 ` Richard Sandiford
2010-10-18 17:05   ` Maciej W. Rozycki
2010-10-31 22:46     ` [PATCH 1/5] " Maciej W. Rozycki
2010-11-01 21:28       ` Richard Sandiford [this message]
2010-11-01 21:34         ` Richard Sandiford

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=87vd4gd995.fsf@firetop.home \
    --to=rdsandiford@googlemail.com \
    --cc=binutils@sourceware.org \
    --cc=macro@linux-mips.org \
    /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).