Browse code

- switched to unsigned char for the debruijn hash (now the entire lookup table fits into one cacheline; minor performance improvements can be seen on pentiumM and sparc64)

Andrei Pelinescu-Onciul authored on 26/06/2007 13:32:54
Showing 2 changed files
... ...
@@ -26,10 +26,10 @@
26 26
 
27 27
 #include "bit_scan.h"
28 28
 
29
-int _debruijn_hash32[32]={0, 1, 2, 6, 3, 11, 7, 16, 4, 14, 12, 21, 8,
29
+unsigned char _debruijn_hash32[32]={0, 1, 2, 6, 3, 11, 7, 16, 4, 14, 12, 21, 8,
30 30
 	23, 17, 26, 31, 5, 10, 15, 13, 20, 22, 25, 30, 9, 19, 24, 29, 18, 28, 27 };
31 31
 
32
-int _debruijn_hash64[64]={0, 1, 2, 7, 3, 13, 8, 19, 4, 25, 14, 28, 9,
32
+unsigned char _debruijn_hash64[64]={0, 1, 2, 7, 3, 13, 8, 19, 4, 25, 14, 28, 9,
33 33
 	34, 20, 40, 5, 17, 26, 38, 15, 46, 29, 48, 10, 31, 35, 54, 21, 50, 41, 57,
34 34
 	63, 6, 12, 18, 24, 27, 33, 39, 16, 37, 45, 47, 30, 53, 49, 56, 62, 11, 23,
35 35
 	32, 36, 44, 52, 55, 61, 22, 43, 51, 60, 42, 59, 58 };
... ...
@@ -150,8 +150,8 @@
150 150
  *  ("Using de Bruijn Sequences to Index a 1 in a Computer Word")
151 151
  */
152 152
 
153
-extern int _debruijn_hash32[32]; /* see bit_scan.c */
154
-extern int _debruijn_hash64[64]; /* see bit_scan.c */
153
+extern unsigned char _debruijn_hash32[32]; /* see bit_scan.c */
154
+extern unsigned char _debruijn_hash64[64]; /* see bit_scan.c */
155 155
 
156 156
 #define DEBRUIJN_CT32  0x04653ADFU
157 157
 #define DEBRUIJN_CT64  0x0218A392CD3D5DBFULL