SPE2 Programming Interface Manual, Rev. 1.0-2
2-4 Freescale Semiconductor
High-Level Language Interface
The behaviors expected from such casting are provided instead of using intrinsics.
The intrinsics provide the ability to extract existing data types out of __ev64_*__ variables as well
as the ability to insert into and/or create __ev64_*__ variables from existing data types. Normal C
casts provide casts from one __ev64_*__ type to another.
An implicit cast is performed when going to __ev64_opaque__ from any other __ev64_*__ type.
An implicit cast occurs when going from __ev64_opaque__ to any other __ev64_*__ type. The
implicit casts that occur when going between __ev64_opaque__ and any other __ev64_*__ type
also apply to pointers of type __ev64_opaque__. When casting between any two __ev64_*__
types not including __ev64_opaque__, an explicit cast is required. When casting between pointers
to any two __ev64_*__ types not including __ev64_opaque__, an explicit cast is required. No cast
or promotion performs a conversion; the bit pattern of the result is the same as the bit pattern of
the argument that is cast.
2.2.4 New Operators
New operators are introduced to construct __ev64_*__ values and allow full access to the
functionality that the SPE2 architecture provides.
2.2.4.1 __ev64_*__ Initialization and Literals
The __ev64_opaque__ type is the only __ev64_*__ type that cannot be initialized. The remaining
__ev64_*__ types can be initialized using the C99 array initialization syntax. Each type is treated
as an array of the specified data contents of the appropriate size. The following code exemplifies
the initialization of these types:
__ev64_u8__ a = { 0, 1, 2, 3, 4, 5, 6, 7 };
__ev64_s8__ b = { -1, -2, -3, -4, -5, -6, 0, 7 };
__ev64_u16__ c = { 0, 1, 2, 3 };
__ev64_s16__ d = { -1, -2, -3, 4 };
__ev64_u32__ e = { 3, 4 };
__ev64_s32__ f = { -2, 4 };
__ev64_u64__ g = { 17 } ;
__ev64_s64__ h = { 23 } ;
__ev64_fs__ i = { 2.4, -3.2 };
e = __ev_addw(a, (__ev64_s16__){2,1,5,2});
2.2.4.2 New Operators Representing SPE2 Operations
New operators are introduced to allow full access to the functionality that the SPE2 architecture
provides. Language structures that parse like function calls represent these operators in the
programming language.
The names associated with these operations are all prefixed with "__ev_". The appearance of one
of these forms can indicate one of the following:
• A specific SPE2 operation, like __ev_addw(__ev64_opaque__ a, __ev64_opaque__ b)