Skip to content

Commit

Permalink
Fix AVX512BW Fletcher code on AVX512-but-not-BW machines
Browse files Browse the repository at this point in the history
Introduce a specific valid function for avx512f+avx512bw (instead 
of checking only for avx512f).

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Adam Moss <c@yotes.com>
Signed-off-by: Romain Dolbeau <romain@dolbeau.org>
Closes openzfs#11937
Closes openzfs#11938
  • Loading branch information
rdolbeau authored and Ryan Moeller committed May 10, 2021
1 parent 9c52267 commit 0b8ca92
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion module/zcommon/zfs_fletcher_avx512.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,20 @@ fletcher_4_avx512bw_byteswap(fletcher_4_ctx_t *ctx, const void *buf,
}
STACK_FRAME_NON_STANDARD(fletcher_4_avx512bw_byteswap);

static boolean_t
fletcher_4_avx512bw_valid(void)
{
return (fletcher_4_avx512f_valid() && zfs_avx512bw_available());
}

const fletcher_4_ops_t fletcher_4_avx512bw_ops = {
.init_native = fletcher_4_avx512f_init,
.fini_native = fletcher_4_avx512f_fini,
.compute_native = fletcher_4_avx512f_native,
.init_byteswap = fletcher_4_avx512f_init,
.fini_byteswap = fletcher_4_avx512f_fini,
.compute_byteswap = fletcher_4_avx512bw_byteswap,
.valid = fletcher_4_avx512f_valid,
.valid = fletcher_4_avx512bw_valid,
.name = "avx512bw"
};
#endif
Expand Down

0 comments on commit 0b8ca92

Please sign in to comment.