|
Message-ID: <20230510161752.52270e0e@inria.fr>
Date: Wed, 10 May 2023 16:17:52 +0200
From: Jₑₙₛ Gustedt <jens.gustedt@...ia.fr>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: patches for C23
Hi,
there is a new version for these patches at
https://icube-forge.unistra.fr/icps/musl/-/network/master?extended_sha1=c23-v4
I tried to integrate the feedback that I had so far (Thanks!) in
particular concerning the support for 128 bit integer types. It should
now be that this support, as far as needed and interfaced by musl, is
unconditional.
on Thu, 4 May 2023 12:14:52 -0400 you (Rich Felker <dalias@...c.org>)
wrote:
> I don't expect you do to this work for us. It's something myself or
> anyone else working on musl stuff can do and that your patches can
> just assume is already present in musl by a name like __pop_arg_int128
> or something.
Ok, this should work now. The emulation code is found in uwide128.h
and uwide128.c and this function, that has to be provided in asm is
called `__uwide128_pop`.
If the compiler used to compile musl implements the `__int128` types,
these types are used, there is no reason to waste the knowledge that
was put over the years into this compiler support. Under this
condition, `__uwide128_pop` is also produced and just has to be
generated with -S and extracted from the asm file. It is then easy to
clean that up a bit, make the symbol weak and to provide the .s file
for the architecture, much as you indicated, Rich.
> __intscan only needs mul, not div, and mul is the easy side. It's
> printf that needs div, and 10 is the only non-power-of-two base there.
Well actually both only need mul and div with small numbers, so the
code complexity is about the same for both operations, here. But for
the whole we need also comparison, addition, subtraction, negation,
zero-test and conversion back and forth. So in all it was a bit more
complex than I thought.
> In the case of __intscan, I'd just change the signature to return an
> int128 tuple struct, and switch to using it when the value no longer
> fits in smaller type. The "lim" argument mechanism needs some change
> too I think.
Actually not much, only that one has to watch that the min values for
signed types get sign extended when converted to the structure.
I'll comment on the bit operations in stdbit.h as a reply to a separate
mail.
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 ::
Content of type "application/pgp-signature" skipped
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.