1 /* 2 * config.h 3 * 4 * This file contains various configuration needed for compilation 5 * 6 * The minimum Hamming weight computation uses different types of 7 * population count (bit count) methods, see popcount.h/c: 8 * POPCOUNT_STD 9 * POPCOUNT_LUT8 10 * POPCOUNT_LUT16 11 * 12 * Version Log: 13 * 0.1 18 March 2008 (first released to public -- GUAVA 3.3) 14 * 15 * CJ, Tjhai 16 * email: ctjhai@plymouth.ac.uk 17 * Homepage: www.plymouth.ac.uk/staff/ctjhai 18 * 19 */ 20 21 #ifndef _CONFIG_H 22 #define _CONFIG_H 23 24 #include <limits.h> 25 26 #undef BITS_PER_LONG 27 #if ULONG_MAX == 0xffffffffUL 28 # define BITS_PER_LONG 32 29 #elif ULONG_MAX == 0xffffffffffffffffUL 30 # define BITS_PER_LONG 64 31 #else 32 # error Unknown architecture, report to ctjhai@plymouth.ac.uk 33 #endif 34 35 #if BITS_PER_LONG == 64 /* 64-bit */ 36 # define ZERO 0x0UL 37 # define ONE 0x1UL 38 # define MOD 0x3F 39 # define LOG2 6 40 #else /* 32-bit */ 41 # define ZERO 0x0UL 42 # define ONE 0x1UL 43 # define MOD 0x1F 44 # define LOG2 5 45 #endif /* BITS_PER_LONG */ 46 #define BITSIZE BITS_PER_LONG 47 48 #define POPCOUNT_LUT16 1 49 50 #endif 51