Comparisons
Microsoft Specific
Each comparison intrinsic performs a comparison of a and b. For the packed form, the two double-precision, floating-point values of a and b are compared, and a 128-bit mask is returned. For the scalar form, the lower double-precision, floating-point values of a and b are compared, and a 64-bit mask is returned; the upper double-precision, floating-point value is passed through from a. The mask is set to 0xffffffffffffffff for each element where the comparison is true and 0x0 where the comparison is false. The r following the instruction name indicates that the operands to the instruction are reversed in the actual implementation.
The comparison intrinsics are listed in the following table, followed by detailed descriptions.
SSE2 intrinsics use the __m128, __m128i, and __m128d data types, which are not supported on Itanium Processor Family (IPF) processors. Any SSE2 intrinsics that use the __m64 data type are not supported on x64 processors.
The emmintrin.h header file contains the declarations for the SSE2 instructions intrinsics.
Comparison Intrinsics
Intrinsic name |
Corresponding instruction |
Compare for |
---|---|---|
CMPEQPD |
Equality |
|
CMPLTPD |
Less than |
|
CMPLEPD |
Less than or equal |
|
CMPLTPDr |
Greater than |
|
CMPLEPDr |
Greater than or equal |
|
CMPORDPD |
Ordered |
|
CMPUNORDPD |
Unordered |
|
CMPNEQPD |
Inequality |
|
CMPNLTPD |
Not less than |
|
CMPNLEPD |
Not less than or equal |
|
CMPNLTPDr |
Not greater than |
|
CMPLEPDr |
Not greater than or equal |
|
CMPEQSD |
Equality |
|
CMPLTSD |
Less than |
|
CMPLESD |
Less than or equal |
|
CMPLTSDr |
Greater than |
|
CMPLESDr |
Greater than or equal |
|
CMPORDSD |
Ordered |
|
CMPUNORDSD |
Unordered |
|
CMPNEQSD |
Inequality |
|
CMPNLTSD |
Not less than |
|
CMPNLESD |
Not less than or equal |
|
CMPNLTSDr |
Not greater than |
|
CMPNLESDR |
Not greater than or equal |
|
COMISD |
Equality |
|
COMISD |
Less than |
|
COMISD |
Less than or equal |
|
COMISD |
Greater than |
|
COMISD |
Greater than or equal |
|
COMISD |
Not equal |
|
UCOMISD |
Equality |
|
UCOMISD |
Less than |
|
UCOMISD |
Less than or equal |
|
UCOMISD |
Greater than |
|
UCOMISD |
Greater than or equal |
|
UCOMISD |
Not equal |
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 2 Instructions