Paolo Bonzini wrote:
SSE4 introduces specific instruction support, with a shorter sequence for this purpose. It seems to be quite difficult to persuade gcc to use it.2) selection operations on vectors, kind of (v1 <= v2 ? v3 : v4). These can be written for example like this: cmpleps xmm1, xmm2 ; xmm1 = xmm1 <= xmm2 ? all-ones : 0 andnps xmm4, xmm1 ; xmm4 = xmm1 <= xmm2 ? 0 : xmm4 andps xmm1, xmm3 ; xmm1 = xmm1 <= xmm2 ? xmm3 : 0 orps xmm1, xmm4 ; xmm1 = xmm1 <= xmm2 ? xmm3 : xmm4