crc: add AVX+PCLMUL for crc32_iscsi on Hygon CPU#406
Closed
MaodiMa wants to merge 1 commit into
Closed
Conversation
pablodelara
reviewed
Apr 28, 2026
|
|
||
|
|
||
| mbin_interface crc32_iscsi | ||
| mbin_dispatch_init_clmul crc32_iscsi, crc32_iscsi_base, crc32_iscsi_01, crc32_iscsi_01, crc32_iscsi_avx2, crc32_iscsi_by16_10 |
Contributor
There was a problem hiding this comment.
No need to do this. It's OK for Intel processors to use crc32_iscsi_by8_02 for systems without AVX2+VPCLMUL ISA. So you can just restore the by8_02 implementation and plug it in mbin_dispatch_init_clmul
Contributor
Author
There was a problem hiding this comment.
Done. I just did some tests. It seems that AVX+PCLMUL also works well on Intel CPUs.
I added this because we do perf test when AVX+PCLMUL implementation first added into ISA-L in commit 0ed6660. And we found CRC32 works better than AVX+PCLMUL on Intel CPUs. This gap seems to be covered by later added prefetch in AVX+PCLMUL now.
8cf7758 to
4545baa
Compare
Contributor
|
Thanks for the PR. You need to also add the file in Makefile.nmake and cmake/crc.make. Thanks! |
Signed-off-by: Maodi Ma <mamaodi@hygon.cn>
4545baa to
e99a150
Compare
Contributor
|
This is now merged, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Hygon CPUs, AVX+PCLMUL implementation shows better performance than CRC32. Select it based on CPUID vendor check.
crc32_iscsi_by8_02.asmis adapted from v2.32.0 and updated to match the current code style.Performance improvement on Hygon 7490:
This commit does no affet on other platforms, such as Intel or AMD.