From: Jakub Jelinek <jakub@redhat.com>
To: Aldy Hernandez <aldyh@redhat.com>
Cc: GCC patches <gcc-patches@gcc.gnu.org>,
Andrew MacLeod <amacleod@redhat.com>
Subject: Re: [COMMITTED] [range-op-float] Abstract out binary operator code out of PLUS_EXPR entry.
Date: Wed, 9 Nov 2022 14:32:54 +0100 [thread overview]
Message-ID: <Y2usBnbNTCRol8KI@tucnak> (raw)
In-Reply-To: <CAGm3qMVgps2KdEEd3SuLY5=0Wp7jHELMRYbz45x=VyF0U53QKg@mail.gmail.com>
On Wed, Nov 09, 2022 at 02:14:19PM +0100, Aldy Hernandez wrote:
> On Wed, Nov 9, 2022 at 1:48 PM Jakub Jelinek <jakub@redhat.com> wrote:
> >
> > On Wed, Nov 09, 2022 at 08:07:57AM +0100, Aldy Hernandez wrote:
> > > The PLUS_EXPR was always meant to be a template for further
> > > development, since most of the binary operators will share a similar
> > > structure. This patch abstracts out the common bits into the default
> > > definition for range_operator_float::fold_range() and provides an
> > > rv_fold() to be implemented by the individual entries wishing to use
> > > the generic folder. This is akin to what we do with fold_range() and
> > > wi_fold() in the integer version of range-ops.
> >
> > Shouldn't foperator_mult be very similar to this (except that until
> > division is done op[12]_range can't be implemented), with the exception
> > that the invalid case isn't -INF + INF or INF + -INF, but
> > 0 * +/-INF or +/-INF * 0?
>
> Multiplication and division are tricky because you have to keep track
> of signs to order the resulting range. It's the most annoying pattern
> we have for integers:
Ah, you're right.
Reminds me of check_for_binary_op_overflow for multiplication.
Jakub
next prev parent reply other threads:[~2022-11-09 13:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 7:07 Aldy Hernandez
2022-11-09 7:07 ` [COMMITTED] [range-op-float] Implement MINUS_EXPR Aldy Hernandez
2022-11-09 13:49 ` Xi Ruoyao
2022-11-09 13:58 ` Xi Ruoyao
2022-11-09 15:45 ` Aldy Hernandez
2022-11-09 12:48 ` [COMMITTED] [range-op-float] Abstract out binary operator code out of PLUS_EXPR entry Jakub Jelinek
2022-11-09 13:14 ` Aldy Hernandez
2022-11-09 13:32 ` Jakub Jelinek [this message]
2022-11-09 14:19 ` Jakub Jelinek
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=Y2usBnbNTCRol8KI@tucnak \
--to=jakub@redhat.com \
--cc=aldyh@redhat.com \
--cc=amacleod@redhat.com \
--cc=gcc-patches@gcc.gnu.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).