Developer Guide and Reference

Contents

Addition and Subtraction Operators

The addition and subtraction operators return the class of the nearest common ancestor when the right-side operands are of different signs. The following code provides examples of usage and miscellaneous exceptions.
Syntax Usage for Addition and Subtraction Operators
Return nearest common ancestor type,
I16vec4
.
Is16vec4 A;
Iu16vec4 B;
I16vec4 C;
C = A + B;
Returns type left-hand operand type.
Is16vec4 A;
Iu16vec4 B;
A += B;
B -= A;
Explicitly convert
B
to
Is16vec4
.
Is16vec4 A,C;
Iu32vec24 B;
C = A + C;
C = A + (Is16vec4)B;
Addition and Subtraction Operators with Corresponding Intrinsics
Operation
Symbols
Syntax
Corresponding Intrinsics
Addition
+
+=
R = A + B
R += A
_mm_add_epi64
_mm_add_epi32