partly fix Issue 9378 - SHA1 asm not PIC compatible#4994
Merged
MartinNowak merged 1 commit intodlang:stablefrom Dec 24, 2016
Merged
partly fix Issue 9378 - SHA1 asm not PIC compatible#4994MartinNowak merged 1 commit intodlang:stablefrom
MartinNowak merged 1 commit intodlang:stablefrom
Conversation
- access SHA1 constants through extra register in x64 code - tried same for x86 but there is no register left and loading constants via stack was way too slow
Contributor
|
andralex
approved these changes
Dec 24, 2016
| transformSSSE3(state, block); | ||
| } | ||
| else | ||
| transformX86(state, block); |
Member
There was a problem hiding this comment.
shoud we worry that this is not covered?
Member
Author
There was a problem hiding this comment.
It's run as part of the 32-bit shared library test suite (b/c that is still PIC incompatible).
| /* The round constants. */ | ||
| align(16) private immutable uint[16] constants = | ||
| /* The control words for the byte shuffle instruction and the round constants. */ | ||
| align(16) public immutable uint[20] constants = |
Member
Author
There was a problem hiding this comment.
It's passed to the asm function from std.digest.sha, because it's not possible to access globals in PIC code from asm. That's the fix!
Member
|
@MartinNowak ok feel free to merge over codecov's protests |
Member
Author
|
Auto-merge toggled on |
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
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.
loading constants via stack was way too slow
Roughly 10x faster (now also with shared phobos library).
Prerequisite to fix Issue 16794 – .deb not working on Ubuntu 16.10 because of default PIE linking.