From: Michael R. Crusoe <crusoe@debian.org>
Subject: Fix use of some intrinsics when compiling for SSE2 only
--- gmap.orig/src/genomebits.h
+++ gmap/src/genomebits.h
@@ -144,7 +144,7 @@
 #define clear_lowbit_64(diff,relpos) (diff & (diff - 1))
 
 
-#if defined(HAVE_LZCNT)
+#if 0
 #define count_leading_zeroes_32(diff) _lzcnt_u32(diff)
 #define count_leading_zeroes_64(diff) _lzcnt_u64(diff)
 #elif defined(HAVE_BUILTIN_CLZ)
@@ -155,7 +155,7 @@
 #define count_leading_zeroes_64(diff) ((diff >> 48) ? clz_table[diff >> 48] : ((diff >> 32) ? 16 + clz_table[diff >> 32] : ((diff >> 16) ? 32 + clz_table[diff >> 16] : 48 + clz_table[diff])))
 #endif
 
-#if defined(HAVE_TZCNT)
+#if 0
 #define count_trailing_zeroes_32(diff) _tzcnt_u32(diff)
 #define count_trailing_zeroes_64(diff) _tzcnt_u64(diff)
 #elif defined(HAVE_BUILTIN_CTZ)
@@ -320,7 +320,7 @@
   debugx(printf("Entered count_leading_zeroes_128 with "));
   debugx(print_vector_hex(_diff));
 
