aboutsummaryrefslogtreecommitdiffstats
path: root/include/zfs_fletcher.h
diff options
context:
space:
mode:
authorRomain Dolbeau <[email protected]>2016-11-04 18:53:03 +0100
committerBrian Behlendorf <[email protected]>2016-11-04 10:53:03 -0700
commit7f3194932d22c667026aff1b263ceaa1ebd012ee (patch)
treeb68eee7abd34de2410db38208c35c184af2ddd70 /include/zfs_fletcher.h
parentace1eae84cca8579596f46262d99df19f6d7e963 (diff)
Add superscalar fletcher4
This is the Fletcher4 algorithm implemented in pure C, but using multiple counters using algorithms identical to those used for SSE/NEON and AVX2. This allows for faster execution on core with strong superscalar capabilities but weak SIMD capabilities. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Romain Dolbeau <[email protected]> Closes #5317
Diffstat (limited to 'include/zfs_fletcher.h')
-rw-r--r--include/zfs_fletcher.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/zfs_fletcher.h b/include/zfs_fletcher.h
index 1f113ae2f..633606d14 100644
--- a/include/zfs_fletcher.h
+++ b/include/zfs_fletcher.h
@@ -65,6 +65,10 @@ void fletcher_4_fini(void);
/* Internal fletcher ctx */
+typedef struct zfs_fletcher_superscalar {
+ uint64_t v[4];
+} zfs_fletcher_superscalar_t;
+
typedef struct zfs_fletcher_sse {
uint64_t v[2] __attribute__((aligned(16)));
} zfs_fletcher_sse_t;
@@ -84,6 +88,7 @@ typedef struct zfs_fletcher_aarch64_neon {
typedef union fletcher_4_ctx {
zio_cksum_t scalar;
+ zfs_fletcher_superscalar_t superscalar[4];
#if defined(HAVE_SSE2) || (defined(HAVE_SSE2) && defined(HAVE_SSSE3))
zfs_fletcher_sse_t sse[4];
@@ -118,6 +123,8 @@ typedef struct fletcher_4_func {
const char *name;
} fletcher_4_ops_t;
+extern const fletcher_4_ops_t fletcher_4_superscalar_ops;
+extern const fletcher_4_ops_t fletcher_4_superscalar4_ops;
#if defined(HAVE_SSE2)
extern const fletcher_4_ops_t fletcher_4_sse2_ops;