mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Jₑₙₛ Gustedt" <jens.gustedt@inria.fr>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [C23 128 bit 4/4] C23: implement proper support for int128_t and uint128_t
Date: Wed, 31 May 2023 17:37:18 +0200	[thread overview]
Message-ID: <20230531173718.3d7d499f@inria.fr> (raw)
In-Reply-To: <20230531151406.GG4163@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 3418 bytes --]

Rich,

on Wed, 31 May 2023 11:14:06 -0400 you (Rich Felker <dalias@libc.org>)
wrote:

> 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
> > <dalias@libc.org>) wrote:
> >   
> > > On Wed, May 31, 2023 at 04:55:45PM +0200, Jₑₙₛ Gustedt wrote:  
>  [...]  
>  [...]  
> > >  [...]  
> > >  [...]  
> > >  [...]    
>  [...]  
>  [...]  
>  [...]  
>  [...]  
> > > 
> > > 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.

That's a stretch. It is an optional feature, we implement other
optional features. This a feature that the C standard describes and
that we are able to provide with relatively low effort.

> 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 don't think that that particular feature is very useful
functionality, we agree on that. It is just part of the catalogue that
is needed to claim proper 128 bit support.

Other features are probably more useful, such as checked arithmetic
and the bit operation interfaces. These also come with C23, but for
_BitInt types only if there is a fixed width type with the same width.

> 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.

This will come in other C libraries, anyhow. And this is not an
extension outside the standard. The standard clearly describes how and
when this has to be or can be done.

Thanks
Jₑₙₛ

-- 
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

  reply	other threads:[~2023-05-31 15:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 14:15 [musl] [C23 128 bit 0/4] implement the library part of 128 bit support Jens Gustedt
2023-05-31 14:15 ` [musl] [C23 128 bit 1/4] add an emulation for 128 bit arithmetic as needed for C library support Jens Gustedt
2023-05-31 14:15 ` [musl] [C23 128 bit 2/4] C23: implement w128 and wf128 support for printf Jens Gustedt
2023-05-31 14:15 ` [musl] [C23 128 bit 3/4] C23: implement w128 and wf128 for scanf and similar Jens Gustedt
2023-05-31 14:15 ` [musl] [C23 128 bit 4/4] C23: implement proper support for int128_t and uint128_t Jens Gustedt
2023-05-31 14:27   ` Rich Felker
2023-05-31 14:29     ` Rich Felker
2023-05-31 14:36     ` Jₑₙₛ Gustedt
2023-05-31 14:41       ` Rich Felker
2023-05-31 14:55         ` Jₑₙₛ Gustedt
2023-05-31 14:57           ` Rich Felker
2023-05-31 15:07             ` Jₑₙₛ Gustedt
2023-05-31 15:14               ` Rich Felker
2023-05-31 15:37                 ` Jₑₙₛ Gustedt [this message]
2023-05-31 15:40                   ` Rich Felker
2023-05-31 15:56                     ` Jₑₙₛ Gustedt
2023-05-31 16:30                       ` Alexander Monakov
2023-05-31 16:58                         ` Jens Gustedt
2023-05-31 17:03                           ` Rich Felker
2023-05-31 17:09                           ` Alexander Monakov
2023-06-01  7:24                             ` Jₑₙₛ Gustedt
2023-05-31 14:42     ` Jₑₙₛ Gustedt
2023-05-31 14:47       ` Rich Felker

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=20230531173718.3d7d499f@inria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).