Skip to content

perf(avx512f): single vpermt2 for zip_lo/zip_hi#1370

Merged
DiamonDinoia merged 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:avx512-zip-permutex2var
Jul 6, 2026
Merged

perf(avx512f): single vpermt2 for zip_lo/zip_hi#1370
DiamonDinoia merged 1 commit into
xtensor-stack:masterfrom
DiamonDinoia:avx512-zip-permutex2var

Conversation

@DiamonDinoia

Copy link
Copy Markdown
Contributor

The AVX-512 zip_lo/zip_hi lowered the interleave as per-128-bit unpacklo/unpackhi followed by a 3x insertf32x4 / extractf32x4 lane-fixup pile (~7 shuffle-port uops) needed to undo AVX-512's in-lane element ordering. A single 2-source cross-lane permute (vpermt2d/vpermt2q for integral, vpermt2ps/vpermt2pd for float/double) produces the same result in one port-5 uop.

The AVX-512 zip_lo/zip_hi lowered the interleave as per-128-bit
unpacklo/unpackhi followed by a 3x insertf32x4 / extractf32x4 lane-fixup
pile (~7 shuffle-port uops) needed to undo AVX-512's in-lane element
ordering. A single 2-source cross-lane permute (vpermt2d/vpermt2q for
integral, vpermt2ps/vpermt2pd for float/double) produces the same result
in one port-5 uop.
@DiamonDinoia DiamonDinoia mentioned this pull request Jul 6, 2026
6 tasks
@serge-sans-paille

Copy link
Copy Markdown
Contributor

This is much better. Thanks for looking at this.

@DiamonDinoia DiamonDinoia merged commit 8b12d38 into xtensor-stack:master Jul 6, 2026
89 checks passed
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