For many programs, it is possible to use a simple macro translation strategy for developing code that is portable between the Vector/SIMD Multimedia Extension and SPU instruction sets.
The SPU intrinsics that map one-to-one with Vector/SIMD Multimedia Extension (except for the specific intrinsics described in Specific intrinsics) are shown in Table 2.
The Vector/SIMD Multimedia Extension intrinsics that map one-to-one with SPU are shown in Table 3.
SPU Intrinsic | Vector/SIMD Multimedia Extension Intrinsic | For Data Types |
---|---|---|
spu_add | vec_add | vector operands only, no scalar operands |
spu_and | vec_and | vector operands only, no scalar operands |
spu_andc | vec_andc | all |
spu_avg | vec_avg | all |
spu_cmpeq | vec_cmpeq | vector operands only, no scalar operands |
spu_cmpgt | vec_cmpgt | vector operands only, no scalar operands |
spu_convtf | vec_ctf | limited scale range (5 bits) |
spu_convts | vec_cts | limited scale range (5 bits) |
spu_convtu | vec_ctu | limited scale range (5 bits) |
spu_extract | vec_extract | all |
spu_genc | vec_addc | all |
spu_insert | vec_insert | all |
spu_madd | vec_madd | float only |
spu_mulhh | vec_mule | all |
spu_mulo | vec_mulo | halfword vector operands only, no scalar operands |
spu_nmsub | vec_nmsub | float only |
spu_nor | vec_nor | all |
spu_or | vec_or | vector operands only, no scalar operands |
spu_promote | vec_promote | all |
spu_re | vec_re | all |
spu_rl | vec_rl | vector operands only, no scalar operands |
spu_rsqrte | vec_rsqrte | all |
spu_sel | vec_sel | all |
spu_splats | vec_splats | all |
spu_sub | vec_sub | vector operands only, no scalar operands |
spu_genb | vec_subc | vector operands only, no scalar operands |
spu_xor | vec_xor | vector operands only, no scalar operands |
Vector/SIMD Multimedia Extension Intrinsic | SPU Intrinsic | For Data Types |
---|---|---|
vec_add | spu_add | halfwords, words, and floats only (not bytes) |
vec_addc | spu_genc | all |
vec_and | spu_and | all |
vec_andc | spu_andc | all |
vec_avg | spu_avg | unsigned chars only |
vec_cmpeq | spu_cmpeq | all |
vec_cmpgt | spu_cmpgt | all |
vec_ctf | spu_convtf | all |
vec_cts | spu_convts | all |
vec_ctu | spu_convtu | all |
vec_extract | spu_extract | all |
vec_insert | spu_insert | all |
vec_madd | spu_madd | all |
vec_mulo | spu_mulo | halfwords only (not bytes) |
vec_nmsub | spu_nmsub | all |
vec_nor | spu_nor | all |
vec_or | spu_or | all |
vec_promote | spu_promote | all |
vec_re | spu_re | all |
vec_rl | spu_rl | halfwords and words only (not bytes) |
vec_rsqrte | spu_rsqrte | all |
vec_sel | spu_sel | all |
vec_splats | spu_splats | all |
vec_sub | spu_sub | halfwords, words, and floats only |
vec_subc | spu_genb | all |
vec_xor | spu_xor | all |