<< Chapter < Page Chapter >> Page >

Vector length 1

A VL of 1 implies that the computation is essentially scalar, and only one complex element can fit in a vector register. An example of such a scenario is when using interleaved double-precision floating-point arithmetic on an SSE2 machine: one 128-bit XMM register is used to store two 64-bit floats that represent the real and imaginary parts of a complex number.

When V L = 1 , the process of generating a program for a hard-coded FFT is as follows:

  1. Elaborate a topological ordering of nodes, where each node represents either a computation at the leaves of the transform, or a computation in the body of the transform (i.e., where smaller sub-transforms are combined into a larger transform);
  2. Write the program header to output, including a list of variables that correspond to registers used by the nodes;
  3. Traverse the list of nodes in order, and for each node, emit a statement that performs the computation represented by the given node. If a node is the last node to use a variable, a statement storing the variable to its corresponding location in memory is also emitted;
  4. Write the program footer to output.

Elaborate

[link] is a function, written in C++, that performs the first task in the process. As mentioned earlier, elaborating a topological ordering of nodes with a depth-first recursive structure is much likeactually computing an FFT with a depth-first recursive program (cf. Listing 3 in Appendix 2 ). [link] lists the nodes contained in the list ` ns ' after elaborating a size-8 transform by invoking elaborate(8, 0, 0, 0) .

  CSplitRadix::elaborate(int N, int ioffset, int offset, int stride) {     if(N > 4) {       elaborate(N/2, ioffset, offset, stride+1);      if(N/4 >= 4) {         elaborate(N/4, ioffset+(1<<stride), offset+(N/2), stride+2);         elaborate(N/4, ioffset-(1<<stride), offset+(3*N/4), stride+2);       }else{        CNodeLoad *n = new CNodeLoad(this, 4, ioffset, stride, 0);         ns.push_back(assign_leaf_registers(n));      }       for(int k=0;k<N/4;k++) {         CNodeBfly *n = new CNodeBfly(this, 4, k, stride);        ns.push_back(assign_body_registers(n,k,N);       }    }else if(N==4) {       CNodeLoad *n = new CNodeLoad(this, 4, ioffset, stride, 1);      ns.push_back(assign_leaf_registers(n));     }else if(N==2) {      CNodeLoad *n = new CNodeLoad(this, 2, ioffset, stride, 1);       ns.push_back(assign_leaf_registers(n));    }   }
Elaborate function for hard-coded conjugate-pair FFT

A transform is divided into sub-transforms with recursive calls at lines 4, 6 and 7, until the base cases of size 2 or size 4 are reached at the leaves of the elaboration. As well as the size-2 and size-4 base cases, which are handled at lines 20-21 and 17-18 (respectively), there is a special case where two size-2 base cases are handled in parallel at lines 9-10. This special case of handling two size-2 base cases as a larger size-4 node ensures that larger transforms are composed of nodes that are homogeneous in size – this is of little utility when emitting V L = 1 code, but it is exploited in "Other vector lengths" where the topological ordering of nodes is vectorized. The second row of [link] is just such a special case, since two size-2 leaf nodes are being computed, and thus the size is listed as 2(x2).

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Computing the fast fourier transform on simd microprocessors. OpenStax CNX. Jul 15, 2012 Download for free at http://cnx.org/content/col11438/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Computing the fast fourier transform on simd microprocessors' conversation and receive update notifications?

Ask