I want to help GCC generating vectorized neon code for my calculations that works on a lot of structs. (All the same, just a lot of them).
Currently the code look like that :
Code: Select all
struct thing{ int a, b;}obj[4];
obj[0].a += obj[0].b;
obj[1].a += obj[1].b;
obj[2].a += obj[2].b;
obj[3].a += obj[3].b;
Code: Select all
int objA[4];
int objB[4];
obA[0] += obB[0];
obA[1] += obB[1];
obA[2] += obB[2];
obA[3] += obB[3];
...
In my program sizeof(obj) is about 70 bytes so each a, b... values aren't close in memory.