This patch implements a performance regression test for bit reverse. The bit reverse algorithm on PPC was O(N) and had lots of dependency between contiguous instructions. We replace it with a faster O(lgN) algorithm in the following two patches:
https://reviews.llvm.org/D33572
https://reviews.llvm.org/D34908
This test case tests both the 32-bit and 64-bit bit reverse to ensure the new implementation is functionally correct and has a better performance.
For this specific benchmark, it is 3x faster with patches D33572 and D34908 (0.574s) than without them (1.919s).
[jtony@moose1 ~]$ time ./new.out
Sum1 = 0, Sum2 = feff800000800000
real 0m0.574s
user 0m0.574s
sys 0m0.000s
[jtony@moose1 ~]$ time ./old.out
Sum1 = 0, Sum2 = feff800000800000
real 0m1.919s
user 0m1.919s
sys 0m0.000s
This patch is requested by Hal Finkel.