Skip to content

feat: add permute_i8_m256i / permute_i8_m512i (vpermb) wrappers#126

Merged
Lokathor merged 2 commits into
Lokathor:mainfrom
nh13:nh/vpermb-wrappers
Jul 13, 2026
Merged

feat: add permute_i8_m256i / permute_i8_m512i (vpermb) wrappers#126
Lokathor merged 2 commits into
Lokathor:mainfrom
nh13:nh/vpermb-wrappers

Conversation

@nh13

@nh13 nh13 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Adds safe wrappers for the vpermb byte-lane variable-permute intrinsics:

  • permute_i8_m256i(idx, a)_mm256_permutexvar_epi8 (gated avx512vbmi + avx512vl)
  • permute_i8_m512i(idx, a)_mm512_permutexvar_epi8 (gated avx512vbmi)

Naming and the (idx, a) argument order follow the neighbouring permute_i32_m512i / permute_i64_m512i wrappers. Each has a doctest, and +avx512vbmi is added to the AVX-512 CI RUSTFLAGS/RUSTDOCFLAGS so they run under Intel SDE (Sapphire Rapids implements VBMI). Verified passing on native VBMI hardware.

Motivation: lets downstream crates (e.g. wide) lower a full-width byte shuffle to a single vpermb without a raw intrinsic.

@Lokathor Lokathor merged commit 569b2dc into Lokathor:main Jul 13, 2026
12 checks passed
@nh13 nh13 deleted the nh/vpermb-wrappers branch July 14, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants