3.3.18.3.1 Bit-Reversed Addressing Implementation
Bit-Reversed Addressing can only be enabled through the use of the movr.(w/l) instruction. This type of addressing is effective when used with pre-modified or post-modified destination addressing. The destination Bit-Reversed Addressing modifier is sourced from XBREV.XB[14:0].
If the length of a bit-reversed buffer is M = 2N bytes, the last ‘N’ bits of the data buffer start address must be zeros.
The XB[14:0] bits are the Bit-Reversed Addressing modifier, or ‘pivot point’, which is typically a constant. In the case of an FFT computation, its value is equal to half of the FFT data buffer size.
Bit-Reversed Addressing is only possible when using the MOVR instruction, and it can target a 16-bit or 32-bit-sized data. The MOVR instruction supports register indirect with Pre-Increment or Post-Increment Addressing and 16/32 bit-sized data writes. When Bit-Reversed Addressing is active, the W address pointer is always added to the address modifier (XB) and the offset associated with the Register Indirect Addressing mode is ignored. In addition, the LSb of each 16-bit address and the LS 2-bits of each 32-bit address will always be zero for both source and destination EAs. The MOVR instruction also supports “in-place” data reordering (where only one data buffer is used for both the source and destination). Source and destination indirect addressing may use the same register
If Bit-Reversed Addressing has already been enabled by setting the BREN (XBREV[15]) bit, a write to the XBREV register should not be immediately followed by an indirect read operation using the W register that has been designated as the Bit-Reversed Pointer.
Normal Address | Bit-Reversed Address | ||||||||
---|---|---|---|---|---|---|---|---|---|
A3 | A2 | A1 | A0 | Decimal | A3 | A2 | A1 | A0 | Decimal |
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 8 |
0 | 0 | 1 | 0 | 2 | 0 | 1 | 0 | 0 | 4 |
0 | 0 | 1 | 1 | 3 | 1 | 1 | 0 | 0 | 12 |
0 | 1 | 0 | 0 | 4 | 0 | 0 | 1 | 0 | 2 |
0 | 1 | 0 | 1 | 5 | 1 | 0 | 1 | 0 | 10 |
0 | 1 | 1 | 0 | 6 | 0 | 1 | 1 | 0 | 6 |
0 | 1 | 1 | 1 | 7 | 1 | 1 | 1 | 0 | 14 |
1 | 0 | 0 | 0 | 8 | 0 | 0 | 0 | 1 | 1 |
1 | 0 | 0 | 1 | 9 | 1 | 0 | 0 | 1 | 9 |
1 | 0 | 1 | 0 | 10 | 0 | 1 | 0 | 1 | 5 |
1 | 0 | 1 | 1 | 11 | 1 | 1 | 0 | 1 | 13 |
1 | 1 | 0 | 0 | 12 | 0 | 0 | 1 | 1 | 3 |
1 | 1 | 0 | 1 | 13 | 1 | 0 | 1 | 1 | 11 |
1 | 1 | 1 | 0 | 14 | 0 | 1 | 1 | 1 | 7 |
1 | 1 | 1 | 1 | 15 | 1 | 1 | 1 | 1 | 15 |
32-Bit Data, Two Buffer Bit-Reversed Data Reordering Example
; Two buffer (input and output) bit reversed data re-order subroutine for 32-bit (real)
; data values
;
; W0: Temp
; W1: Data table size N (long words)
; W8: Input data table pointer (natural order) initialized to start of table
; W9: Output data table pointer (bit reversed) initialized to start of table
push.l w0
mov.sl #_XBREV, w0
lsr.l w1, #1, [w0] ; XBREV = N/2
sub.l #1, w1
repeat w1
movr.l [w8++], [w9++] ; Move data from input to output buffer, then
; bump natural order and bit reversed pointers
pop.l w0
return