Rules for Operators

To use operators with the Ivec classes you must
use one of the following three syntax conventions:

[ Ivec_Class ] R = [ Ivec_Class ] A [ operator ][ Ivec_Class
] B

Example 1:I64vec1
R = I64vec1 A & I64vec1 B;

[ Ivec_Class ] R =[ operator ] ([ Ivec_Class ] A,[
Ivec_Class ] B)

Example 2:I64vec1
R = andnot(I64vec1 A, I64vec1 B);

[ Ivec_Class ] R [ operator ]= [ Ivec_Class ] A

Example 3:I64vec1
R &= I64vec1 A;

[ operator ]an operator (for example, &,
|, or ^ )

[ Ivec_Class ] an Ivec
class

R, A, B
variables declared using the pertinent Ivec classes

The table that follows shows 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.

Summary of Rules Major Operators

Operators

Sign Typecasting

Size Typecasting

Other Typecasting Requirements

Assignment

N/A

N/A

N/A

Logical

Automatic

Automatic
(to left)

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 shows 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.