Developer Guide and Reference

Contents

Comparison Operators

The equality and inequality comparison operands can have mixed signedness, but they must be of the same size. The comparison operators for less-than and greater-than must be of the same sign and size.
Example of Syntax Usage for Comparison Operator
The nearest common ancestor is returned for compare for equal/not-equal operations.
Iu8vec8 A;
Is8vec8 B;
I8vec8 C;
C = cmpneq(A,B);
Type cast needed for different-sized elements for equal/not-equal comparisons.
Iu8vec8 A, C;
Is16vec4 B;
C = cmpeq(A,(Iu8vec8)B);
Type cast needed for sign or size differences for less-than and greater-than comparisons.
Iu16vec4 A;
Is16vec4 B, C;
C = cmpge((Is16vec4)A,B);
C = cmpgt(B,C);
Inequality Comparison Symbols and Corresponding Intrinsics
Compare For:
Operators
Syntax
Intrinsic
Equality
cmpeq
R = cmpeq(A, B)
_mm_cmpeq_pi32
_mm_cmpeq_pi16
_mm_cmpeq_pi8
Inequality
cmpneq
R = cmpneq(A, B)
_mm_cmpeq_pi32
_mm_cmpeq_pi16
_mm_cmpeq_pi8