amoeba
amoeba copied to clipboard
lastBit not being set correctly for GDC?
Just wondering if this bit of code in util.d is correct?
/* Get the first bit set */
version (LDC) int firstBit(ulong b) {return cast (int) llvm_cttz(b, true);}
else version (GDC) alias firstBit = __builtin_ctz;
else alias firstBit = bsf;
/* Get the last bit set */
version (GDC) alias firstBit = __builtin_clz;
else alias lastBit = bsr;
The second to last line resets firstBit and doesn't actually set lastBit for GDC. Seems off to me :)
May not affect much as it seems to only be used to resize tables, but it may affect accuracy, if used in the future I suppose.