Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 31 May 2023 13:03:28 -0400
From: Rich Felker <dalias@...c.org>
To: Jens Gustedt <jens.gustedt@...ia.fr>
Cc: musl@...ts.openwall.com
Subject: Re: [C23 128 bit 4/4] C23: implement proper support for
 int128_t and uint128_t

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.