Skip to content

API improvements to 4-way interleaved load/store - #298

Merged
Shnatsel merged 6 commits into
linebender:mainfrom
Shnatsel:load-interleaved-4-way
Aug 4, 2026
Merged

API improvements to 4-way interleaved load/store#298
Shnatsel merged 6 commits into
linebender:mainfrom
Shnatsel:load-interleaved-4-way

Conversation

@Shnatsel

@Shnatsel Shnatsel commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Change load_interleaved_128 that returns a 512-bit vector to load_four_interleaved that returns four 128-bit vectors.

This maps to the real-world usage better (in Vello, all uses of this function save one go through manual split/combine first), eliminates pointless split/combine in x86 implementations, and most importantly allows us to add wrappers for vld3q later which would perform the same operation for RGB rather than RGBA.

Here's how this change affects vello: linebender/vello#1796

Also supports interleaved load/store for all widths, addressing a part of #297

The implementations are untouched in this PR save for removing redundant split/combine. AVX2 leaves performance on the table because it uses the sse2 unpack tree for most types, but I don't want to write a bespoke implementation for what is just a swizzle. Instead let's merge #276, then I'll add a relaxed version for x86 that doesn't zero out-of-bounds indices (update: that's #304), and then we'll just lower interleaving into that on x86 since it would call literally all the same intrinsics.

…r_interleaved that returns 4 128-bit vectors. This maps to the real-world usage better (in Vello, all uses of this function save one go through manual split/combine first), eliminates pointless split/combine in x86 implementations, and most importantly allows us to add wrappers for vld3q later which would perform the same operation for RGB rather than RGBA.
@Shnatsel Shnatsel changed the title Improvements to 4-way interleaved load/store API improvements to 4-way interleaved load/store Aug 3, 2026

@danderson danderson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks reasonable! I can't comment on Vello's use case obviously, but the linked draft looks like a nice reduction in conversion boilerplate.

@LaurenzV LaurenzV left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looking forward to better AVX2 impls and RGB interleaving!

Comment thread fearless_simd/src/generated/neon.rs Outdated
@Shnatsel
Shnatsel enabled auto-merge August 4, 2026 22:28
@Shnatsel
Shnatsel added this pull request to the merge queue Aug 4, 2026
Merged via the queue into linebender:main with commit 4771bf3 Aug 4, 2026
22 checks passed
@Shnatsel
Shnatsel deleted the load-interleaved-4-way branch August 4, 2026 22:36
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.

3 participants