[Bug tree-optimization/90838] Detect table-based ctz implementation

wdijkstr at arm dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 11 22:47:00 GMT 2019


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

Wilco <wdijkstr at arm dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wdijkstr at arm dot com

--- Comment #2 from Wilco <wdijkstr at arm dot com> ---
(In reply to Jakub Jelinek from comment #1)
> __builtin_ctzll is undefined for 0, while the above is well defined and
> returns 0.

When the target ctz is well defined and returns 64 for 0, and we want to return
0 instead, this will work:

__builtin_ctzll (b) & 63


More information about the Gcc-bugs mailing list