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

aes: refactor NI backend #225

Merged
merged 2 commits into from
Feb 7, 2021
Merged

aes: refactor NI backend #225

merged 2 commits into from
Feb 7, 2021

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Feb 7, 2021

  • Uses array operations on the block buffer
  • Uses loops where they don't appear to impact performance

- Uses array operations on the block buffer
- Uses loops where they don't appear to impact performance
@tarcieri
Copy link
Member Author

tarcieri commented Feb 7, 2021

Note: I haven't systematically determined this doesn't change the generated assembly. Preliminary benchmarking shows negligible impact.

Comment on lines +3 to +4
// TODO(tarcieri): check performance impact / generated assembly changes
#![allow(clippy::needless_range_loop)]
Copy link
Member Author

Choose a reason for hiding this comment

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

Strangely clippy's suggested refactoring seemed to negatively impact performance?(!)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I've seen such behavior as well. Iterator based code probably makes it harder for LLVM to unroll the loops. Also subjectively, I think for such loops range loops result in a better, easier to understand code.

@tarcieri tarcieri merged commit c8fa3a4 into master Feb 7, 2021
@tarcieri tarcieri deleted the aes/ni-refactoring branch February 7, 2021 22:38
@tarcieri tarcieri mentioned this pull request Apr 29, 2021
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.

None yet

2 participants