[llvm] r182667 - [Support] Add type generic bit utilities to MathExtras.h

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri May 24 13:57:57 PDT 2013


> +  // Use ^ instead of - because both gcc and llvm can remove the associated ^
> +  // in the __builtin_clz intrinsic on x86.
> +  return countLeadingZeros(Val, ZB_Undefined) ^
> +         (std::numeric_limits<T>::digits - 1);
> +}


Hi, Michael,

have you noticed: http://llvm.org/bugs/show_bug.cgi?id=16115#c3 Is it
correct to use ^ in here? If so, I guess the testcase in the bug was
incorrectly reduced.

Can you pleas add a FIXME about removing CountLeadingZeros_32 and
CountLeadingZeros_64 and using countLeadingZeros instead?

Cheers,
Rafael



More information about the llvm-commits mailing list