SPRAB89A September 2011 – March 2014
For targets that have double-word (64-bit) LDDW and STDW instructions, it is more efficient to save registers belonging to even-odd pairs arranged on the stack so that the pair can be read with one LDDW. Note that the safe-debug ordering for little-endian frequently places registers so that this is true; this is not entirely by coincidence. However, for big-endian, the order of each pair would need to be reversed. When compiling for big-endian, the compiler looks for register pairs that occupy the same aligned double word on the stack, and swaps the order. This is still considered safe debug ordering, despite the fact that the ordering is not the same as little endian, and the big-endian order can vary for functions which save different registers. This swap occurs even on C6x targets which do not support LDDW or STDW.
Keep in mind that the safe debug ordering is consulted first for placing the registers on the stack; the ordering for a given even-odd pair is swapped only if the offset is evenly divisible by 8. If the save offset is not aligned, the registers will be saved individually in the original order.