Getting max value in a __m128i vector with SSE?

后端 未结 4 2130
Happy的楠姐
Happy的楠姐 2020-11-30 12:21

I have just started using SSE and I am confused how to get the maximum integer value (max) of a __m128i. For instance:

__m128i t =         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 13:11

    If you find yourself needing to do horizontal operations on vectors, especially if it's inside an inner loop, then it's usually a sign that you are approaching your SIMD implementation in the wrong way. SIMD likes to operate element-wise on vectors - "vertically" if you like, not horizontally.

    As for documentation, there is a very useful reference on intel.com which contains all the opcodes and intrinsics for everything from MMX through the various flavours of SSE all the way up to AVX and AVX-512.

提交回复
热议问题