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

frankhb1989 at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |frankhb1989 at gmail dot com

--- Comment #8 from frankhb1989 at gmail dot com ---
(In reply to Richard Biener from comment #1)
> You shouldn't use those, they are for internal use only.  That's the reason
> they are not documented.

There are cases of legitimate use, e.g. given that
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29776 is still not fixed, one may
want something like:

int
floor2(uint64_t x)
{
#if __has_builtin(__builtin_ia32_bsrdi)
        return __builtin_ia32_bsrdi(x);
#elif __has_builtin(__builtin_clzll)
        return 63 - size_t(__builtin_clzll(x));
#else
// ...
#endif
}

The key point is that __has_builtin checks are apparently cleaner than
traditional #if defined(__xxx__)+headers+intrinsics way. Moreover,
__has_builtin and __builtin_xxx may be even more portable (among compilers) and
preferred in new code. The intentional statement you quoted was posted in 2005;
this seems outdated today.

Reply via email to