Developer Guide and Reference

Contents

Compare Operators

The operators described in this section compare the single precision floating-point values of
A
and
B
. Comparison between objects of any
Fvec
class return the same class being compared.
The following table lists the compare operators for the
Fvec
classes.

Compare Operators and Corresponding Intrinsics

Compare For:
Operators
Syntax
Equality
cmpeq
R = cmpeq(A, B)
Inequality
cmpneq
R = cmpneq(A, B)
Greater Than
cmpgt
R = cmpgt(A, B)
Greater Than or Equal To
cmpge
R = cmpge(A, B)
Not Greater Than
cmpngt
R = cmpngt(A, B)
Not Greater Than or Equal To
cmpnge
R = cmpnge(A, B)
Less Than
cmplt
R = cmplt(A, B)
Less Than or Equal To
cmple
R = cmple(A, B)
Not Less Than
cmpnlt
R = cmpnlt(A, B)
Not Less Than or Equal To
cmpnle
R = cmpnle(A, B)

Compare Operators

The mask is set to
0xffffffff
for each floating-point value where the comparison is true and
0x00000000
where the comparison is false. The following table shows the return values for each class of the compare operators, which use the syntax described earlier in the Return Value Notation section.

Compare Operator Return Value Mapping

R
A0
For Any Operators
B
If True
If False
F32vec4
F64vec2
F32vec1
R0:=
(A1
!(A1
cmp[eq | lt | le | gt | ge]
cmp[ne | nlt | nle | ngt | nge]
B1)
B1)
0xffffffff
0x0000000
X
X
X
R1:=
(A1
!(A1
cmp[eq | lt | le | gt | ge]
cmp[ne | nlt | nle | ngt | nge]
B2)
B2)
0xffffffff
0x0000000
 
X
X
N/A
R2:=
(A1
!(A1
cmp[eq | lt | le | gt | ge]
cmp[ne | nlt | nle | ngt | nge]
B3)
B3)
0xffffffff
0x0000000
 
X
N/A
N/A
R3:=
A3
cmp[eq | lt | le | gt | ge]
cmp[ne | nlt | nle | ngt | nge]
B3)
B3)
0xffffffff
0x0000000
 
X
N/A
N/A
The following table shows examples for arithmetic operators and intrinsics.

Compare Operations for Fvec Classes

Returns
Example Syntax Usage
Intrinsic
Compare for Equality
4 floats
F32vec4 R = cmpeq(F32vec4 A);
_mm_cmpeq_ps
2 doubles
F64vec2 R = cmpeq(F64vec2 A);
_mm_cmpeq_pd
1 float