From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11330 invoked from network); 31 May 2023 15:14:22 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 15:14:22 -0000 Received: (qmail 13365 invoked by uid 550); 31 May 2023 15:14:19 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13330 invoked from network); 31 May 2023 15:14:18 -0000 Date: Wed, 31 May 2023 11:14:06 -0400 From: Rich Felker To: =?utf-8?B?SuKCkeKCmeKCmw==?= Gustedt Cc: musl@lists.openwall.com Message-ID: <20230531151406.GG4163@brightrain.aerifal.cx> References: <1c8e850ed3190af39b9e3f501d79899d438e7292.1685536608.git.Jens.Gustedt@inria.fr> <20230531142743.GB4163@brightrain.aerifal.cx> <20230531163643.2a382b4a@inria.fr> <20230531144128.GD4163@brightrain.aerifal.cx> <20230531165545.29eb823f@inria.fr> <20230531145724.GF4163@brightrain.aerifal.cx> <20230531170700.65bd9c11@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230531170700.65bd9c11@inria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [C23 128 bit 4/4] C23: implement proper support for int128_t and uint128_t On Wed, May 31, 2023 at 05:07:00PM +0200, Jₑₙₛ Gustedt wrote: > Rich, > > on Wed, 31 May 2023 10:57:24 -0400 you (Rich Felker ) > wrote: > > > On Wed, May 31, 2023 at 04:55:45PM +0200, Jₑₙₛ Gustedt wrote: > > > Rich, > > > > > > on Wed, 31 May 2023 10:41:29 -0400 you (Rich Felker > > > ) wrote: > > > > > > > On Wed, May 31, 2023 at 04:36:43PM +0200, Jₑₙₛ Gustedt wrote: > > [...] > > [...] > > [...] > > > > > > > > Can you cite that? > > > > > > sure, almost by heart, since I wrote that ;-) > > > > > > … with the possible exceptions of signed bit-precise integer types > > > and of signed extended integer types that are wider than `long > > > long` and that are referred by the type definition for an exact > > > width integer type > > > > > > > Because I don't see it. I still see that intmax_t > > > > has to be at least as wide as all the intN_t. > > > > > > I seems that you read that the wrong way around. > > > > OK, so AIUI based on this exception it's permitted but not required to > > offer int128_t. > > yes > > But compilers can never offer it if there is not minimal C library > support, which we are doing here. This is the only way we found in > yearlong discussions in WG14 to get us out of this intmax_t ABI trap. > > For the 128 bit types in particular this answers numerous requests by > users who want to have these in different contexts and where quite > frustrated that compilers have these since decades but where not able > to announce them officially, not even as extended integer types. OK, well this whole thread/topic then is a request/proposal for extended functionality, not part of C23 support, and needs to be considered as such. I'm sorry there seems to have been a misunderstanding here. I'm trying to understand where you're coming from, and I think now you were probably looking at the intmax_t situation as if int128_t was something we wanted to offer, but couldn't because of ABI requirements. Whereas I was always looking at compounding library support for larger and larger types as an odious requirement that intmax_t helped us avoid. I *do* think there is demand for being able to compute with larger-than-int64 integer types, and this is a good thing, but it's a problem _BitInt solves entirely without imposing any heavy library requirements. I don't think "printing a 128 bit number in decimal" is very useful functionality. Hex, maybe, but then 256+ is really what you would want (for key material etc). I'm sorry for sending you down a road of implementing this stuff in a way that'd be plausible for inclusion in musl based on a misunderstanding that it was a requirement for C23 support. Rich