Subscribe
Issue No.08  August (2009 vol.58)
pp: 11261138
Christopher Kumar Anand , McMaster University, Hamilton
Wolfram Kahl , McMaster University, Hamilton
DOI Bookmark: http://doi.ieeecomputersociety.org/10.1109/TC.2008.223
ABSTRACT
Coconut, a tool for developing highassurance, highperformance kernels for scientific computing, contains an extensible domainspecific language (DSL) embedded in Haskell. The DSL supports interactive prototyping and unit testing, simplifying the process of designing efficient implementations of common patterns. Unscheduled C and scheduled assembly language output are supported. Using the patterns, even nonexpert users can write efficient function implementations, leveraging special hardware features. A productionquality library of elementary functions for the Cell BE SPU compute engines has been developed. Coconutgenerated and scheduled vector functions were more than four times faster than commercially distributed functions written in C with intrinsics (a nicer syntax for inline assembly), wrapped in loops and scheduled by spuxlc. All Coconut functions were faster, but the difference was larger for hardtoapproximate functions for which registerlevel SIMD lookups made a bigger difference. Other helpful features in the language include facilities for translating interval and polynomial descriptions between GHCi, a Haskell interpreter used to prototype in the DSL, and Maple, used for exploration and minimax polynomial generation. This makes it easier to match mathematical properties of the functions with efficient calculational patterns in the SPU ISA. By using single, literate source files, the resulting functions are remarkably readable.
INDEX TERMS
Special function approximations, parallel and vector implementations, code generation, specialized application languages, SIMD processors, applicative (functional) programming.
CITATION
Christopher Kumar Anand, Wolfram Kahl, "An Optimized Cell BE Special Function Library Generated by Coconut", IEEE Transactions on Computers, vol.58, no. 8, pp. 11261138, August 2009, doi:10.1109/TC.2008.223
REFERENCES
