diff options
Diffstat (limited to 'Hilbert/FixBitVec.hpp')
-rw-r--r-- | Hilbert/FixBitVec.hpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/Hilbert/FixBitVec.hpp b/Hilbert/FixBitVec.hpp index 89f7bf6..58a7f38 100644 --- a/Hilbert/FixBitVec.hpp +++ b/Hilbert/FixBitVec.hpp @@ -20,6 +20,7 @@ #ifndef _FIXBITVEC_HPP_ #define _FIXBITVEC_HPP_ +#include <Hilbert/Operations.hpp> #include <inttypes.h> #include <cassert> @@ -341,22 +342,7 @@ public: int fsb() const { - FBV_UINT i = m_uiRack; - int c = 0; - -#if FBV_BITS == 64 - if ( i == FBV0 ) return 0; - if ( (i&FBVN1S(32)) == FBV0 ) { i>>=32; c^=32; } -#elif FBV_BITS == 32 - if ( i == FBV0 ) return 0; -#endif - if ( (i&FBVN1S(16)) == FBV0 ) { i>>=16; c^=16; } - if ( (i&FBVN1S( 8)) == FBV0 ) { i>>= 8; c^= 8; } - if ( (i&FBVN1S( 4)) == FBV0 ) { i>>= 4; c^= 4; } - if ( (i&FBVN1S( 2)) == FBV0 ) { i>>= 2; c^= 2; } - if ( (i&FBVN1S( 1)) == FBV0 ) { i>>= 1; c^= 1; } - - return ++c; + return ffs(m_uiRack); } |