[PATCH] [Support] Add BitHacks.h - generic bit utility functions.

Rui Ueyama ruiu at google.com
Tue May 21 21:24:56 PDT 2013



================
Comment at: include/llvm/Support/BitHacks.h:24
@@ +23,3 @@
+namespace bit {
+enum ZeroBehaivor {
+  ZB_Undefined,
----------------
Add comments on these enums.

================
Comment at: include/llvm/Support/BitHacks.h:187
@@ +186,3 @@
+/// http://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable
+static const unsigned char bitReverseTable256[256] = {
+#define R2(n) n, n + 2 * 64, n + 1 * 64, n + 3 * 64
----------------
Impressive hack!


http://llvm-reviews.chandlerc.com/D841



More information about the llvm-commits mailing list