I would like to enable NEON vectorization on my ARM cortex-a9, but I get this output at compile:
"not vectorized: relevant stmt not supported: D.14140_82 = D.14143_77 * D.14141_81"
Here is my loop:
void my_mul(float32_t * __restrict data1, float32_t * __restrict data2, float32_t * __restrict out){
for(int i=0; i<SIZE*4; i+=1){
out[i] = data1[i]*data2[i];
}
}
And the options used at compile:
-march=armv7-a -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp -ftree-vectorize -mvectorize-with-neon-quad -ftree-vectorizer-verbose=2
I am using arm-linux-gnueabi (v4.6 ) compiler.
It is important to note that the problem only appears with float32 vectors. If I switch in int32, then the vectorization is done. Maybe the vectorization for float32 is not yet available…
Does anyone has an idea ? Do I forget something in the cmd line or in my implementation ?
Thanks in advance for your help.
Guix
From GCC's ARM options page
If you specify
-funsafe-math-optimizations
it should work, but reread the note above if you are going to use this with high precision.