Visible to Intel only — GUID: GUID-06B51837-6658-4AAF-9E73-B103F38E227A
Visible to Intel only — GUID: GUID-06B51837-6658-4AAF-9E73-B103F38E227A
Rules for Operators
To use operators with the Ivec classes you must use one of the following three syntax conventions, where
- [ operator ] represents an operator (for example, &, |, or ^ )
- [ Ivec_Class ] represents an Ivec class
- R, A, B variables are declared using the pertinent Ivec classes
Convention One
Syntax:
[ Ivec_Class ] R = [ Ivec_Class ] A [ operator ][ Ivec_Class ] B
Example:
I64vec1 R = I64vec1 A & I64vec1 B;
Convention Two
Syntax:
[ Ivec_Class ] R =[ operator ] ([ Ivec_Class ] A,[ Ivec_Class ] B)
Example:
I64vec1 R = andnot(I64vec1 A, I64vec1 B);
Convention Three
Syntax:
[ Ivec_Class ] R [ operator ]= [ Ivec_Class ] A
Example:
I64vec1 R &= I64vec1 A;
Summary of Rules for Major Operators
The following table lists automatic and explicit sign and size typecasting. Explicit means that it is illegal to mix different types without an explicit typecasting. Automatic means that you can mix types freely and the compiler will do the typecasting for you.
Operators |
Sign Typecasting |
Size Typecasting |
Other Typecasting Requirements |
---|---|---|---|
Assignment |
N/A |
N/A |
N/A |
Logical |
Automatic |
Automatic |
Explicit typecasting is required for different types used in non-logical expressions on the right side of the assignment. |
Addition and Subtraction |
Automatic |
Explicit |
N/A |
Multiplication |
Automatic |
Explicit |
N/A |
Shift |
Automatic |
Explicit |
Casting Required to ensure arithmetic shift. |
Compare |
Automatic |
Explicit |
Explicit casting is required for signed classes for the less-than or greater-than operations. |
Conditional Select |
Automatic |
Explicit |
Explicit casting is required for signed classes for less-than or greater-than operations. |
Data Declaration and Initialization
The following table lists literal examples of constructor declarations and data type initialization for all class sizes. All values are initialized with the most significant element on the left and the least significant to the right.
Operation |
Class |
Syntax |
---|---|---|
Declaration |
M128 |
I128vec1 A; Iu8vec16 A; |
Declaration |
M64 |
I64vec1 A; Iu8vec8 A; |
__m128 Initialization |
M128 |
I128vec1 A(__m128 m); Iu16vec8(__m128 m); |
__m64 Initialization |
M64 |
I64vec1 A(__m64 m);Iu8vec8 A(__m64 m); |
__int64 Initialization |
M64 |
I64vec1 A = __int64 m; Iu8vec8 A =__int64 m; |
int i Initialization |
M64 |
I64vec1 A = int i; Iu8vec8 A = int i; |
int Initialization |
I32vec2 |
I32vec2 A(int A1, int A0); |
int Initialization |
I32vec4 |
I32vec4 A(int A3, int A2, int A1, int A0); |
short int Initialization |
I16vec4 |
I16vec4 A(short A3, short A2, short A1, short A0); |
short int Initialization |
I16vec8 |
I16vec8 A(short A7, short A6, ..., short A1, short A0); |
char Initialization |
I8vec8 |
I8vec8 A(char A7, char A6, ..., char A1, char A0); |
char Initialization |
I8vec16 |
I8vec16 A(char A15, ..., char A0); |