In my C code I have
complex float M[n][n];
complex float *delta = malloc(n * sizeof *delta);
complex float *v = malloc(n * sizeof *v);
for (i = 0; i < n; i++) {
v[i] -= 2.*delta[j]*M[j][i];
}
where i
and n
are ints.
It was suggested I use __builtin_assume_aligned
to make sure these are aligned in order to help auto-vectorization. However, having looked at the docs I don't understand how to do that.
How would you use it for this code?
The code in this question is extracted from How to help gcc vectorize C code . This is also why I want to try to align things.
M
,delta
andv
before you use them? – Andy