I want to process a large array of floating-point numbers on the ARM processor, using Neon technology to calculate them four at a time. Everything's fine for operations like add and multiply, but what do I do if my calculation goes into an IF block? Example:
// In the non-vectorized original code, A is an array of many floating-point
// numbers, which are calculated one at a time. Now they're packed
// into a vector and processed four at a time
...calculate A...
if (A > 10.f)
{
A = A+5.f;
}
else
{
A = A+10.f;
}
Now, which IF branch do I execute? What if some of the values in the vector being processed are greater than 10 and some are less? Is it even possible to vectorize code like this?