summaryrefslogtreecommitdiff
path: root/crc
diff options
context:
space:
mode:
authorAaron Carroll <aaronc@cse.unsw.edu.au>2008-09-12 10:57:13 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-09-12 10:57:13 +0200
commit419484b934222e589f0b718e9494b045df176167 (patch)
treeac032388ec86aa361afeb864489dd3793dd4a538 /crc
parentb29ee5b3dee417016164198fb240344ef666de2b (diff)
downloadfio-419484b934222e589f0b718e9494b045df176167.tar.gz
fio-419484b934222e589f0b718e9494b045df176167.tar.bz2
Don't compile crc32c-intel on non-x86 platforms
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>
Diffstat (limited to 'crc')
-rw-r--r--crc/crc32c-intel.c6
-rw-r--r--crc/crc32c.h7
2 files changed, 13 insertions, 0 deletions
diff --git a/crc/crc32c-intel.c b/crc/crc32c-intel.c
index c0abe73a..cec5ad5d 100644
--- a/crc/crc32c-intel.c
+++ b/crc/crc32c-intel.c
@@ -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 */
+
diff --git a/crc/crc32c.h b/crc/crc32c.h
index cf171369..0976261a 100644
--- a/crc/crc32c.h
+++ b/crc/crc32c.h
@@ -18,7 +18,14 @@
#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