There is a big (~100 000) array of floating point variables, and there is a threshold (also floating point).
The problem is that I have to compare each one variable from the array with a threshold, but NEON flags transfer takes a really long time (~20 cycles in accordance to a profiler).
Is there any efficient way to compare these values?
NOTE: As rounding error doesn't matter, I tried the following:
float arr[10000];
float threshold;
....
int a = arr[20]; // e.g.
int t = threshold;
if (t > a) {....}
But in this case I getting the following processor command sequence:
vldr.32 s0, [r0]
vcvt.s32.f32 s0, s0
vmov r0, s0 <--- takes 20 cycles as `vmrs APSR_nzcv, fpscr` in case of
cmp r0, r1 floating point comparison
As conversion happens at NEON, there is no matter if I compare integers, by described way or floats.