AE_ADDBRBA32 — 32-bit add to a bit-reversed base

Instruction Word

Slot
ae2_slot0
6
3
6
2
6
1
6
0
5
9
5
8
5
7
5
6
5
5
5
4
5
3
5
2
5
1
5
0
4
9
4
8
4
7
4
6
4
5
4
4
4
3
4
2
4
1
4
0
3
9
3
8
3
7
3
6
3
5
3
4
3
3
3
2
3
1
3
0
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
1
9
1
8
1
7
1
6
1
5
1
4
1
3
1
2
1
1
1
0
9876543210
Format ae_format2 - 64 bit(s)0000 1110
AE_ADDBRBA32 1000000000001101 0100
r 3210
t 3210
s 3210

Slot
ae_slot0
6
3
6
2
6
1
6
0
5
9
5
8
5
7
5
6
5
5
5
4
5
3
5
2
5
1
5
0
4
9
4
8
4
7
4
6
4
5
4
4
4
3
4
2
4
1
4
0
3
9
3
8
3
7
3
6
3
5
3
4
3
3
3
2
3
1
3
0
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
1
9
1
8
1
7
1
6
1
5
1
4
1
3
1
2
1
1
1
0
9876543210
Format ae_format - 64 bit(s) 1111
AE_ADDBRBA32 01010100
r 3210
t 3210
s 3210

Slot
ae_slot0
6
3
6
2
6
1
6
0
5
9
5
8
5
7
5
6
5
5
5
4
5
3
5
2
5
1
5
0
4
9
4
8
4
7
4
6
4
5
4
4
4
3
4
2
4
1
4
0
3
9
3
8
3
7
3
6
3
5
3
4
3
3
3
2
3
1
3
0
2
9
2
8
2
7
2
6
2
5
2
4
2
3
2
2
2
1
2
0
1
9
1
8
1
7
1
6
1
5
1
4
1
3
1
2
1
1
1
0
9876543210
Format ae_format1 - 64 bit(s)1 1110
AE_ADDBRBA32 01010100
r 3210
t 3210
s 3210

Assembler Syntax

AE_ADDBRBA32 a0..15(arr), a0..15(art), a0..15(ars)

C Syntax

#include <xtensa/tie/xt_hifi2.h>

extern unsigned AE_ADDBRBA32(unsigned ab, unsigned ai);

Description

AE_ADDBRBA32 performs a 32-bit add to a bit-reversed base.

Input address register art (in C-syntax, input ab) contains the base address. This is bit-reversed. Then the contents of input address register ars (in C-syntax, input ai), which contains the index, is added to the bit-reversed base address. Finally, the sum is bit-reversed and the result is written to output address register arr (in C-syntax, the output of the operation).

This helper operation may be used in combination with indexed loads and stores (.X) to perform bit-reversed addressing in optimized FFT implementations. For example, the C code below accesses through a block of 256 32-bit complex data elements in bit-reversed order:




       /* the data elements will be accessed

       0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, ...

       i.e., for i = 0...255, access element at index bitrev8(i). */

       ae_int32x2 *buf = ...;

       unsigned int index = 0;

       unsigned int stride = 0x80000000U >> (8 /* log2(256) */);

       ...

       for (...) {

           ...

           ae_int32x2 p = AE_L32X2_X(buf, index);

           index = AE_ADDBRBA32(index, stride);

           ...

           }



Implementation Pipeline

In Out
art Estage, ars Estage arr Estage

Protos that use AE_ADDBRBA32

proto AE_ADDBRBA32 { out uint32 ao, in uint32 ab, in uint32 ai }{}{
AE_ADDBRBA32 ao, ab, ai;
}