public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@orcam.me.uk>
To: Sagar Patel <sagarmp@cs.unc.edu>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] MIPS/opcodes: Fix alias annotation for negate instructions
Date: Mon, 7 Mar 2022 20:46:36 +0000 (GMT)	[thread overview]
Message-ID: <alpine.DEB.2.21.2203072025060.47558@angie.orcam.me.uk> (raw)
In-Reply-To: <20220307151833.22389-1-sagarmp@cs.unc.edu>

On Mon, 7 Mar 2022, Sagar Patel wrote:

> On both regular MIPS and microMIPS 32-bit, the NEG and NEGU assembly
> instructions are idioms for SUB and SUBU respectively with the `rs'
> operand equal to $0.

 Thank you.  Your change has passed regression testing against my usual 
set of 87 MIPS targets and overall it looks good to me except for a couple 
of minor nits, as below.

> diff --git a/binutils/ChangeLog b/binutils/ChangeLog
> index a355e18de74..1f134dbe87f 100644
> --- a/binutils/ChangeLog
> +++ b/binutils/ChangeLog
> @@ -1,3 +1,14 @@
> +2022-03-07  Sagar Patel  <sagarmp@cs.unc.edu>
> +
> +	* testsuite/binutils-all/mips/micromips-neg-alias.d: New test.
> +	* testsuite/binutils-all/mips/micromips-neg-alias.s: New test
> +	source.
> +	* testsuite/binutils-all/mips/micromips-neg-noalias.d: New test.
> +	* testsuite/binutils-all/mips/mips-neg-alias.d: New test.
> +	* testsuite/binutils-all/mips/mips-neg-alias.s: New test source.
> +	* testsuite/binutils-all/mips/mips-neg-noalias.d: New test.
> +	* testsuite/binutils-all/mips/mips.exp: Run the new tests.
> +

 Please do not include updates to ChangeLog files with the diff as they 
will almost surely cause a conflict right away.  Instead please just put 
entries intended for ChangeLog files within the change description, as you 
correctly did, and then the committer will produce actual ChangeLog file 
entries from that text.  It could be that eventually we will switch to 
doing this automatically just as GCC does or stop using ChangeLog entries 
altogether like GDB, which will make backports so much easier.

> diff --git a/binutils/testsuite/binutils-all/mips/micromips-neg-alias.s b/binutils/testsuite/binutils-all/mips/micromips-neg-alias.s
> new file mode 100644
> index 00000000000..f5122d3b2dc
> --- /dev/null
> +++ b/binutils/testsuite/binutils-all/mips/micromips-neg-alias.s
> @@ -0,0 +1,14 @@
> +	.text
> +	.set	mips32r3
> +	.set	noat
> +	.set	noreorder

 This `.set noreorder' is not needed here (I only put it in the other test 
case to avoid clutter from branch delay slots).

 FAOD the `.set mips32r3' pseudo-op is required so that configurations 
that default to MIPSr6 still assemble this source.

> diff --git a/binutils/testsuite/binutils-all/mips/mips-neg-alias.s b/binutils/testsuite/binutils-all/mips/mips-neg-alias.s
> new file mode 100644
> index 00000000000..bb7b3c5ac3a
> --- /dev/null
> +++ b/binutils/testsuite/binutils-all/mips/mips-neg-alias.s
> @@ -0,0 +1,13 @@
> +	.text
> +	.set	noat
> +	.set	noreorder
> +	.set	mips2

 Likewise, and also this `.set mips2' is not needed here (I put it in the
other test case so that branch likely instructions, which require the ISA 
to be between MIPS II and MIPSr6, assemble correctly).

 This might be overly pedantic, but with any test case I suggest putting 
the absolute minimum there so as not to make someone in the future wonder 
what the specific requirement was for one option or another (possibly I 
shouldn't have used `.set noat' and $1 either, but let's leave it as it 
is).

 It looks perfect otherwise and once your paperwork has been sorted I will 
push either your change as posted with amendments made for the two pieces 
above or any v2 if you prefer to make one yourself.

 Thank you for your submission.

  Maciej

  reply	other threads:[~2022-03-07 20:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07 15:18 Sagar Patel
2022-03-07 20:46 ` Maciej W. Rozycki [this message]
2022-03-08  6:25   ` Sagar Patel
2022-03-10 10:11     ` 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=alpine.DEB.2.21.2203072025060.47558@angie.orcam.me.uk \
    --to=macro@orcam.me.uk \
    --cc=binutils@sourceware.org \
    --cc=sagarmp@cs.unc.edu \
    /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).