I'd like all wasm_memory_t allocations to be 16 byte aligned so SIMD operation thingies can work as they would in straight native code.
Therefore please perform allocations using :
auto my_aligned_buffer = _aligned_malloc(num_bytes, 16);
.. or provide a mechansism so I can request this if you don't want all buffers allocating like this for some reason.
If that's already in, great :)
Don't suppose anyone has any insight into how easy or otherwise it'll be to modify the wasm_memory_t allocations from whatever you're currently doing to aligned_alloc. I don't know much rust. Looked up memory allocation & there's no aligned equivalent as far as I could see. So it'd have to be a C unsafe block ? This is required for performance as otherwise, every operation, you have to copy from where a vector or matrix is into a known aligned block.
As a follow on, it'd be nice to be able to perform simd math ops trusted side to keep frequency of interop to the minimum. Have no idea if wasm machine has simd vector/matrix math op concepts at this point. This would mean adding vector2,3,4 and matrix23, matrix34 and matrix44 basic types (scalars being floats for our requirements).
then built in basic vector & matrix ops so we can cranelift simd instructions in where the hardware supports it.
ahhh :)
going beyond that, its conceptually safe to perform more complex parallel ops from untrusted side on the gpu. I don't currently have a requirement for that but its good to think ahead. there's a hit every time you upload to the gpu then download the result, so its not always performant, but it does have its uses. for the time being it'd be good to get simd parity with v8.
Last updated: Dec 23 2024 at 13:07 UTC