There are two development articles metioned it that GCC can do it:
ntroducing NEON
NEON Support in Compilation Tools
But I tested code snap in these docs with GCC compling options but the generated assembly code
doesn't use any neon instruction.
It should be what you said, but the real compiling result is almost the same.
1) Without the hint of 'len & ~3'
int accumulate(int * __attribute__ ((aligned (16))) c, int len)
{
int i, retval;
for(i=0, retval = 0; i < len; i++) {
retval += c[i];
}
return retval;
Compling output:
accumulate:
.L3:
.L5:
.L29:
.L13:
.L7:
.L2:
.L28:
.L14:
2) With the hint of 'len & ~3'
for(i=0, retval = 0; i < (len & ~3) ; i++) {
Compling result:
The only different is that 'len & ~3' complied into a instruction 'bic r1, r1, #3', nothing else.