I have manged to convert most of my SIMD code to us the vector extensions of GCC. However, I have not found a good solution for doing a broadcast as follows
__m256 areg0 = _mm256_broadcast_ss(&a[i]);
I want to do
__m256 argeg0 = a[i];
If you see my answer at Mutiplying vector by constant using SSE I managed to get broadcasts working with another SIMD register. The following works:
__m256 x,y;
y = x + 3.14159f; // broadcast x + 3.14159
y = 3.14159f*x; // broadcast 3.14159*x
but this won't work:
__m256 x;
x = 3.14159f; //should broadcast 3.14159 but does not work
How can I do this with GCC?
typedef float float4 __attribute__((ext_vector_type(8)));
. However, Clang does not allow the broadcasts with a register using the GCC vector extensions so I'm not sure it is entirely compatible with GCC. – Z boson__m256 zero={}; __m256 x=zero+3.14159f;
– Marc Glisse