Skip to content

Optimize deinterleave() for AVX2#207

Merged
LaurenzV merged 2 commits intolinebender:mainfrom
Shnatsel:deinterleave-opt-avx2
Apr 22, 2026
Merged

Optimize deinterleave() for AVX2#207
LaurenzV merged 2 commits intolinebender:mainfrom
Shnatsel:deinterleave-opt-avx2

Conversation

@Shnatsel
Copy link
Copy Markdown
Contributor

Follow up to #206

@LaurenzV noted that deinterleaving could be optimized the same way.

Emitting the proper shuffle is more involved than for zip, but it's already implemented in handle_unzip(), so I've simply split it into a helper function and reused it.

This code has good test coverage and all tests pass.

Shnatsel and others added 2 commits April 18, 2026 17:18
Extract unzip256_intermediates helper to share per-input shuffle
computation between unzip_low/unzip_high, then use it in
handle_deinterleave to compute both results without redundant shuffles.
This also deduplicates the two 256-bit arms in handle_unzip.

Co-Authored-By: Claude <noreply@anthropic.com>
@LaurenzV LaurenzV self-requested a review April 21, 2026 14:35
Copy link
Copy Markdown
Collaborator

@LaurenzV LaurenzV left a comment

Choose a reason for hiding this comment

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

Thanks! To be honest I haven't thought this through completely as I'm not super knowledgeable in AVX SIMD, but I trust you and our pretty exhaustive tests all pass so looks good to me!

@LaurenzV LaurenzV added this pull request to the merge queue Apr 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 21, 2026
@LaurenzV LaurenzV added this pull request to the merge queue Apr 22, 2026
Merged via the queue into linebender:main with commit 3a11a8f Apr 22, 2026
22 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