Don't compile crc32c-intel on non-x86 platforms
authorAaron Carroll <aaronc@cse.unsw.edu.au>
Fri, 12 Sep 2008 08:57:13 +0000 (10:57 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 12 Sep 2008 08:57:13 +0000 (10:57 +0200)
crc32c_intel() doesn't make sense on platforms without SSE, so alias it
to crc32c() on such machines.

Signed-off-by: Aaron Carroll <aaronc@gelato.unsw.edu.au>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
arch/arch-x86.h
arch/arch-x86_64.h
crc/crc32c-intel.c
crc/crc32c.h

index 97262ffe0769f9a445fe3042031867987350d9a2..9631437e857879b27b110eba4885fc53a363a43b 100644 (file)
@@ -39,5 +39,6 @@ static inline unsigned long arch_ffz(unsigned long bitmask)
        return bitmask;
 }
 #define ARCH_HAVE_FFZ
+#define ARCH_HAVE_SSE
 
 #endif
index 216e74e2e32a409d1d7bbee30aa38f771cafdb40..457714c80506cebc0c81f5e88ceca537643ac83c 100644 (file)
@@ -39,5 +39,6 @@ static inline unsigned int arch_ffz(unsigned int bitmask)
        return bitmask;
 }
 #define ARCH_HAVE_FFZ
+#define ARCH_HAVE_SSE
 
 #endif
index c0abe73ad7a85ac5bb794f3e50b6137b796391df..cec5ad5dec9d5d88ec7498133f2915ae0c1bd146 100644 (file)
@@ -1,4 +1,5 @@
 #include <inttypes.h>
+#include "crc32c.h"
 
 /*
  * Based on a posting to lkml by Austin Zhang <austin.zhang@intel.com>
@@ -11,6 +12,8 @@
  * Volume 2A: Instruction Set Reference, A-M
  */
 
+#ifdef ARCH_HAVE_SSE
+
 #if BITS_PER_LONG == 64
 #define REX_PRE "0x48, "
 #define SCALE_F 8
@@ -64,3 +67,6 @@ uint32_t crc32c_intel(unsigned char const *data, unsigned long length)
 
        return crc;
 }
+
+#endif /* ARCH_HAVE_SSE */
+
index cf1713692b76e82efeb516740d0a1275875c70d1..0976261ac61832a9b36e1ab50a93b6c59b60d8f7 100644 (file)
 #ifndef CRC32C_H
 #define CRC32C_H
 
+#include "../arch/arch.h"
+
 extern uint32_t crc32c(unsigned char const *, unsigned long);
+
+#ifdef ARCH_HAVE_SSE
 extern uint32_t crc32c_intel(unsigned char const *, unsigned long);
+#else
+#define crc32c_intel crc32c
+#endif
 
 #endif