Re: [PATCH 4/5]AArch64 sve: optimize add reduction patterns

2021-10-14 Thread Richard Sandiford via Gcc-patches
Tamar Christina writes: > Hi All, > > The following loop does a conditional reduction using an add: > > #include > > int32_t f (int32_t *restrict array, int len, int min) > { > int32_t iSum = 0; > > for (int i=0; i if (array[i] >= min) >iSum += array[i]; > } > return iSum; > }

[PATCH 4/5]AArch64 sve: optimize add reduction patterns

2021-08-31 Thread Tamar Christina via Gcc-patches
Hi All, The following loop does a conditional reduction using an add: #include int32_t f (int32_t *restrict array, int len, int min) { int32_t iSum = 0; for (int i=0; i= min) iSum += array[i]; } return iSum; } for this we currently generate: mov z1.b, #0 mo