public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: Jeff Law <law@redhat.com>, GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Marcus Shawcroft <Marcus.Shawcroft@arm.com>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>,
	Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>,
	 James Greenhalgh <James.Greenhalgh@arm.com>
Subject: Re: [PATCH][optabs][ifcvt][1/3] Define negcc, notcc optabs
Date: Thu, 10 Sep 2015 08:28:00 -0000	[thread overview]
Message-ID: <55F13E10.5080100@arm.com> (raw)
In-Reply-To: <55F0A9C4.6030200@redhat.com>


On 09/09/15 22:51, Jeff Law wrote:
> On 09/02/2015 07:43 AM, Kyrill Tkachov wrote:
>
>>>> +  rtx_code code; +  if (val_a == -val_b)
>>> Do we have to worry about signed overflow here?  I'm thinking
>>> specifically when val_b is the smallest possible integer
>>> representable by a HOST_WIDE_INT.  I suspect you may be able to
>>> avoid these problems with judicious use of the hwi interfaces.
>> I understand the issue, but am not sure what hwi interfaces to use
>> here. Seems that the problem will be if val_b is HOST_WIDE_INT_MIN.
> Right.  When val_b is HOST_WIDE_INT_MIN, negating it will overflow.
>
>> Looking at the definition of abs_hwi in hwint.h before it negates
>> it's argument it asserts that it's not HOST_WIDE_INT_MIN. I think
>> that's to avoid this exact issue? If so, I've added a check for
>> HOST_WIDE_INT_MIN which should cover the undefined case when negating
>> a HOST_WIDE_INT, unless there's something else I'm missing.
> That should be sufficient.
>
> 2015-09-02  Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
>        * ifcvt.c (noce_try_inverse_constants): New function.
>        (noce_process_if_block): Call it.
>        * optabs.h (emit_conditional_neg_or_complement): Declare prototype.
>        * optabs.def (negcc_optab, notcc_optab): Declare.
>        * optabs.c (emit_conditional_neg_or_complement): New function.
>        * doc/tm.texi (Standard Names): Document negcc, notcc names.
>
> OK for the trunk.

Thanks for the review.
I'll commit it if/when the aarch64 and arm implementations of the hooks
in patches 2/3 and 3/3 are approved.

Kyrill

>
> Thanks for your patience.
>
> Jeff
>

  reply	other threads:[~2015-09-10  8:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 15:04 Kyrill Tkachov
2015-09-01 22:13 ` Jeff Law
2015-09-02 13:43   ` Kyrill Tkachov
2015-09-09 22:01     ` Jeff Law
2015-09-10  8:28       ` Kyrill Tkachov [this message]
2015-11-09 12:23 Kyrill Tkachov
2015-11-09 23:11 ` Jeff Law

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=55F13E10.5080100@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=James.Greenhalgh@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.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).