Skip to content
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

Add word3 type and take advantage of Clang's _BitInt extension #3989

Merged
merged 6 commits into from
Apr 9, 2024

Conversation

randombit
Copy link
Owner

@randombit randombit commented Apr 9, 2024

Clang generates much better code with _BitInt than otherwise. This improves performance with Clang by ~5% for ECDSA/ECDH and 10-20% improvement for FFDHE depending on sizes. Unfortunately until Clang 16 the maximum _BitInt size was 128 bits, so it is only useful with newer Clang.

@randombit
Copy link
Owner Author

@reneme Don't know if you want to review this one or not. Diff is huge but it's 99% generated code

@coveralls
Copy link

coveralls commented Apr 9, 2024

Coverage Status

coverage: 92.025% (-0.07%) from 92.09%
when pulling 10f8145 on jack/word3-type
into afd43c5 on master.

Copy link
Collaborator

@reneme reneme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_BitInt()! That's fantastic. 👀

src/lib/math/mp/mp_asmi.h Outdated Show resolved Hide resolved
Merge the declaration of the type in the two preprocessor blocks
@randombit randombit merged commit 0d32f98 into master Apr 9, 2024
43 checks passed
@randombit randombit deleted the jack/word3-type branch April 9, 2024 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants