Skip to content

Commit

Permalink
Merge pull request #6 from niklasf/gnuc-ctzll
Browse files Browse the repository at this point in the history
Use __builtin_ctzll as fallback if available
  • Loading branch information
georgvonzimmermann committed Sep 20, 2016
2 parents 3f539c9 + 7ede782 commit fe75994
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions board.h
Expand Up @@ -278,6 +278,13 @@ int firstSquare(qword a)
: "cc");
return (int)res;
}
#elif defined(__GNUC__)
inline
int firstSquare(qword a)
{
assert(a != 0);
return __builtin_ctzll(a);
}
#else
#error not a supported architecture
// If someone wants to support non-intel architectures, there are some (slower) C versions
Expand Down

0 comments on commit fe75994

Please sign in to comment.