WebAssembly / WebAssembly/binaryen
[Proposal] Optimization for AoS with SIMD
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 8.6k
- Forks
- 885
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 69
Description
Not sure where this should be best done - at the compiler level, at the binaryen level, or at the VM runtime level.
As the GC proposal adds structures and arrays, we technically have the ability to turn AoS into SoA or AoSoA (with fixed SIMD proposal).
Like (pseudocode):
class Vec3 {
f32 x;
f32 y;
f32 z;
};
const vels = Vec3[100];
f32 getVelX(i32 i) {
return vels[i].x;
}
into:
class Vec3 {
f32 x[4];
f32 y[4];
f32 z[4];
};
const vels = Vec3[(100 + 3) / 4];
f32 getVelX(i32 i) {
return vels[i / 4].x[i & 3];
}
And apply SIMD auto-vectorisation afterwards.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file, test, or entry point is identified. Start by determining whether the transformation belongs in the compiler, Binaryen, or VM runtime, then define representative AoS inputs and a SIMD benchmark. Done means a chosen layer, a semantics-preserving AoS-to-SoA or AoSoA transformation, and demonstrated auto-vectorization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100