
Just for reference:
In Data/IntMap/Base.hs
highestBitMask :: Nat -> Nat
highestBitMask x0
= case (x0 .|. shiftRL x0 1) of
x1 -> case (x1 .|. shiftRL x1 2) of
x2 -> case (x2 .|. shiftRL x2 4) of
x3 -> case (x3 .|. shiftRL x3 8) of
x4 -> case (x4 .|. shiftRL x4 16) of
#if !(defined(__GLASGOW_HASKELL__) && WORD_SIZE_IN_BITS==32)
x5 -> case (x5 .|. shiftRL x5 32) of -- for 64 bit platforms
#endif
x6 -> (x6 `xor` (shiftRL x6 1))
In FXT bithigh.h:
static inline ulong highest_one(ulong x)
// Return word where only the highest bit in x is set.
// Return 0 if no bit is set.
{
#if defined BITS_USE_ASM
if ( 0==x ) return 0;
x = asm_bsr(x);
return 1UL<
2012/12/12 David Thomas
: Ah, that's more than we'd been told. If that is the case, then containers is in violation of the GPL (unless they got permission to copy that code, separately), and either must obtain such permission, be relicensed, remove/replace that code.
I think it's just a confusion of language, the "derived" algorithm clashes uncomfortably with the lawyerly "derived work". They are not used in the same sense.
Niklas