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] patches for C23
Date: Wed, 10 May 2023 16:17:52 +0200	[thread overview]
Message-ID: <20230510161752.52270e0e@inria.fr> (raw)
In-Reply-To: <20230504161451.GE4163@brightrain.aerifal.cx>

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

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@libc.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 ::

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

  reply	other threads:[~2023-05-10 14:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-01 18:50 Jₑₙₛ Gustedt
2023-05-01 19:24 ` Khem Raj
2023-05-01 19:41 ` Rich Felker
2023-05-02  6:57   ` Jₑₙₛ Gustedt
2023-05-02 13:59     ` Jₑₙₛ Gustedt
2023-05-02 23:20       ` Rich Felker
2023-05-03  0:00         ` Rich Felker
2023-05-03  9:12           ` Jₑₙₛ Gustedt
2023-05-03 14:16             ` Rich Felker
2023-05-03 15:11               ` Jₑₙₛ Gustedt
2023-05-03 17:28                 ` Rich Felker
2023-05-03 18:46                   ` Jₑₙₛ Gustedt
2023-05-03 19:33                     ` Rich Felker
2023-05-04  1:09                       ` Gabriel Ravier
2023-05-04 14:07                         ` Rich Felker
2023-05-04  6:48                       ` Jₑₙₛ Gustedt
2023-05-04 14:30                         ` Rich Felker
2023-05-04 15:31                           ` enh
2023-05-04 15:53                           ` Jₑₙₛ Gustedt
2023-05-04 16:14                             ` Rich Felker
2023-05-10 14:17                               ` Jₑₙₛ Gustedt [this message]
2023-05-10 14:28                             ` [musl] stdbit.h Jₑₙₛ Gustedt
2023-05-04 15:50             ` [musl] patches for C23 Jeffrey Walton
2023-05-04 16:05               ` Rich Felker
2023-05-03  7:13         ` Jₑₙₛ Gustedt
2023-05-03 14:06           ` Rich Felker
2023-05-03 14:26             ` Jₑₙₛ Gustedt
2023-05-03 14:43               ` Rich Felker
2023-05-03 15:26                 ` Jₑₙₛ Gustedt

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=20230510161752.52270e0e@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).