Specific intrinsics

Specific intrinsics have a one-to-one mapping with a single assembly-language instruction.

All specific intrinsics are named using the SPU assembly instruction prefixed by the string, si_. For example, the specific intrinsic that implements the stop assembly instruction is named si_stop.

Specific intrinsics are provided for all instructions except branch, branch-hint, and interrupt-return instructions. All specific intrinsics are also available in the form of generic intrinsics, except for the specific intrinsics shown in Table 1. The specific intrinsics shown in this table fall into three categories:
Table 1. Specific intrinsics not available as generic intrinsics
Intrinsic Description
Generate Controls for Sub-Quadword Insertion Intrinsics
d = si_cbd(a, imm) Generate controls for byte insertion (d form)
d = si_cbx(a, b) Generate controls for byte insertion (x form)
d = si_cdd(a, imm) Generate controls for doubleword insertion (d form)
d = si_cdx(a, b) Generate controls for doubleword insertion (x form)
d = si_chd(a, imm) Generate controls for halfword insertion (d form)
d = si_chx(a, b) Generate controls for halfword insertion (x form)
d = si_cwd(a, imm) Generate controls for word insertion (d form)
d = si_cwx(a, b) Generate controls for word insertion (x form)
Constant Formation Intrinsics
d = si_il(imm) Immediate load word
d = si_ila(imm) Immediate load address
d = si_ilh(imm) Immediate load halfword
d = si_ilhu(imm) Immediate load halfword upper
d = si_iohl(a, imm) Immediate or halfword lower
No Operation Intrinsics
si_lnop( No operation (load)
si_nop() No operation (execute)
Memory Load and Store Intrinsics
d = si_lqa(imm) Load quadword (a form)
d = si_lqd(a, imm) Load quadword (d form)
d = si_lqr(imm) Load quadword instruction relative
d = si_lqx(a, b) Load quadword (x form)
si_stqa(a, imm) Store quadword (a form)
si_stqd(a, b, imm) Store quadword (d form)
si_stqr(a, imm) Store quadword instruction relative
si_stqx(a, b, c) Store quadword (x form)
Control Intrinsics
si_stopd(a, b, c) Stop and signal with dependencies
Specific intrinsics accept only the following types of arguments:
Arguments of other types must be cast to the qword data type. When using specific intrinsics, it might be necessary to cast from scalar types to the qword data type, or from the qword data type to scalar types. Similar to casting between vector data types, specific cast intrinsics have no effect on an argument that is stored in a register. All specific casting intrinsics are of the following form:
d = casting_intrinsic(a)
For example, to add 3 to the integer i:
int i;
i = si_to_int (si_ai (si_from_int(i), 3));
Table 2 lists the specific casting intrinsics.
Table 2. Specific Casting Intrinsics
Intrinsic Description
si_to_char Cast byte element 3 of qword to char.
si_to_uchar Cast byte element 3 of qword to unsigned char.
si_to_short Cast halfword element 1 of qword to short.
si_to_ushort Cast halfword element 1 of qword to unsigned short.
si_to_int Cast word element 0 of qword to int.
si_to_uint Cast word element 0 of qword to unsigned int.
si_to_ptr Cast word element 0 of qword to a void pointer.
si_to_llong Cast doubleword element 0 of qword to long long.
si_to_ullong Cast doubleword element 0 of qword to unsigned long long.
si_to_float Cast word element 0 of qword to float.
si_to_double Cast doubleword element 0 of qword to double.
si_from_char Cast char to byte element 3 of qword.
si_from_uchar Cast unsigned char to byte element 3 of qword.
si_from_short Cast short to halfword element 1 of qword.
si_from_ushort Cast unsigned short to halfword element 1 of qword.
si_from_int Cast int to word element 0 of qword.
si_from_uint Cast unsigned int to word element 0 of qword.
si_from_ptr Cast void pointer to word element 0 of qword.
si_from_llong Cast long long to doubleword element 0 of qword.
si_from_ullong Cast unsigned long long to doubleword element 0 of qword.
si_from_float Cast float to word element 0 of qword.
si_from_double Cast double to doubleword element 0 of qword.