Developer Guide and Reference

Contents

Compare Intrinsics

The prototypes for Intel® Streaming SIMD Extensions (Intel® SSE) intrinsics for comparison operations are in the
xmmintrin.h
header file.
To use these intrinsics, include the
immintrin.h
file as follows:
#include <immintrin.h>
Each comparison intrinsic performs a comparison of
a
and
b
. For the packed form, the four single-precision FP values of
a
and
b
are compared, and a 128-bit mask is returned. For the scalar form, the lower single-precision FP values of
a
and
b
are compared, and a 32-bit mask is returned; the upper three single-precision FP 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 results of each intrinsic operation are placed in a register. This register is illustrated for each intrinsic with R or R0-R3. R0, R1, R2, and R3 each represent one of the four 32-bit pieces of the result register.
Intrinsic Name
Operation
Corresponding
Intel® SSE 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