Udostępnij za pośrednictwem


Comparison Intrinsics (SSE)

Microsoft Specific

Each comparison intrinsic performs a comparison of a and b. For the packed form, the four single-precision, floating-point values of a and b are compared, and a 128-bit mask is returned. For the scalar form, the lower single-precision, floating-point values of a and b are compared, and a 32-bit mask is returned; the upper three single-precision, floating-point values are passed through from a. The mask is set to 0xffffffff for each element where the comparison is true and 0x0 where the comparison is false.

The superscript 'r' on the instruction indicates that the operands are reversed in the instruction implementation. The compare intrinsics listed in the following table are followed by a description of each intrinsic.

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

The header file xmmintrin.h contains the declarations for the SSE intrinsics.

Compare Intrinsics

Intrinsic name

Comparison

Corresponding instruction

_mm_cmpeq_ss

Equal

CMPEQSS

_mm_cmpeq_ps

Equal

CMPEQPS

_mm_cmplt_ss

Less than

CMPLTSS

_mm_cmplt_ps

Less than

CMPLTPS

_mm_cmple_ss

Less than or equal

CMPLESS

_mm_cmple_ps

Less than or equal

CMPLEPS

_mm_cmpgt_ss

Greater than

CMPLTSS

_mm_cmpgt_ps

Greater than

CMPLTPS

_mm_cmpge_ss

Greater than or equal

CMPLESS

_mm_cmpge_ps

Greater than or equal

CMPLEPS

_mm_cmpneq_ss

Not equal

CMPNEQSS

_mm_cmpneq_ps

Not equal

CMPNEQPS

_mm_cmpnlt_ss

Not less than

CMPNLTSS

_mm_cmpnlt_ps

Not less than

CMPNLTPS

_mm_cmpnle_ss

Not less than or equal

CMPNLESS

_mm_cmpnle_ps

Not less than or equal

CMPNLEPS

_mm_cmpngt_ss

Not greater than

CMPNLTSS

_mm_cmpngt_ps

Not greater than

CMPNLTPS

_mm_cmpnge_ss

Not greater than or equal

CMPNLESS

_mm_cmpnge_ps

Not greater than or equal

CMPNLEPS

_mm_cmpord_ss

Ordered

CMPORDSS

_mm_cmpord_ps

Ordered

CMPORDPS

_mm_cmpunord_ss

Unordered

CMPUNORDSS

_mm_cmpunord_ps

Unordered

CMPUNORDPS

_mm_comieq_ss

Equal

COMISS

_mm_comilt_ss

Less than

COMISS

_mm_comile_ss

Less than or equal

COMISS

_mm_comigt_ss

Greater than

COMISS

_mm_comige_ss

Greater than or equal

COMISS

_mm_comineq_ss

Not equal

COMISS

_mm_ucomieq_ss

Equal

UCOMISS

_mm_ucomilt_ss

Less than

UCOMISS

_mm_ucomile_ss

Less than or equal

UCOMISS

_mm_ucomigt_ss

Greater than

UCOMISS

_mm_ucomige_ss

Greater than or equal

UCOMISS

_mm_ucomineq_ss

Not equal

UCOMISS

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

See Also

Reference

Floating-Point Intrinsics Using Streaming SIMD Extensions