-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize crc32 & crc32c on NVIDIA Grace #2204
base: main
Are you sure you want to change the base?
Conversation
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
folly/hash/Checksum.cpp
Outdated
@@ -77,6 +77,10 @@ uint32_t crc32_hw( | |||
} | |||
|
|||
bool crc32c_hw_supported() { | |||
return crc32_hw_supported_sse42(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has a typo, missing the c
after crc32.
Correct name should be crc32c_hw_supported_sse42
@@ -105,7 +111,35 @@ static uint32_t gf_multiply_crc32_hw(uint64_t crc1, uint64_t crc2, uint32_t) { | |||
return _mm_cvtsi128_si32(_mm_srli_si128(_mm_xor_si128(res3, res1), 4)); | |||
} | |||
|
|||
#else | |||
#elif FOLLY_NEON && FOLLY_ARM_FEATURE_CRC32 && FOLLY_ARM_FEATURE_AES && FOLLY_ARM_FEATURE_SHA2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is too long.
Can you resubmit after a clang-format?
Sorry, we should have this automated as part of a git hook or something, not sure why we don't have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. Can I suggest to add clang-format to https://github.com/facebook/folly/blob/main/CONTRIBUTING.md?
- Fix typo - Clang format all changed files
Thanks for the review! I forgot to add that this should be compiled with the flags |
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request adds hardware accelerated routines for CRC32 and CRC32C for Arm AARCH64 CPUs. The changes here have been tested on NVIDIA Grace.
In detail, it contains routines for:
gf_multiply_crc32c_hw
andgf_multiply_crc32_hw
functions used in routines to merge partial CRC checksums. These functions are more or less a 1:1 translation of the x86 vectorized routines.This should resolve issue #2027.