logoalt Hacker News

nukanse • today at 4:22 AM • 3 replies • view on HN

C++ should focus into turning SIMD into a higher level language instead of being a giant collection of intrinsics. Avx code is unreadable.


Replies

jfultz • today at 6:20 AM

In fact, C++26 made some considerable progress on that front.

https://en.cppreference.com/cpp/experimental/simd

An implementation of which exists in the following GitHub repo (albeit implemented in the xvec::simd namespace rather than std::simd...but otherwise intended to be spec-compliant).

https://github.com/intel/xvec

Speaking as a long-time C++ developer...I wasn't uninterested in contracts (which I've known about since the days of Bertrand Meyer flogging them in Eiffel), but I agree with the sentiment here that the SIMD efforts were considerably more interesting.

jandrewrogers • today at 4:33 AM

SIMD cannot be solved at the compiler level. The capabilities of silicon SIMD implementations are fundamentally so disjoint that code using SIMD requires contextual and platform-specific data structures and algorithms.

SIMD on different silicon is incompatible at layers of abstraction far above the codegen manipulation a compiler can do.

➕ show 3 replies
nurettin • today at 5:21 AM

There are frameworks trying to unify simd/avx, but the abstractions aren't free. At this point, we need better hardware and low level interfaces, not better abstractions.