-#if defined(HAVE_LZCNT) && defined(HAVE_SSE4_1) && defined(HAVE_MM_EXTRACT_EPI64)
+#if 0 && defined(HAVE_SSE4_1) && defined(HAVE_MM_EXTRACT_EPI64)
   UINT8 x;
 
   if ((x = _mm_extract_epi64(_diff,1)) != 0) {
@@ -366,7 +366,7 @@
   debugx(printf("Entered count_trailing_zeroes_128 with "));
   debugx(print_vector_hex(_diff));
 
-#if defined(HAVE_TZCNT) && defined(HAVE_SSE4_1) && defined(HAVE_MM_EXTRACT_EPI64)
+#if 0 && defined(HAVE_SSE4_1) && defined(HAVE_MM_EXTRACT_EPI64)
   UINT8 x;
 
   if ((x = _mm_extract_epi64(_diff,0)) != 0) {
--- gmap.orig/src/bitvector.c
+++ gmap/src/bitvector.c
@@ -15,7 +15,7 @@
 
 #if !defined(HAVE_SSE4_2)
 #define count_leading_zeroes_32(diff) ((diff >> 16) ? clz_table[diff >> 16] : 16 + clz_table[diff])
-#elif defined(HAVE_LZCNT)
+#elif 0
 #define count_leading_zeroes_32(diff) _lzcnt_u32(diff)
 #elif defined(HAVE_BUILTIN_CLZ)
 #define count_leading_zeroes_32(diff) __builtin_clz(diff)
@@ -25,7 +25,7 @@
 
 #if !defined(HAVE_SSE4_2)
 #define count_trailing_zeroes_32(elt) mod_37_bit_position[(-elt & elt) % 37]
-#elif defined(HAVE_TZCNT)
+#elif 0
 #define count_trailing_zeroes_32(elt) _tzcnt_u32(elt)
 #elif defined(HAVE_BUILTIN_CTZ)
 #define count_trailing_zeroes_32(elt) __builtin_ctz(elt)
--- gmap.orig/src/gmap.c
+++ gmap/src/gmap.c
@@ -860,13 +860,13 @@
 #ifdef HAVE_SSE4_2
   fprintf(stderr,"Checking compiler options for SSE4.2: ");
   fprintf(stderr,"%08X ",x);
-#ifdef HAVE_LZCNT
+#if 0
   fprintf(stderr,"_lzcnt_u32=%d ",_lzcnt_u32(x));
 #endif
 #ifdef HAVE_BUILTIN_CLZ
   fprintf(stderr,"__builtin_clz=%d ",__builtin_clz(x));
 #endif
-#ifdef HAVE_TZCNT
+#if 0
   fprintf(stderr,"_tzcnt_u32=%d ",_tzcnt_u32(x));
 #endif
 #ifdef HAVE_BUILTIN_CTZ
--- gmap.orig/src/gmapindex.c
+++ gmap/src/gmapindex.c
@@ -148,13 +148,13 @@
 
   fprintf(stderr,"Checking compiler assumptions for popcnt: ");
   fprintf(stderr,"%08X ",x);
-#ifdef HAVE_LZCNT
+#if 0
   fprintf(stderr,"_lzcnt_u32=%d ",_lzcnt_u32(x));
 #endif
 #ifdef HAVE_BUILTIN_CLZ
   fprintf(stderr,"__builtin_clz=%d ",__builtin_clz(x));
 #endif
-#ifdef HAVE_TZCNT
+#if 0
   fprintf(stderr,"_tzcnt_u32=%d ",_tzcnt_u32(x));
 #endif
 #ifdef HAVE_BUILTIN_CTZ
--- gmap.orig/src/gsnap.c
+++ gmap/src/gsnap.c
@@ -930,13 +930,13 @@
 #ifdef HAVE_SSE4_2
   fprintf(stderr,"Checking compiler assumptions for SSE4.2 options: ");
   fprintf(stderr,"%08X ",x);
-#ifdef HAVE_LZCNT
+#if 0
   fprintf(stderr,"_lzcnt_u32=%d ",_lzcnt_u32(x));
 #endif
 #ifdef HAVE_BUILTIN_CLZ
   fprintf(stderr,"__builtin_clz=%d ",__builtin_clz(x));
 #endif
-#ifdef HAVE_TZCNT
+#if 0
   fprintf(stderr,"_tzcnt_u32=%d ",_tzcnt_u32(x));
 #endif
 #ifdef HAVE_BUILTIN_CTZ
--- gmap.orig/src/oligoindex_hr.c
+++ gmap/src/oligoindex_hr.c
@@ -9904,7 +9904,7 @@
 
 #if !defined(HAVE_SSE4_2)
 #define count_trailing_zeroes_32(diff) mod_37_bit_position[(-diff & diff) % 37]
-#elif defined(HAVE_TZCNT)
+#elif 0
 #define count_trailing_zeroes_32(diff) _tzcnt_u32(diff)
 #elif defined(HAVE_BUILTIN_CTZ)
 #define count_trailing_zeroes_32(diff) __builtin_ctz(diff)
--- gmap.orig/src/popcount.c
+++ gmap/src/popcount.c
@@ -4,7 +4,7 @@
 #endif
 
 
-#if !defined(HAVE_SSE4_2) || (!defined(HAVE_TZCNT) && !defined(HAVE_BUILTIN_CTZ))
+#if !defined(HAVE_SSE4_2) || !defined(HAVE_BUILTIN_CTZ)
 const int mod_37_bit_position[] = 
   {
     32, 0, 1, 26, 2, 23, 27, 0, 3, 16, 24, 30, 28, 11, 0, 13, 4,
@@ -2066,7 +2066,7 @@
  };
 #endif
 
-#if !defined(HAVE_SSE4_2) || (!defined(HAVE_LZCNT) && !defined(HAVE_BUILTIN_CLZ))
+#if !defined(HAVE_SSE4_2) || !defined(HAVE_BUILTIN_CLZ)
 const int clz_table[] =
 {16,15,14,14,13,13,13,13,12,12,12,12,12,12,12,12,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,
  10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
--- gmap.orig/src/popcount.h
+++ gmap/src/popcount.h
@@ -5,7 +5,7 @@
 #include "config.h"		/* For HAVE_BUILTIN_CTZ, HAVE_BUILTIN_POPCOUNT, HAVE_BUILTIN_CLZ */
 #endif
 
-#if !defined(HAVE_SSE4_2) || (!defined(HAVE_TZCNT) && !defined(HAVE_BUILTIN_CTZ))
+#if !defined(HAVE_SSE4_2) || !defined(HAVE_BUILTIN_CTZ)
 extern const int mod_37_bit_position[];
 #endif
 
@@ -13,7 +13,7 @@
 extern const int count_bits[];
 #endif
 
-#if !defined(HAVE_SSE4_2) || (!defined(HAVE_LZCNT) && !defined(HAVE_BUILTIN_CLZ))
+#if !defined(HAVE_SSE4_2) || !defined(HAVE_BUILTIN_CLZ)
 extern const int clz_table[];
 #endif
 
