summaryrefslogtreecommitdiff
path: root/src/support/cksum.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2016-03-25 08:19:12 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2016-03-25 08:19:12 +1100
commit43e885a0f9a3ad046eae1726b005ca1280624be3 (patch)
treef03d31a7b36c476484f26ea5259777aeb7b13201 /src/support/cksum.c
parent5cdd3e320cb19cd54111c2572a3d6e33d3009ad4 (diff)
parent9cf8eb2f15c6df7da90c19c86ccf7516ed126183 (diff)
downloadmongodb-3.2.5.tar.gz
Merge branch 'mongodb-3.4' into mongodb-3.2mongodb-3.2.5
Diffstat (limited to 'src/support/cksum.c')
-rw-r--r--src/support/cksum.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/support/cksum.c b/src/support/cksum.c
index c2982c40015..0b086753406 100644
--- a/src/support/cksum.c
+++ b/src/support/cksum.c
@@ -1260,6 +1260,23 @@ __wt_cksum_hw(const void *chunk, size_t len)
}
#endif
+#if defined(__powerpc64__)
+
+unsigned int crc32_vpmsum(unsigned int crc, const unsigned char *p,
+ unsigned long len);
+
+/*
+ * __wt_cksum_hw --
+ * Return a checksum for a chunk of memory, computed in hardware
+ * using 8 byte steps.
+ */
+static uint32_t
+__wt_cksum_hw(const void *chunk, size_t len)
+{
+ return crc32_vpmsum(0, chunk, len);
+}
+#endif
+
/*
* __wt_cksum --
* Return a checksum for a chunk of memory using the fastest method
@@ -1302,6 +1319,8 @@ __wt_cksum_init(void)
__wt_cksum_func = __wt_cksum_hw;
else
__wt_cksum_func = __wt_cksum_sw;
+#elif defined(__powerpc64__)
+ __wt_cksum_func = __wt_cksum_hw;
#else
__wt_cksum_func = __wt_cksum_sw;
#endif