mozilla/rust — pull request #4245 by JensNockert (2012-12-21 18:52:20+00:00)
Title: Add support for bitcount intrinsics Issue #2777

Adds support for the llvm.ctpop (count set bits), llvm.ctlz (count leading zeroes) and llvm.cttz (count trailing zeroes) intrinsics for i8, i16, i32 and i64. They are useful for implementing certain compression/decompression algorithms, chess engines and so on.

The ctlz/cttz intrinsics as implemented do not support the last parameter that decides if 0 needs to be defined or not and always sets it to 'false' which means that all inputs give defined output.