public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
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>,
	Richard Biener <richard.guenther@gmail.com>
Subject: Re: [PATCH] Add inchash support for vrange.
Date: Tue, 18 Apr 2023 11:33:03 +0200	[thread overview]
Message-ID: <ZD5jz6Bmeyc2i3OK@tucnak> (raw)
In-Reply-To: <20230418090637.253140-2-aldyh@redhat.com>

On Tue, Apr 18, 2023 at 11:06:38AM +0200, Aldy Hernandez via Gcc-patches wrote:
> This patch provides inchash support for vrange.  It is along the lines
> of the streaming support I just posted and will be used for IPA
> hashing of ranges.
> 
> Thoughts?
> 
> gcc/ChangeLog:
> 
> 	* inchash.cc (hash::add_real_value): New.
> 	* inchash.h (class hash): Add add_real_value.
> 	* value-range.cc (add_vrange): New.
> 	* value-range.h (inchash::add_vrange): New.
> ---
>  gcc/inchash.cc     | 20 +++++++++++++++++++
>  gcc/inchash.h      |  2 ++
>  gcc/value-range.cc | 48 ++++++++++++++++++++++++++++++++++++++++++++++
>  gcc/value-range.h  |  6 ++++++
>  4 files changed, 76 insertions(+)
> 
> diff --git a/gcc/inchash.cc b/gcc/inchash.cc
> index a30662b97fe..914e3cc92cd 100644
> --- a/gcc/inchash.cc
> +++ b/gcc/inchash.cc
> @@ -24,3 +24,23 @@ along with GCC; see the file COPYING3.  If not see
>  #endif
>  #include "system.h"
>  #include "coretypes.h"
> +#include "real.h"
> +#include "inchash.h"
> +
> +namespace inchash
> +{
> +
> +/* This is here instead of inchash.h to keep us from having to put
> +   real.h in coretypes.h.  */
> +void
> +hash::add_real_value (const real_value &v)
> +{
> +  add_int (v.sign);
> +  add_int (v.uexp);
> +  for (unsigned i = 0; i < SIGSZ; ++i)
> +    add_hwi (v.sig[i]);
> +  /* Ignore the rest of the flags, as sign, exponent, and
> +     significant bits should be enough.  */

I don't think that's the case.
At least cl, decimal and signalling are essential flags as well.
Dunno about canonical.
How do you otherwise differentiate between Inf and +0.0 or (canonical)
qNaN or (canonical) sNaN?
They have the same sign, uexp and sig.

	Jakub


  parent reply	other threads:[~2023-04-18  9:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18  9:06 [PATCH] Add support for vrange streaming Aldy Hernandez
2023-04-18  9:06 ` [PATCH] Add inchash support for vrange Aldy Hernandez
2023-04-18  9:17   ` Aldy Hernandez
2023-04-18  9:33   ` Jakub Jelinek [this message]
2023-04-18 10:32     ` Jakub Jelinek
2023-04-18 10:50       ` Aldy Hernandez
2023-04-18 10:59         ` Jakub Jelinek
2023-04-18 11:33           ` Aldy Hernandez
2023-04-18 11:34             ` Jakub Jelinek
2023-04-18 12:48 ` [PATCH] Add support for vrange streaming Aldy Hernandez
2023-04-27 11:00   ` Richard Biener
2023-04-27 11:36     ` Aldy Hernandez
2023-05-17 14:08       ` Aldy Hernandez

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=ZD5jz6Bmeyc2i3OK@tucnak \
    --to=jakub@redhat.com \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.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).