다음을 통해 공유


_mm_cmpeq_epi64

Microsoft Specific

Emits the Streaming SIMD Extensions 4 (SSE4) instruction pcmpeqq.This instruction compares packed 64-bit integer values for equality.

__m128i _mm_cmpeq_epi64( 
   __m128i a,
   __m128i b 
);

Parameters

  • [in] a
    A 128-bit parameter that contains two 64-bit integers.

  • [in] b
    A 128-bit parameter that contains two 64-bit integers.

Return value

r0 := (a0 == b0) ? 0xffffffffffffffff : 0
r1 := (a1 == b1) ? 0xffffffffffffffff : 0

Requirements

Intrinsic

Architecture

_mm_cmpeq_epi64

x86, x64

Header file <smmintrin.h>

Remarks

r0, a0, and b0 are the low order 64 bits of return value r and parameters a and b.

r1, a1, and b1 are the high order 64 bits of return value r and parameters a and b.

Before using this intrinsic, software must ensure that the processor supports the instruction.

Example

#include <stdio.h>
#include <smmintrin.h>

int main () {
    __m128i a, b;

    a.m128i_i64[1] = 0xFFFFFFFFFFFFFFFF;
    a.m128i_i64[0] = 0xA0A0A0A0A0A0A0A0;
    b.m128i_i64[1] = 0xFFFFFFFFFFFFFFFF;
    b.m128i_i64[0] = 0xA0A0A0A0A0A0A0A1;

    __m128i res = _mm_cmpeq_epi64( a, b );

    printf_s("Original a: 0x%016I64x 0x%016I64x\nOriginal b: 0x%016I64x 0x%016I64x\n",
        a.m128i_i64[1], a.m128i_i64[0], b.m128i_i64[1], b.m128i_i64[0]);
    printf_s("Result res: 0x%016I64x 0x%016I64x\n",
        res.m128i_i64[1], res.m128i_i64[0]);

    return 0;
}
Original a: 0xffffffffffffffff 0xa0a0a0a0a0a0a0a0
Original b: 0xffffffffffffffff 0xa0a0a0a0a0a0a0a1
Result res: 0xffffffffffffffff 0x0000000000000000

See Also

Reference

Compiler Intrinsics