commit | b6516aeef12a05aa47515f76e18fc426d85babbd | [log] [tgz] |
---|---|---|
author | Benjamin Kramer <benny.kra@googlemail.com> | Sat Jan 15 20:30:30 2011 +0000 |
committer | Benjamin Kramer <benny.kra@googlemail.com> | Sat Jan 15 20:30:30 2011 +0000 |
tree | 673d40370dbf9d6dfec81d45a5fbe5543185b99b | |
parent | 248f9f280756a1d6eb20a97ee4ab457ec18170f6 [diff] |
Reimplement CTPOP legalization with the "best" algorithm from http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel In a silly microbenchmark on a 65 nm core2 this is 1.5x faster than the old code in 32 bit mode and about 2x faster in 64 bit mode. It's also a lot shorter, especially when counting 64 bit population on a 32 bit target. I hope this is fast enough to replace Kernighan-style counting loops even when the input is rather sparse. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123547 91177308-0d34-0410-b5e6-96231b3b80d8