View Single Post
Old 07-18-2012, 10:13 AM   #41
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Bit reversed indexing

Here is a simple bit of math, good for someone (like me) who has never written VFP code.

We know that an array can be accessed by its member index.
We know that an array in C is just a pointer to the first (0) member.
We know that other fft implementations use either a lookup table or hard code something to "bit reverse" the member index numbers.
We know that C allows us to do "pointer math".
We know the VFP does not do "indexed load/store".

But it certainly does scaler, vector math.

We know the address of a member is: Maddr = (base + (index * (size_of(member)))
So how do we do "pointer math" for an 8 member array as a vector?

For an 8 element array, the bit reverse relationship looks like:
Fixed now
http://drpbox.knetconnect.com/fft/bits.html

Hmm (the intended algorithm, not the actual code) ...
* fill multiple with (size_of(member)) - bank 0
* load multiple with "magic index" - bank 1
* mul bank-0 bank-1 bank-0
* fill multiple with (array base) - bank 1
* add bank-0 bank-1 bank-0
and like magic we now have the pointer addresses in S0 .. S7 of the reordered input array.

C "pointer math" on steroids
Attached Files
File Type: pdf arm_arm.pdf (5.47 MB, 1087 views)

Last edited by knc1; 07-18-2012 at 02:54 PM.
knc1 is offline   Reply With Quote