4.5. TIE Instructions

The byte-swapping function described in the previous chapter provides an excellent demonstration of the ability of new processor instructions to reduce cycle count. Figure 4.3 illustrates the byte-swap function, which converts a 32-bit word between big- and little-endian formats.

Figure 4.3. Conversion from one endian format to the other for a 32-bit word.

The nine instructions from the base Xtensa ISA that are required to perform this operation are:

slli a9, a14, 24Form intermediate result bits 24–31 in register a9
slli a8, a14, 8Shift 32-bit word left by 8 bits, save in register a8
srli a10, a14, 8Shift 32-bit word right ...

Get Designing SOCs with Configured Cores now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.