From: Richard Biener <rguenther@suse.de>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Richard Sandiford <richard.sandiford@arm.com>,
Aldy Hernandez <aldyh@redhat.com>,
gcc-patches@gcc.gnu.org
Subject: Re: [RFC] > WIDE_INT_MAX_PREC support in wide_int and widest_int
Date: Fri, 29 Sep 2023 09:25:01 +0000 (UTC) [thread overview]
Message-ID: <nycvar.YFH.7.77.849.2309290920570.5561@jbgna.fhfr.qr> (raw)
In-Reply-To: <ZRaJ27pOrDXQOCW3@tucnak>
On Fri, 29 Sep 2023, Jakub Jelinek wrote:
> On Thu, Sep 28, 2023 at 04:03:55PM +0200, Jakub Jelinek wrote:
> > Bet we should make wide_int_storage and widest_int_storage GTY ((user)) and
> > just declare but don't define the handlers or something similar.
>
> That doesn't catch anything, but the following incremental patch compiles
> just fine, proving we don't have any wide_int in GC memory anymore after
> the wide_int -> rwide_int change in dwarf2out.h.
> And the attached incremental patch on top of it which deletes even
> widest_int from GC shows that we use widest_int in GC in:
[..]
> nb_iter_bound::member
> loop::nb_iterations_upper_bound
> loop::nb_iterations_likely_upper_bound
> loop::nb_iterations_estimate
I think those should better be bound to max-fixed-mode, they were
HWI at some point (even that should be OK, but of course
non-likely upper_bound needs to be conservative). Using
widest_int here, esp. non-x86 is quite wasting. The functions
setting these need to be careful with overflows then.
> so pretty much everything I spoke about (except I thought loop has
> 2 such members when it has 3).
>
> --- gcc/wide-int.h 2023-09-28 14:55:40.059632413 +0200
> +++ gcc/wide-int.h 2023-09-29 09:59:58.703931879 +0200
> @@ -85,7 +85,7 @@
> and it always uses an inline buffer. offset_int and rwide_int are
> GC-friendly, wide_int and widest_int are not.
>
> - 3) widest_int. This representation is an approximation of
> + 4) widest_int. This representation is an approximation of
> infinite precision math. However, it is not really infinite
> precision math as in the GMP library. It is really finite
> precision math where the precision is WIDEST_INT_MAX_PRECISION.
> @@ -4063,21 +4063,61 @@
> return wi::smod_trunc (x, y);
> }
>
> -template<typename T>
> +void gt_ggc_mx (generic_wide_int <wide_int_storage> *) = delete;
> +void gt_pch_nx (generic_wide_int <wide_int_storage> *) = delete;
> +void gt_pch_nx (generic_wide_int <wide_int_storage> *,
> + gt_pointer_operator, void *) = delete;
> +
> +inline void
> +gt_ggc_mx (generic_wide_int <rwide_int_storage> *)
> +{
> +}
> +
> +inline void
> +gt_pch_nx (generic_wide_int <rwide_int_storage> *)
> +{
> +}
> +
> +inline void
> +gt_pch_nx (generic_wide_int <rwide_int_storage> *, gt_pointer_operator, void *)
> +{
> +}
> +
> +template<int N>
> +void
> +gt_ggc_mx (generic_wide_int <fixed_wide_int_storage <N> > *)
> +{
> +}
> +
> +template<int N>
> +void
> +gt_pch_nx (generic_wide_int <fixed_wide_int_storage <N> > *)
> +{
> +}
> +
> +template<int N>
> +void
> +gt_pch_nx (generic_wide_int <fixed_wide_int_storage <N> > *,
> + gt_pointer_operator, void *)
> +{
> +}
> +
> +template<int N>
> void
> -gt_ggc_mx (generic_wide_int <T> *)
> +gt_ggc_mx (generic_wide_int <widest_int_storage <N> > *)
> {
> }
>
> -template<typename T>
> +template<int N>
> void
> -gt_pch_nx (generic_wide_int <T> *)
> +gt_pch_nx (generic_wide_int <widest_int_storage <N> > *)
> {
> }
>
> -template<typename T>
> +template<int N>
> void
> -gt_pch_nx (generic_wide_int <T> *, gt_pointer_operator, void *)
> +gt_pch_nx (generic_wide_int <widest_int_storage <N> > *,
> + gt_pointer_operator, void *)
> {
> }
>
>
>
> Jakub
>
--
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)
next prev parent reply other threads:[~2023-09-29 9:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 14:34 [RFC] > WIDE_INT_MAX_PREC support in wide-int Jakub Jelinek
2023-08-29 9:49 ` Richard Biener
2023-08-29 10:42 ` Richard Sandiford
2023-08-29 15:09 ` Jakub Jelinek
2023-09-28 14:03 ` [RFC] > WIDE_INT_MAX_PREC support in wide_int and widest_int Jakub Jelinek
2023-09-28 15:53 ` Aldy Hernandez
2023-09-29 8:37 ` Jakub Jelinek
2023-09-29 12:04 ` Aldy Hernandez
2023-09-29 8:24 ` Jakub Jelinek
2023-09-29 9:25 ` Richard Biener [this message]
2023-09-29 9:49 ` Richard Biener
2023-09-29 10:30 ` Richard Sandiford
2023-09-29 10:58 ` Jakub Jelinek
2023-10-05 15:11 ` Jakub Jelinek
2023-10-06 17:41 ` Jakub Jelinek
2023-08-29 14:46 ` [RFC] > WIDE_INT_MAX_PREC support in wide-int 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=nycvar.YFH.7.77.849.2309290920570.5561@jbgna.fhfr.qr \
--to=rguenther@suse.de \
--cc=aldyh@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=richard.sandiford@arm.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).