I played around with the gcc vector extension. Among other things, you can for example calculate vector + vector, vector + scalar, or scalar + vector. The scalar is converted to a vector with all identical elements.
But I cannot find a way to set a vector directly to all identical values. If x is a vector with defined value and n a scalar, i could calculate (x ^ x) + n, which seems to generate optimal code, but I have to fill the vector x with some data first or get a warning. (x * 0) + n is the same.
Question: Is there a way to set a SIMD vector to identical items directly without any strange workarounds and without having to repeat values?