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 |
---|---|---|
Equal |
CMPEQSS |
|
Equal |
CMPEQPS |
|
Less than |
CMPLTSS |
|
Less than |
CMPLTPS |
|
Less than or equal |
CMPLESS |
|
Less than or equal |
CMPLEPS |
|
Greater than |
CMPLTSS |
|
Greater than |
CMPLTPS |
|
Greater than or equal |
CMPLESS |
|
Greater than or equal |
CMPLEPS |
|
Not equal |
CMPNEQSS |
|
Not equal |
CMPNEQPS |
|
Not less than |
CMPNLTSS |
|
Not less than |
CMPNLTPS |
|
Not less than or equal |
CMPNLESS |
|
Not less than or equal |
CMPNLEPS |
|
Not greater than |
CMPNLTSS |
|
Not greater than |
CMPNLTPS |
|
Not greater than or equal |
CMPNLESS |
|
Not greater than or equal |
CMPNLEPS |
|
Ordered |
CMPORDSS |
|
Ordered |
CMPORDPS |
|
Unordered |
CMPUNORDSS |
|
Unordered |
CMPUNORDPS |
|
Equal |
COMISS |
|
Less than |
COMISS |
|
Less than or equal |
COMISS |
|
Greater than |
COMISS |
|
Greater than or equal |
COMISS |
|
Not equal |
COMISS |
|
Equal |
UCOMISS |
|
Less than |
UCOMISS |
|
Less than or equal |
UCOMISS |
|
Greater than |
UCOMISS |
|
Greater than or equal |
UCOMISS |
|
Not equal |
UCOMISS |
For an explanation of the syntax used in code samples in this topic, see Floating-Point Intrinsics Using Streaming SIMD Extensions.