[LAD] vectorization

Christian Schoenebeck cuse at users.sourceforge.net
Wed Apr 16 08:13:04 UTC 2008


Am Mittwoch, 16. April 2008 09:19:19 schrieb Christian Schoenebeck:
> But if you're totally sceptical, you could simply move out the mixing
> functions into an own C++ file, compile that object file with maximum
> optimization, and compile the actual benchmark application with just "-O1"
> or something.

Which I just did, and this time the assembly result is equal to the gcc vector 
result:

Benchmarking mixdown (no coeff):
pure C++                : 680 ms
ASM SSE                 : 200 ms
GCC vector extensions   : 200 ms

Benchmarking mixdown (WITH coeff):
pure C++                : 1100 ms
ASM SSE                 : 310 ms
GCC vector extensions   : 300 ms

because that way the compiler is forced to compile the gcc vector solution 
with real function calls, whereas in yesterday's benchmark the C++ and gcc 
vector functions were simply inlined (I checked the compiler's assembly 
output). But in practice you would make those short functions inliners 
anyway. And even if it's "just" as good as hand crafted assembly code, it's a 
lot easiear to maintain compared to assembly and compiles (and optimizes) for 
other architectures as well. So I'm definitely on the vector train now ...

CU
Christian



More information about the Linux-audio-dev mailing list