xorps - exclusive or packed singles

dest[0] = dest[0] ^ source[0]
dest[1] = dest[1] ^ source[1]
dest[2] = dest[2] ^ source[2]
dest[3] = dest[3] ^ source[3]

The xorps instruction xors the 4 source values (second operand) to the 4 values of the destination (an XMM register). The source can be an XMM register or a 32 bit memory location. There is also vxorps on CPUs with AVX instructions which allows using 3 XMM registers or 2 XMM registers and a memory location which can simplify coding and which xors 8 pairs of values if you use YMM registers.

There is also xorpd which xors packed doubles. The result is the same so pick your favorite.

        xorps   xmm0, xmm1         ; xor 4 pairs of values from xmm0 & xmm1
                                   ; leave the rest of ymm0 as is
        xorps   xmm0, [x]          ; xor 4 pairs of values from xmm0 & x
                                   ; x is an array of floats
                                   ; leave the rest of ymm0 as is
        vxorps  xmm3, xmm0, xmm15  ; xor 4 pairs of values from xmm0 & xmm15
                                   ; store results in xmm3
        vxorps  ymm3, ymm0, [x]    ; xor 8 pairs of values from ymm0 & x
                                   ; store results in ymm3
        vxorps  ymm3, ymm0, [rsi]  ; xor 8 pairs of values from ymm0 & [rsi]
                                   ; rsi contains the address of an array
                                   ; store results in ymm3

flags: none