From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id BA4CB3865483 for ; Fri, 29 Sep 2023 09:25:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA4CB3865483 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 42D09210E3; Fri, 29 Sep 2023 09:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695979501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dJiBsn/wBvTC48fZw5CJQII+otzaqfnffzEJoX72wuI=; b=JaOrT0CBZZ0wHiL7TAPtGDQsAgfjOEqfW1FTsxCJl7QdSEbH1741yL/5OqJA83Ru2vN76p LIZWV3+xbzdVuwZIWECytYTSLyA6+sTEAkZfdidIkdjuxG2nLHdRXQ+qZheW+Z89++9+nW jxLNL7408Nlo9S93jQCODK/Jte+BLNc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695979501; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=dJiBsn/wBvTC48fZw5CJQII+otzaqfnffzEJoX72wuI=; b=nziR2F2k07BfOpm11bdVrPZDmwHLABDoxeLOOHrhVZ1k5K5Vl1FthOmkGDtHglBJVnb1D0 AfMUstoZHET7EjAQ== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 0166F2C142; Fri, 29 Sep 2023 09:25:01 +0000 (UTC) Date: Fri, 29 Sep 2023 09:25:01 +0000 (UTC) From: Richard Biener To: Jakub Jelinek cc: Richard Sandiford , Aldy Hernandez , gcc-patches@gcc.gnu.org Subject: Re: [RFC] > WIDE_INT_MAX_PREC support in wide_int and widest_int In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 > +void gt_ggc_mx (generic_wide_int *) = delete; > +void gt_pch_nx (generic_wide_int *) = delete; > +void gt_pch_nx (generic_wide_int *, > + gt_pointer_operator, void *) = delete; > + > +inline void > +gt_ggc_mx (generic_wide_int *) > +{ > +} > + > +inline void > +gt_pch_nx (generic_wide_int *) > +{ > +} > + > +inline void > +gt_pch_nx (generic_wide_int *, gt_pointer_operator, void *) > +{ > +} > + > +template > +void > +gt_ggc_mx (generic_wide_int > *) > +{ > +} > + > +template > +void > +gt_pch_nx (generic_wide_int > *) > +{ > +} > + > +template > +void > +gt_pch_nx (generic_wide_int > *, > + gt_pointer_operator, void *) > +{ > +} > + > +template > void > -gt_ggc_mx (generic_wide_int *) > +gt_ggc_mx (generic_wide_int > *) > { > } > > -template > +template > void > -gt_pch_nx (generic_wide_int *) > +gt_pch_nx (generic_wide_int > *) > { > } > > -template > +template > void > -gt_pch_nx (generic_wide_int *, gt_pointer_operator, void *) > +gt_pch_nx (generic_wide_int > *, > + gt_pointer_operator, void *) > { > } > > > > Jakub > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)