Skip to content

Implement _mm512_permutex2var_epi64 shim#4963

Open
elichai wants to merge 1 commit intorust-lang:masterfrom
elichai:elichai/_mm512_permutex2var_epi64
Open

Implement _mm512_permutex2var_epi64 shim#4963
elichai wants to merge 1 commit intorust-lang:masterfrom
elichai:elichai/_mm512_permutex2var_epi64

Conversation

@elichai
Copy link
Copy Markdown
Contributor

@elichai elichai commented Apr 14, 2026

This implements the _mm512_permutex2var_epi64 intrinsic, which is vpermi2var.q.512, which permutes 64-bit elements from two input vectors according to an index vector, producing a destination vector.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 14, 2026

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Apr 14, 2026
@elichai elichai force-pushed the elichai/_mm512_permutex2var_epi64 branch 2 times, most recently from a01832a to 367df17 Compare April 15, 2026 13:04
@elichai
Copy link
Copy Markdown
Contributor Author

elichai commented Apr 15, 2026

Improved the test code, and I've ran it on a real x86-64 machine(AMD EPYC 9B45) with AVX512:
rustc ./tests/pass/shims/x86/intrinsics-x86-avx512.rs -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512bitalg,+avx512vpopcntdq,+avx512vnni -o avx512-test && ./avx512-test

@elichai
Copy link
Copy Markdown
Contributor Author

elichai commented Apr 15, 2026

I also have an implementation of _mm512_permutex2var_epi8 built on top of this permute2 function, should I add it here in a separate commit or open a new PR after this merges?
Thanks!

@RalfJung
Copy link
Copy Markdown
Member

Please slow down a little, my review queue is already overloaded. :)

@elichai
Copy link
Copy Markdown
Contributor Author

elichai commented Apr 15, 2026

Please slow down a little, my review queue is already overloaded. :)

Hehe yeah I'm sorry, don't worry, I only needed these 3 intrinsics to run my code with miri :)
It's very cool that miri supports so many shims <3

@rustbot

This comment has been minimized.

@elichai elichai force-pushed the elichai/_mm512_permutex2var_epi64 branch from 367df17 to 045adf1 Compare April 26, 2026 08:58
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 26, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Comment thread src/shims/x86/mod.rs
Comment thread src/shims/x86/mod.rs
/// and store the results in `dest`.
///
/// For each lane, the lower `log2(N)` bits select a lane within the chosen input vector,
/// where `N` is the vector length. The next bit selects between `left` and `right`.
Copy link
Copy Markdown
Member

@RalfJung RalfJung Apr 26, 2026

Choose a reason for hiding this comment

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

And the remaining bits? Are they ignored?

View changes since the review

Copy link
Copy Markdown
Contributor Author

@elichai elichai Apr 26, 2026

Choose a reason for hiding this comment

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

Comment thread src/shims/x86/mod.rs Outdated
Comment thread src/shims/x86/avx512.rs
@RalfJung
Copy link
Copy Markdown
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Apr 26, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 26, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@elichai elichai force-pushed the elichai/_mm512_permutex2var_epi64 branch from 045adf1 to 67616a5 Compare April 26, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: Waiting for the PR author to address review comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants