Language Abstractions For Low Level Optimization Techniques


Gergely Dévai, Zoltán Gera, Zoltán Kelemen




Programmers are often forced to implement performance-critical applications at a low abstraction level. This leads to programs that are hard to develop and maintain because the program text is mixed with low level optimization tricks and is far from the algorithm it implements. Even if compilers are smart nowadays and provide the user with many automatically applied optimizations, practice shows that in some cases it is hopeless to optimize the program automatically without the programmer’s knowledge. A complementary approach is to allow the programmer to fine tune the program by providing him with language features that make the optimization easier. These are language abstractions that make optimization techniques explicit without adding too much syntactic noise to the program text. This paper presents such language abstractions for two well-known optimizations: bitvectors and SIMD (Single Instruction Multiple Data). The language features are implemented in the embedded domain specific language Feldspar which is specifically tailored for digital signal processing applications. While we present these language elements as part of Feldspar, the ideas behind them are general enough to be applied in other language definition projects as well.