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 <behlendorf1@llnl.gov>
Signed-off-by: Romain Dolbeau <romain.dolbeau@atos.net>
Closes #5317
This commit is contained in:
Romain Dolbeau
2016-11-04 18:53:03 +01:00
committed by Brian Behlendorf
parent ace1eae84c
commit 7f3194932d
8 changed files with 405 additions and 2 deletions
+7
View File
@@ -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;