Skip to content

Merge simd vector traits - #197

Draft
ejmahler wants to merge 9 commits into
masterfrom
merge-simd-vector-traits
Draft

ejmahler wants to merge 9 commits into
masterfrom
merge-simd-vector-traits

Conversation

@ejmahler

@ejmahler ejmahler commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #188

SseNum, NeonNum, etc are gone. SseVector, NeonVector, etc have been merged into SimdVector, so now it's just the one trait (with one minor exception).

SSE and Neon went smoothly. When I converted wasm simd and fcma, I found that they bounced too freely between the wrapped types and the bare metal types, and it made it difficult to apply simple find and replace type operations. I ended up converting them both to use the wrapper in all places. That was quite painful, but hopefully it will pay off in the form of reduced tech debt.

I also eliminated the per-architecture array traits, and replaced them with a generic trait called SimdComplexArray and SimdComplexArrayMut. I redid some of the naming conventions while I was in here, mainly to reduce wordiness of common operations.

I ended up keeping the FcmaVector trait, but it only has the rotate_and_add etc methods that are unique to fcma. There's one more thing to resolve here, which is that I put unimplemented!() on the fcma apply_rotate90 and nmadd methods. They're only used by butterflies and will never be used by generic code, so I'm questioning whether they belong in the SimdVector trait at all. In the case of fcma, the reason i paid attention to it is because if you call apply_rotate90 you're probably leaving performance on the table and should probably be calling something that leads to fcma instructions and applying the rotations that way.

It would be fine to just check it in how it is as a little tech debt thing, but I'll sleep on it and see if I come up with a decision for how to handle it.

@ejmahler

Copy link
Copy Markdown
Owner Author

One more thing that could be done here: We have macros in each of the architectures to make it easier for the butterflies to load big chunks of data, with different strides etc, and they're all identical, so they could be combined too.

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.

Consolidate the per-backend vector traits into SimdVector

1 participant