_mm_cmpgt_epi64

Microsoft Specific

Emits the Streaming SIMD Extensions 4 (SSE4) instruction pcmpgtq. This instruction compares 64-bit integers that are passed in as 128-bit parameters.

__m128i _mm_cmpgt_epi64 (
     m128i a,
     m128i b
);

Parameters

Parameter

Description

[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 : 0x0
r1 := (a1 > b1) ? 0xffffffffffffffff : 0x0

Requirements

Intrinsic

Architecture

_mm_cmpgt_epi64

x86, x64

Header file <nmmintrin.h>

Remarks

r0, a0, and b0 are the lower 64 bits of the return value and input parameters a and b.

r1, a1, and b1 are higher 64 bits of the return value and input parameters a and b.

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

Example

#include <stdio.h>
#include <nmmintrin.h>

int main ()
{
    __m128i a, b;

    a.m128i_i64[1] = 0;
    a.m128i_i64[0] = -1;
    b.m128i_i64[1] = 0;
    b.m128i_i64[0] = -2;

    __m128i res = _mm_cmpgt_epi64(a, b);

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

    return 0;
}

Result res: 0x0000000000000000 0xffffffffffffffff

See Also

Concepts

__m64