This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
__builtin_clzll and uintmax_t
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: gcc at gcc dot gnu dot org
- Date: Sat, 5 Mar 2011 22:05:55 +0100 (CET)
- Subject: __builtin_clzll and uintmax_t
- Reply-to: gcc at gcc dot gnu dot org
Hello,
the following question came up for a libstdc++ patch. We have a variable
of type uintmax_t and want to count the leading zeros. Can we just call
__builtin_clzll on it?
In particular, can uintmax_t be larger than unsigned long long in gcc? Is
__builtin_clzll available on all platforms? Is there a good reason to use
__builtin_clzl instead on platforms where long and long long have the same
size?
In case it matters, this is strictly for compile-time computations
(templates, constexpr).
--
Marc Glisse