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.

63 Upvotes

33 comments sorted by

View all comments

Show parent comment

4

u/Expert-Map-1126 vcpkg maintainer BillyONeal Jun 13 '26

I know MSVC has __isa_available which is absolutely used to dispatch to different implementations of bits. Sure, that costs 1 branch that the JIT could hypothetically emit but it's an ice cold branch out of the loop which is pretty cheap.

1

u/ack_error Jun 13 '26

Yeah, that's specifically the case I was thinking of. MSVC will automatically generate speculative SSE4.1 autovectorized paths with a fallback to SSE2. Pretty sure the old Intel compiler used to have an option to do this for SSE2 vs. scalar as well.