I compiled this code, but it does not use SIMD. Shouldn't it just load a,b,c,d and w,x,y,z into two registers and then add them. It does work when I am using arrays instead.
void sum4rest(int *restrict a, int *restrict w,
int *restrict b, int *restrict x,
int *restrict c, int *restrict y,
int *restrict d, int *restrict z) {
*a = *a + *w;
*b = *b + *x;
*c = *c + *y;
*d = *d + *z;
}
The assembly is the following.
0000000000000058 <_sum4rest>:
ldr w8, [x0]
ldr w9, [x1]
add w8, w9, w8
str w8, [x0]
ldr w8, [x2]
ldr w9, [x3]
add w8, w9, w8
str w8, [x2]
ldr w8, [x4]
ldr w9, [x5]
add w8, w9, w8
str w8, [x4]
ldr w8, [x6]
ldr w9, [x7]
add w8, w9, w8
str w8, [x6]
ret