Parcourir la source

- 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 il y a 18 ans
Parent
commit
83e10e2606
2 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 2 2
      bit_scan.c
  2. 2 2
      bit_scan.h

+ 2 - 2
bit_scan.c

@@ -26,10 +26,10 @@
 
 #include "bit_scan.h"
 
-int _debruijn_hash32[32]={0, 1, 2, 6, 3, 11, 7, 16, 4, 14, 12, 21, 8,
+unsigned char _debruijn_hash32[32]={0, 1, 2, 6, 3, 11, 7, 16, 4, 14, 12, 21, 8,
 	23, 17, 26, 31, 5, 10, 15, 13, 20, 22, 25, 30, 9, 19, 24, 29, 18, 28, 27 };
 
-int _debruijn_hash64[64]={0, 1, 2, 7, 3, 13, 8, 19, 4, 25, 14, 28, 9,
+unsigned char _debruijn_hash64[64]={0, 1, 2, 7, 3, 13, 8, 19, 4, 25, 14, 28, 9,
 	34, 20, 40, 5, 17, 26, 38, 15, 46, 29, 48, 10, 31, 35, 54, 21, 50, 41, 57,
 	63, 6, 12, 18, 24, 27, 33, 39, 16, 37, 45, 47, 30, 53, 49, 56, 62, 11, 23,
 	32, 36, 44, 52, 55, 61, 22, 43, 51, 60, 42, 59, 58 };

+ 2 - 2
bit_scan.h

@@ -150,8 +150,8 @@
  *  ("Using de Bruijn Sequences to Index a 1 in a Computer Word")
  */
 
-extern int _debruijn_hash32[32]; /* see bit_scan.c */
-extern int _debruijn_hash64[64]; /* see bit_scan.c */
+extern unsigned char _debruijn_hash32[32]; /* see bit_scan.c */
+extern unsigned char _debruijn_hash64[64]; /* see bit_scan.c */
 
 #define DEBRUIJN_CT32  0x04653ADFU
 #define DEBRUIJN_CT64  0x0218A392CD3D5DBFULL