File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -720,7 +720,10 @@ static inline double ffp_bits2double(uint64_t bits) {
720720static inline unsigned int
721721ffc_nlz_int64 (uint64_t x )
722722{
723- #if defined(_MSC_VER ) && defined(__AVX2__ ) && defined(HAVE___LZCNT64 )
723+ #if defined(HAVE_BUILTIN___BUILTIN_CLZLL ) && !(defined(__sun ) && defined(__sparc ))
724+ return (unsigned int )__builtin_clzll ((unsigned long long )x );
725+
726+ #elif defined(_MSC_VER ) && defined(__AVX2__ ) && defined(HAVE___LZCNT64 )
724727 return (unsigned int )__lzcnt64 (x );
725728
726729#elif defined(__x86_64__ ) && defined(__LZCNT__ ) && defined(HAVE__LZCNT_U64 )
@@ -730,21 +733,6 @@ ffc_nlz_int64(uint64_t x)
730733 unsigned long r ;
731734 return _BitScanReverse64 (& r , x ) ? (63u - (unsigned int )r ) : 64 ;
732735
733- #elif defined(__has_builtin ) && __has_builtin (__builtin_clzl ) && __has_builtin (__builtin_clzll ) && !(defined(__sun ) && defined(__sparc ))
734- if (x == 0 ) {
735- return 64 ;
736- }
737- else if (sizeof (long ) * CHAR_BIT == 64 ) {
738- return (unsigned int )__builtin_clzl ((unsigned long )x );
739- }
740- else if (sizeof (long long ) * CHAR_BIT == 64 ) {
741- return (unsigned int )__builtin_clzll ((unsigned long long )x );
742- }
743- else {
744- /* :FIXME: Is there a way to make this branch a compile-time error? */
745- __builtin_unreachable ();
746- }
747-
748736#else
749737 uint64_t y ;
750738 unsigned int n = 64 ;
You can’t perform that action at this time.
0 commit comments