From: Jakub Jelinek <jakub@redhat.com>
To: Joseph Myers <josmyers@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] v3: Use gcc __builtin_stdc_* builtins in stdbit.h if possible
Date: Mon, 29 Jan 2024 22:18:20 +0100 [thread overview]
Message-ID: <ZbgWHFYdAGWJOHwi@tucnak> (raw)
In-Reply-To: <23ea145a-5250-3770-9789-c48ea4b417eb@redhat.com>
On Mon, Jan 29, 2024 at 09:07:08PM +0000, Joseph Myers wrote:
> On Fri, 26 Jan 2024, Jakub Jelinek wrote:
>
> > So like this then (only stdbit.texi changed since last patch)?
>
> Yes.
>
> > +ui
> > +leading_zeros (uc a, us b, ui c, ul d, ull e)
> > +{
> > + return (stdc_leading_zeros (a)
> > + + stdc_leading_zeros (b)
> > + + stdc_leading_zeros (c)
> > + + stdc_leading_zeros (d)
> > + + stdc_leading_zeros (e));
> > +}
>
> I don't see what these functions are for. They don't seem to be used at
> all, and the existing tests thoroughly cover the type-generic macros as
> applied to non-_BitInt types, so additional tests that only verify that
> such calls can be compiled for non-_BitInt types don't seem to add much
> value.
Most of the other tests (except the tests for side-effects in arguments)
have constant arguments and so can be folded very early during compilation,
even the side-effects in arguments tests can be folded soon when optimizing,
so these functions were just an attempt to make sure the macros can be
compiled/linked when the arguments are certainly not known.
But if you think it isn't worth checking that or if it is already tested by
some other test, I can remove that.
Another option is to duplicate the test and instead of using the macros
directly use it wrapped into small [[gnu::noinline]] functions.
Jakub
next prev parent reply other threads:[~2024-01-29 21:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-20 18:04 [PATCH] " Jakub Jelinek
2024-01-20 23:27 ` Joseph Myers
2024-01-22 9:19 ` [PATCH] v2: " Jakub Jelinek
2024-01-22 17:58 ` Joseph Myers
2024-01-26 10:12 ` [PATCH] v3: " Jakub Jelinek
2024-01-29 21:07 ` Joseph Myers
2024-01-29 21:18 ` Jakub Jelinek [this message]
2024-01-29 21:30 ` Joseph Myers
2024-01-29 22:10 ` [PATCH] v4: " Jakub Jelinek
2024-01-30 0:28 ` Andreas K. Huettel
2024-01-31 18:03 ` Joseph Myers
2024-02-01 10:12 ` Mark Wielaard
2024-02-01 10:23 ` Mark Wielaard
2024-02-01 10:33 ` [PATCH] Fix up stdbit.texi Jakub Jelinek
2024-02-01 11:05 ` Mark Wielaard
2024-02-01 14:42 ` Carlos O'Donell
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=ZbgWHFYdAGWJOHwi@tucnak \
--to=jakub@redhat.com \
--cc=josmyers@redhat.com \
--cc=libc-alpha@sourceware.org \
/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.
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).