mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Jens Gustedt <jens.gustedt@inria.fr>
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 13:03:28 -0400	[thread overview]
Message-ID: <20230531170328.GI4163@brightrain.aerifal.cx> (raw)
In-Reply-To: <47E67930-DACE-4475-86F2-022A0EAA5F30@inria.fr>

On Wed, May 31, 2023 at 06:58:15PM +0200, Jens Gustedt wrote:
> Am 31. Mai 2023 18:30:16 MESZ schrieb Alexander Monakov <amonakov@ispras.ru>:
> > 
> > On Wed, 31 May 2023, Jₑₙₛ Gustedt wrote:
> > 
> > > Again, this is not an extension but an optional feature, and this has
> > > nothing of bleeding edge. This is present in compilers since ages, and
> > > everybody is using their specific ways to go around the restrictions
> > > of previous C standards.
> > 
> > So, to make sure, by compiler support do you mean __int128 here?
> 
> yes
> 
> > It is
> > not supported on 32-bit platforms neither by GCC nor by LLVM. On 64-bit
> > platforms it is piggy-backing on double-word operations support required
> > for implementing 64-bit 'long long' on 32-bit platforms.
> 
> So what? On the arch where it exist, it is used and useful. (And I
> also think that implementations improved over the state from 20
> years ago that you describe.)
> 
> Nobody is talking about offering it on compilers where there is no
> support. With the proposed patches this becomes an optional feature
> with feature tests. A real improvement for users, that up to now
> have to guess on their own.

_BitInt, and knowing the max available via BITINT_MAXWIDTH, provides
the same functionality to users without the burden on the library
implementation, which will necessarily keep doubling for the reason
Alexander mentioned -- once you have size N, size 2N gets added as a
consequence of supporting mul/div.

Nobody has been asking to be able to printf 128-bit numbers in
decimal. They've been asking to be able to use 128- or even 256-bit
integers in vector ops, crypto math, ipv6 routing, etc.

Rich

  reply	other threads:[~2023-05-31 17:03 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
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 [this message]
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=20230531170328.GI4163@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=jens.gustedt@inria.fr \
    --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).