Partager via


Logical Operations (Integer SSE2 Intrinsics)

Microsoft Specific

The following four logical operation intrinsics and their respective instructions are functional on Intel processors that support Streaming SIMD Extensions 2 (SSE2) instructions.

For an explanation of the syntax used in code samples in this topic, see Floating-Point Intrinsics Using Streaming SIMD Extensions.

SSE2 intrinsics use the __m128, __m128i, and __m128d data types, which are not supported on Itanium Processor Family (IPF) processors. Any SSE2 intrinsics that use the __m64 data type are not supported on x64 processors.

The emmintrin.h header file contains the declarations for the SSE2 instructions intrinsics.

__m128i _mm_and_si128 (__m128i a, __m128i b);

PAND

Computes the bitwise AND of the 128-bit value in a and the 128-bit value in b.

r := a & b

__m128i _mm_andnot_si128 (__m128i a, __m128i b);

PANDN

Computes the bitwise AND of the 128-bit value in b and the bitwise NOT of the 128-bit value in a.

r := (~a) & b

__m128i _mm_or_si128 (__m128i a, __m128i b);

POR

Computes the bitwise OR of the 128-bit value in a and the 128-bit value in b.

r := a | b

__m128i _mm_xor_si128 ( __m128i a, __m128i b);

PXOR

Computes the bitwise XOR of the 128-bit value in a and the 128-bit value in b.

r := a ^ b

See Also

Reference

Integer Intrinsics Using Streaming SIMD Extensions 2