  QR decomposition is used prevalently in wireless communication. In this
paper, we express the Givens-rotation-based QR decomposition algorithm on a
spatial architecture using T2S (Temporal To Spatial), a high-productivity
spatial programming methodology for expressing high-performance spatial
designs. There are interesting challenges: the loop iteration space is not
rectangular, and it is not obvious how the imperative algorithm can be
expressed in a functional notation, the starting point of T2S. Using QR
decomposition as an example, this paper elucidates some general principle, and
de-mystifies high-performance spatial programming. The paper also serves as a
tutorial of spatial programming for programmers who are not mathematicians, not
expert programmers, and not experts on spatial architectures, but still hope to
intuitively identify a high-performance design and map to spatial architectures
efficiently.
