-
Notifications
You must be signed in to change notification settings - Fork 140
Move dynamic dispatching to C for x86_64-mont5.pl #2592
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2592 +/- ##
==========================================
+ Coverage 78.72% 78.74% +0.01%
==========================================
Files 645 646 +1
Lines 111086 111270 +184
Branches 15690 15708 +18
==========================================
+ Hits 87453 87615 +162
- Misses 22941 22960 +19
- Partials 692 695 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Need to add dispatch tests: aws-lc/crypto/impl_dispatch_test.cc Line 4 in 5afd19a
|
@@ -140,6 +140,11 @@ class ImplDispatchTest : public ::testing::Test { | |||
bool is_assembler_too_old = false; | |||
bool is_assembler_too_old_avx512 = false; | |||
bool ifma_avx512 = false; | |||
bool is_bn_mulx4x_mont_gather5 = false; |
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.
I'm not sure that we need these five values defined here, we only define capabilities here?
|
||
bn_mul_mont(r.data(), a.data(), b.data(), mont->N.d, mont->n0, words); | ||
|
||
is_bn_mulx4x_mont_gather5 = bn_mulx4x_mont_gather5_capable(words); |
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.
if you use the same function bn_mulx4x_mont_gather5_capable
for the test and the actual implementation then this test doesn't make much sense, it will always pass. The idea of dispatch tests is to determine if a specific combination of CPU capabilities (like ADX, BMI, BMI2, etc.) triggers the expected code path.
BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *table, const BN_ULONG *np, | ||
const BN_ULONG *n0, int num, int power) { | ||
if (bn_mulx4x_mont_gather5_capable(num)) { | ||
keccak_log_dispatch(15); |
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.
can we please re-define keccak_log_dispatch
to a generic log_dispatch function?
Issues:
Resolves P280855694
Addresses CryptoAlg-2964
Description of changes:
Move dynamic dispatching from assembly to C.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.