From: Richard Biener <rguenther@suse.de>
To: Marc Glisse <marc.glisse@inria.fr>
Cc: Jakub Jelinek <jakub@redhat.com>,
gcc-patches@gcc.gnu.org, Richard Henderson <rth@redhat.com>
Subject: Re: [PATCH] Convert manual unsigned +/- overflow checking into {ADD,SUB}_OVERFLOW (PR target/67089)
Date: Thu, 26 Nov 2015 09:14:00 -0000 [thread overview]
Message-ID: <alpine.LSU.2.11.1511260947520.4884@t29.fhfr.qr> (raw)
In-Reply-To: <alpine.DEB.2.20.1511252153250.14338@laptop-mg.saclay.inria.fr>
On Wed, 25 Nov 2015, Marc Glisse wrote:
> On Wed, 25 Nov 2015, Jakub Jelinek wrote:
>
> > > The same is true whether we write it b > a or (a - b) > a (I don't think
> > > PRE
> > > + SCCVN avoid increasing register pressure).
> > >
> > > > So, I'd really prefer doing x-y>x to y>x only for single use.
> > >
> > > Ok (for now).
> >
> > Do you plan to work on that (my match.pd experience is smaller than yours),
> > or should I add to my todo list?
>
> Are we talking stage 3 or next stage 1? If you want something for stage 3, I
> think you'll have to do it, it shouldn't be much longer than
>
> (for cmp (gt le)
> (simplify
> (cmp (minus:s @0 @1) @0)
> (if (TYPE_UNSIGNED (TREE_TYPE (@0)))
> (cmp @1 @0))))
>
> and a similar one for x<y-x. (I don't think TYPE_UNSIGNED needs protection
> against floats or whatever, but I could be wrong)
floats should be fine here. But eventually saturating types need to
be excluded?
Note that the :s on the minus has no effect as the result is a
single operation. If you want to restrict this nevertheless
you need a && single_use (@2) and capture the minus with
(minus@2 @0 @1) instead.
Richard.
next prev parent reply other threads:[~2015-11-26 8:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 20:55 Jakub Jelinek
2015-11-25 8:11 ` Marc Glisse
2015-11-25 8:40 ` Jakub Jelinek
2015-11-25 8:48 ` Richard Biener
2015-11-25 8:59 ` Marc Glisse
2015-11-25 9:08 ` Jakub Jelinek
2015-11-25 9:12 ` Richard Biener
2015-11-25 11:23 ` Marc Glisse
2015-11-25 11:29 ` Jakub Jelinek
2015-11-25 21:27 ` Marc Glisse
2015-11-26 9:14 ` Richard Biener [this message]
2015-12-04 21:45 ` Marc Glisse
2015-11-25 8:45 ` Richard Biener
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.LSU.2.11.1511260947520.4884@t29.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=marc.glisse@inria.fr \
--cc=rth@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).