Testing equality between two __m128i variables

前端 未结 3 1067
悲&欢浪女
悲&欢浪女 2020-12-09 20:01

If I want to do a bitwise equality test between two __m128i variables, am I required to use an SSE instruction or can I use ==? If not, which SSE i

3条回答
  •  时光说笑
    2020-12-09 20:16

    Consider using an SSE4.1 instruction ptest:

    if(_mm_testc_si128(v0, v1)) {if equal}
    
    else {if not} 
    

    ptest computes the bitwise AND of 128 bits (representing integer data) in a and mask, and return 1 if the result is zero, otherwise return 0.

提交回复
热议问题