From: Richard Sandiford <rdsandiford@googlemail.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] MIPS/GAS: Fix DWARF-2 with branch swapping for MIPS16 code
Date: Mon, 04 Jul 2011 22:20:00 -0000 [thread overview]
Message-ID: <87ei254wmb.fsf@firetop.home> (raw)
In-Reply-To: <alpine.DEB.1.10.1107041953320.4083@tp.orcam.me.uk> (Maciej W. Rozycki's message of "Mon, 4 Jul 2011 20:34:53 +0100 (BST)")
"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> BTW, I've been wondering about this construct:
>
> return mask & ~0;
>
> you've introduced in a couple of places.
Oops. Fixed below.
> Also why "can not" instead of "cannot"? My understanding of the
> subtleties of English is this essentially means we "are allowed not to
> swap" rather than we "are not allowed to swap". The usual disclaimer
> applies of course. ;)
Those comments were already there. I just moved them around.
> Finally I think the change below is needed as well. We shouldn't be
> relying on the meaning of FP_D for MIPS16 code as opcode flags are assumed
> to have a different meaning in the MIPS16 table. Granted, the location of
> the FP_D bit hasn't been assigned to anything (yet), so it's guaranteed to
> be zero and the check is harmless,
Yes. I checked that before writing it this way. It's guaranteed to be
harmless anyway, because "until" MIPS16 gets hardware FP support, we'd
never have any set bits.
I structured the code to be consistent with the GPR case. If you feel
strongly about it though, feel free to move the conditions inside the
existing "!mips_opts.mips16" check.
Richard
gas/
* config/tc-mips.c (gpr_read_mask, gpr_write_mask): Fix handling
of register 0.
Index: gas/config/tc-mips.c
===================================================================
--- gas/config/tc-mips.c 2011-07-04 21:00:54.000000000 +0100
+++ gas/config/tc-mips.c 2011-07-04 21:01:13.000000000 +0100
@@ -2450,7 +2450,8 @@ gpr_read_mask (const struct mips_cl_insn
if (pinfo2 & INSN2_READ_GPR_Z)
mask |= 1 << EXTRACT_OPERAND (RZ, *ip);
}
- return mask & ~0;
+ /* Don't include register 0. */
+ return mask & ~1;
}
/* Return the mask of core registers that IP writes. */
@@ -2492,7 +2493,8 @@ gpr_write_mask (const struct mips_cl_ins
if (pinfo2 & INSN2_WRITE_GPR_Z)
mask |= 1 << EXTRACT_OPERAND (RZ, *ip);
}
- return mask & ~0;
+ /* Don't include register 0. */
+ return mask & ~1;
}
/* Return the mask of floating-point registers that IP reads. */
next prev parent reply other threads:[~2011-07-04 20:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-23 13:39 Maciej W. Rozycki
2011-06-29 21:26 ` Richard Sandiford
2011-07-02 1:20 ` Maciej W. Rozycki
2011-07-02 7:33 ` Richard Sandiford
2011-07-04 20:30 ` Maciej W. Rozycki
2011-07-04 22:20 ` Richard Sandiford [this message]
2011-07-05 0:28 ` Maciej W. Rozycki
2011-07-05 11:29 ` Richard Sandiford
2011-08-03 14:55 ` [ping][PATCH] MIPS: Document the use of FP_D in MIPS16 mode Maciej W. Rozycki
2011-08-03 19:47 ` Richard Sandiford
2011-08-03 21:13 ` Maciej W. Rozycki
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=87ei254wmb.fsf@firetop.home \
--to=rdsandiford@googlemail.com \
--cc=binutils@sourceware.org \
--cc=macro@codesourcery.com \
/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).