Compare and swap with SIMD intrinsics
问题 Is it possible to compare in SIMD instruction and swap the values if some condition happened. In other words, I have 4 integers: (100 5) (1 42) And I want to receive: (5 100) (1 42) i.e. I want to compare pairwise (first value with second and third with fourth) and in case left operand is greater - swap the values. Is it possible to do with only 1 SIMD? P.S.: it's the first time I'm trying SIMD and probably I'm using wrong terminology - please fix me if I'm wrong. 回答1: It seems that you want