-
Notifications
You must be signed in to change notification settings - Fork 285
Add AArch64 sha1 and sha2 extensions support #96
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
Closed
Closed
Conversation
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
gcc 0.3 -> cc 1.0
Here are some benchmarks on my Nintendo Switch: Without this patch (or without `--features=asm`): ``` test bench1_10 ... bench: 66 ns/iter (+/- 0) = 151 MB/s test bench2_100 ... bench: 497 ns/iter (+/- 1) = 201 MB/s test bench3_1000 ... bench: 4,799 ns/iter (+/- 16) = 208 MB/s test bench4_10000 ... bench: 47,646 ns/iter (+/- 134) = 209 MB/s ``` With this patch: ``` test bench1_10 ... bench: 32 ns/iter (+/- 1) = 312 MB/s test bench2_100 ... bench: 165 ns/iter (+/- 1) = 606 MB/s test bench3_1000 ... bench: 1,480 ns/iter (+/- 5) = 675 MB/s test bench4_10000 ... bench: 14,246 ns/iter (+/- 26) = 701 MB/s ``` There are probably scheduling fixes to be made, I haven’t paid any attention to latency.
Here are some benchmarks on my Nintendo Switch: Without this patch (or without `--features=asm`): ``` test bench1_10 ... bench: 98 ns/iter (+/- 0) = 102 MB/s test bench2_100 ... bench: 815 ns/iter (+/- 4) = 122 MB/s test bench3_1000 ... bench: 7,980 ns/iter (+/- 76) = 125 MB/s test bench4_10000 ... bench: 79,373 ns/iter (+/- 793) = 125 MB/s ``` With this patch: ``` test bench1_10 ... bench: 30 ns/iter (+/- 0) = 333 MB/s test bench2_100 ... bench: 167 ns/iter (+/- 0) = 598 MB/s test bench3_1000 ... bench: 1,554 ns/iter (+/- 7) = 643 MB/s test bench4_10000 ... bench: 15,231 ns/iter (+/- 88) = 656 MB/s ``` Only the SHA-256 function is implemented, my console doesn’t support the sha512 extension.
Add AArch64 sha1 and sha2 extension support
It isn’t implemented yet.
Agreed, IMO |
In the AArch64 ABI, v8-v15 are callee-saved, but only their lower 64 bits, which means we were inadvertantly overwriting part of their values. This patch entirely removes the usage of these registers, we have plenty of them to work with!
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.
Enables RustCrypto/asm-hashes#10
getauxval()
is extremely cheap, as it is just a pointer to the beginning of the stack, so it doesn’t make much sense to use alazy_static!()
to remember the flags (at least I can’t see any difference while profiling).