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

Clarify vector_algorithms a bit #2377

Merged
merged 2 commits into from
Dec 9, 2021

Conversation

AlexGuteniev
Copy link
Contributor

by defining permutation by the macro instead of magic decimal value
if not this, then maybe let's use hex or binary constant,
but decimal is very obscure

by defining permutation by the macro instead of magic decimal value
if not this, then maybe let's use hex or binary constant,
but decimal is very obscure
@AlexGuteniev AlexGuteniev requested a review from a team as a code owner December 4, 2021 18:06
@CaseyCarter CaseyCarter added the enhancement Something can be improved label Dec 4, 2021
@StephanTLavavej
Copy link
Member

Thanks! For reference, it's xmmintrin.h that says

#define _MM_SHUFFLE(fp3,fp2,fp1,fp0) (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | ((fp0)))

so _MM_SHUFFLE(1, 0, 3, 2) == 78 and _MM_SHUFFLE(0, 1, 2, 3) == 27.

@StephanTLavavej StephanTLavavej self-assigned this Dec 8, 2021
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 1801934 into microsoft:main Dec 9, 2021
@StephanTLavavej
Copy link
Member

Thanks for making this magic somewhat more comprehensible! 🪄 🔮 🧠

@AlexGuteniev AlexGuteniev deleted the come_clarity branch December 9, 2021 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Something can be improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants