diff options
author | Attila Fülöp <[email protected]> | 2023-03-14 17:45:28 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-03-14 09:45:28 -0700 |
commit | 78289b84589e632d87504df6a9c63b5ac694d2f9 (patch) | |
tree | 92c27ba84107a5fc63c83be70dfe11e6ec4e278b /module/zcommon/zfs_fletcher_aarch64_neon.c | |
parent | b15ab50c4d61729ae831ea76968b9fa4867d61cf (diff) |
zcommon: Refactor FPU state handling in fletcher4
Currently calls to kfpu_begin() and kfpu_end() are split between
the init() and fini() functions of the particular SIMD
implementation. This was done in #14247 as an optimization measure
for the ABD adapter. Unfortunately the split complicates FPU
handling on platforms that use a local FPU state buffer, like
Windows and macOS.
To ease porting, we introduce a boolean struct member in
fletcher_4_ops_t, indicating use of the FPU, and move the FPU state
handling from the SIMD implementations to the call sites.
Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Richard Yao <[email protected]>
Reviewed-by: Jorgen Lundman <[email protected]>
Signed-off-by: Attila Fülöp <[email protected]>
Closes #14600
Diffstat (limited to 'module/zcommon/zfs_fletcher_aarch64_neon.c')
-rw-r--r-- | module/zcommon/zfs_fletcher_aarch64_neon.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/module/zcommon/zfs_fletcher_aarch64_neon.c b/module/zcommon/zfs_fletcher_aarch64_neon.c index 8f0339728..cd5fe545a 100644 --- a/module/zcommon/zfs_fletcher_aarch64_neon.c +++ b/module/zcommon/zfs_fletcher_aarch64_neon.c @@ -52,7 +52,6 @@ ZFS_NO_SANITIZE_UNDEFINED static void fletcher_4_aarch64_neon_init(fletcher_4_ctx_t *ctx) { - kfpu_begin(); memset(ctx->aarch64_neon, 0, 4 * sizeof (zfs_fletcher_aarch64_neon_t)); } @@ -70,7 +69,6 @@ fletcher_4_aarch64_neon_fini(fletcher_4_ctx_t *ctx, zio_cksum_t *zcp) 8 * ctx->aarch64_neon[3].v[1] - 8 * ctx->aarch64_neon[2].v[1] + ctx->aarch64_neon[1].v[1]; ZIO_SET_CHECKSUM(zcp, A, B, C, D); - kfpu_end(); } #define NEON_INIT_LOOP() \ @@ -205,6 +203,7 @@ const fletcher_4_ops_t fletcher_4_aarch64_neon_ops = { .compute_byteswap = fletcher_4_aarch64_neon_byteswap, .fini_byteswap = fletcher_4_aarch64_neon_fini, .valid = fletcher_4_aarch64_neon_valid, + .uses_fpu = B_TRUE, .name = "aarch64_neon" }; |