On Wed, Apr 12, 2023 at 2:11 PM Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org> wrote:what is it exactly you are mainly after?
a) To express vector operations with implicit fallback to a loop
b) To have a nice way to express SIMD code with simple mathematical operations
c) To create better interoperation between C-style arrays and SIMD code?
Or strictly a combination of those?
It's mainly b) and c). My primary issue was that I thought templates and classes are overkill for something that is just a CPU instruction. However, everyone has brought up a ton of great issues so I don't think this idea would work anymore. But just as a brainstorm, what about a class that operates on an array like this:alignas(float) float a[4] = {0.0f, 1.0f, 2.0f, 3.0f};std::simd4 a_simd = std::simd4(&a);a_simd += 0.1f; // Adds 0.1 to all elements of "a"This way arrays can be operated on without breaking compatibility. Does this sound like a better idea?