Preferred methods
As we will see there are multiple ways to implement the logic of
these intrinsics. Some implementation methods are preferred because they allow
the compiler to select instructions and provided the most flexibility for
optimization across the whole sequence. Other methods may be required to
deliver a specific semantic or to deliver better optimization than the current
compiler is capable of. Some methods are more portable across multiple
compilers (GCC, LLVM, ...). All of this should be taken into consideration for
each intrinsic implementation. In general we should use the following list as a
guide to these decisions:
Use C vector arithmetic, logical, dereference, etc., operators in
preference to intrinsics.
Use the bi-endian interfaces from Appendix A of the ABI in
preference to other intrinsics when available, as these are designed for
portability among compilers.
Use other, less well documented intrinsics (such as
__builtin_vsx_*) when no better facility is available, in preference to
assembly.
If necessary, use inline assembly, but know what you're
doing.