Using the Accelerate framework from OSX, you get access to 4-way SIMD functionality where you can operate on vector floats, vector ints and vector bools. It gives you 4-way divisions e.g. and also 4-way sin,cos,tan etc.
For a vector float of 4 floats, the framework provides vFloat. For a vector bool of 4 bools, the framework provides vBool32.
What I am trying to accomplish is the 4-way SIMD version of this line of code:
float a = ...;
float b = ...;
bool condition = ...;
float selected = condition ? a : b;
On a Cell processor e.g., you would use the intrinsic 'spu_sel(val1, val2, conditional)'.
I tried writing down the 4-way selection as:
vFloat a = { ... };
vFloat b = { ... };
vBool32 condition = { ... };
vFloat selected = condition ? a : b;
...which is not accepted by the LLVM compiler, as the '?' operator does not accept vBool32. Also, there is no operator called 'vsel' or 'vself' or something similar on the webpage mentioned above. Is there floating point selection available at all in this framework? And if so, how to access it?