Comment

Comment by exDM69

> I wonder how much easier/better the code would have been to write with portable_simd ..

I had a quick glance of the code and it seems to use mostly basic arithmetic instructions on fixed width simd vectors using some helper macros like SIMD_MUL(x, y) for _mm_mul_ps, etc. Some explicit simd intrinsics code for stuff like sin.

That would've been pretty easy to write with portable_simd in Rust or the equivalent C/C++ language extensions (or maybe C++26 std::simd).

You'd just use f32x4 (or add a typedef with attribute in C++) and then use x*y instead of SIMD_MUL.

For basic stuff like this, you should get the exact same generated code.

https://clang.llvm.org/docs/LanguageExtensions.html#vectors-...

parent exDM69 2 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton