[Crypto] enable ADX support by default #4405
Merged
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.
BLST library uses ADX instructions to speed up computations. It implements software versions with and without ADX instructions. It uses the ADX version by default, but provides a CGO flag to use the non-ADX version when compiled by Go.
Using the flag is necessary for machines without ADX support.
So far the crypto lib was using the CGO flag by default to disable ADX. This PR switches the default to use ADX to benefit from the performance speed up. In order for tests and builds to work with older machines (without ADX), all makefiles have been updated to detect ADX support and add the CGO flag accordingly.