Add missing vzeroupper to memset-avx2#8171
Open
octmoraru wants to merge 1 commit into
Open
Conversation
This diff ensures vzerouppper is executed when memset count is >64 and <128 bytes. The guidance from Intel is to use vzeroupper when transitioning from AVX to SSE code in order to avoid transition penalties: "When the upper 128 bits of the YMM registers are set to zero by the vzeroupper instruction, the hardware does not need to save those values, so the hardware assists do not occur. The vzeroupper instruction must be used after 256-bit Intel AVX code and before Intel SSE code, which will remove both the save and the restore operations. Zeroing out the YMM registers with other methods, such as with XORs, will not prevent AVX-SSE transition penalties." https://software.intel.com/en-us/articles/avoiding-avx-sse-transition-penalties No expensive transitions were detected when using the Intel SDE AVX/SSE transition checker.
hhvm-bot
reviewed
May 22, 2018
hhvm-bot
left a comment
Contributor
There was a problem hiding this comment.
@fredemmott has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
ammarfaizi2
approved these changes
Nov 30, 2018
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.
This diff ensures vzerouppper is executed when memset count
is >64 and <128 bytes.
The guidance from Intel is to use vzeroupper when transitioning from
AVX to SSE code in order to avoid transition penalties:
"When the upper 128 bits of the YMM registers are set to zero by the
vzeroupper instruction, the hardware does not need to save those values,
so the hardware assists do not occur. The vzeroupper instruction must be
used after 256-bit Intel AVX code and before Intel SSE code, which will
remove both the save and the restore operations. Zeroing out the YMM
registers with other methods, such as with XORs, will not prevent
AVX-SSE transition penalties."
https://software.intel.com/en-us/articles/avoiding-avx-sse-transition-penalties
No expensive transitions were detected when using the Intel SDE AVX/SSE
transition checker.