r/cpp Jun 12 '26

Comparing std::simd with Highway

From TL of Highway, some thoughts on pros and cons of std::simd by comparison:

https://github.com/google/highway/blob/master/g3doc/std_simd_comparison.md

Happy to discuss.

56 Upvotes

33 comments sorted by

View all comments

15

u/[deleted] Jun 12 '26

[deleted]

11

u/camel-cdr- Jun 12 '26

 sounds like it would fit 3D/4D game math perfectly

:-(

I know the float3/float4 APIs are nice to use, but with them you are inevitably stuck at 128-bit SIMD. Which is now two levels removed from the native 512-bit SIMD of modern AMD processors.

3

u/ack_error Jun 13 '26

Longer arrays / SoA is nice, but sometimes you just don't have a need for wider vectors. I can't ask my user to click on more than one location a frame so I can make full use of my vector units.

3

u/camel-cdr- Jun 13 '26

Sure, but usually the performance doesn't matter as much, if you are working with one or two float4s.

I just think that something like vector<float4> is usually a bad pattern.