public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111309] New: va_arg alternative for _BitInt
@ 2023-09-06 17:05 jakub at gcc dot gnu.org
  2023-09-06 17:29 ` [Bug c/111309] " joseph at codesourcery dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-09-06 17:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111309

            Bug ID: 111309
           Summary: va_arg alternative for _BitInt
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

For https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2858.pdf , I wonder if we
shouldn't have a __builtin_va_arg variant which would allow to read arbitrary
_BitInt
into array of limbs.  The builtin IMHO should be passed at least the N from
_BitInt(N), probably whether it is signed vs. unsigned and pointer to the array
of limbs, dunno whether it should only support limb type which it also uses for
the libgcc APIs or whether the type should be e.g. inferred from the scalar
integer type the pointer argument points to.  And whether the endianity in
which limbs are ordered should be host endianity, some other argument to the
builtin, or always the _BitInt endianity.
On arches like x86-64 where the passing ABI says for N <= 8 pass like char, for
N <= 16 pass like short, for N <= 32 pass like int, for N <= 64 pass like long
long, otherwise pass like struct { long long a[(N + 63) / 64]; } it would need
to differentiate at runtime (unless N is constant obviously) the different
cases to perform proper VA_ARG for that, plus handle the generic case which
would be always passed in memory.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-21  9:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06 17:05 [Bug c/111309] New: va_arg alternative for _BitInt jakub at gcc dot gnu.org
2023-09-06 17:29 ` [Bug c/111309] " joseph at codesourcery dot com
2023-09-06 17:40 ` jakub at gcc dot gnu.org
2023-09-06 17:47 ` joseph at codesourcery dot com
2023-11-14  9:52 ` cvs-commit at gcc dot gnu.org
2023-11-20 10:31 ` clyon at gcc dot gnu.org
2023-11-20 16:55 ` jakub at gcc dot gnu.org
2023-11-21  9:04 ` cvs-commit at gcc dot gnu.org

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 read-only IMAP folder(s) and NNTP newsgroup(s).