Where possible use compiler builtins for CountBits and FindFirstBit.

This commit is contained in:
Jonathan G Rennison
2016-09-04 18:01:38 +01:00
parent 376a45d9fc
commit 349cd8a6f0
3 changed files with 48 additions and 3 deletions

View File

@@ -14,6 +14,8 @@
#include "../safeguards.h"
#ifndef WITH_BITMATH_BUILTINS
const uint8 _ffb_64[64] = {
0, 0, 1, 0, 2, 0, 1, 0,
3, 0, 1, 0, 2, 0, 1, 0,
@@ -53,6 +55,8 @@ uint8 FindFirstBit(uint32 x)
return pos;
}
#endif
/**
* Search the last set bit in a 64 bit variable.
*