Reputation: 71
I use arm assembly and NEON SIMD instructions. I want to get the maximum of 16 bit unsigned values which are in two Q registers and compare them with a threshold. If all the 16 bit values are smaller than the threshold, I call a function. If one or more values are larger than a threshold, I call another function.
The following SIMD instructions gets the maximum.
// threshold is an r register
vdup.16 q15, threshold
vmax.u16 q12, q14, q13
vcgt.u16 q11, q12, q15
Does vcgt affect the FPSCR flags? I think not. Then I have to check if q11 is zero or not. If it is zeor, call function1, otherwise call function2. It would be like
if (q11 == 0)
//call function1
else
//call function2
How can I do it without moving q11 to 4 r registers?
Thanks
Upvotes: 3
Views: 386
Reputation: 6354
There isn't any - at least not in the user mode. Those cmp instructions create mask vectors that you choose values between two results based upon.
Currently I cannot tell you precisely what the instructions are since I'm writing this on my iPhone in a train. But it won't be a problem finding them in the reference manual.
Upvotes: 2