by Thomas Serafini
When writing super-optimized code, it is important to understand how the compiler works
on the blocks of code that we use more frequently. That's why I wrote a simple benchmark
application that I use to test the optimization capabilities of different compilers; the
benchmark tests are specifically designed for DSP purpose; their aim is to test the
operations that are frequently used in DSP algorithms. The source
code of the application is available. The aim is to test the output of the compiler and
not to find the better optimized algorithm.
Float matrix multiplication: this test performs 1000 multiplications of two 64 x 64 matrix with 32 bit float elements. This test shows the multiply and add capabilities, the scheduling of float operations and the scheduling of memory accesses.
Integer conditional move: it is a test for the following instructions:
Float conditional move: it's the same of "integer conditional move" but the data type is 32 bit floating point.
Lookup table access: in this test, the index of the table is a 32 bit float number, so it is converted to a integer data type before being used as an index for the table; this is extremely common when the samples are managed as float. Many compilers spend dozens of cycles performing overflow test, so this code can be very slow on some compilers.
Biquadratic IIR filter float (and integer): this code tests the FPU (and integer) instruction scheduling capabilities of the compiler, implementing a biquadratic IIR filter.
Computing biquadratic filter coefficient: when you are managing a sweeping filter (like a VCF in a software synth) you need to recalculate the coefficient of the filter very often. This test shows the speed of this operation by calculating 25000000 sets of coefficients.
FFT: 500 blocks of 8192 samples. Doesn't need any other comments!
The table below contains the execution times (in seconds) of the benchmark for each compiler:
Last update: 6 october 2002