Reintroduce ext
-based implementations for shift intrinsics
#543
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.
Use the vector extract instruction (ext) to implement
_mm_srli_si128
,_mm_slli_si128
and_mm_alignr_epi8
, significantly improving performanceby avoiding memory.
These were originally changed in #483 and #484 to instead use a store
followed by a shifted load. This was done in order to resolve issue
#482, where the compiler would throw an error if there were an invalid
immediate in the intrinsic arguments after the macros are expanded.
These commits avoid the recurrence of this issue by guarding the
immediate arguments with additional (redundant) ternary expressions.
These are evaluated at compile time and should cause no performance
loss; they only prevent the compilers from attempting to propagate
invalid immediates. This does now require that the immediate argument
to these intrinsics be a compile-time constant expression, but this
matches the requirement imposed by the original SSE intrinsics.
Sample codegen diffs are included in the individual commit messages.