Why libfreevec? There is already libmotovec by Freescale!

Submitted by markos on Sun, 01/20/2008 - 18:42.

Indeed. And much to their credit I'm still struggling to reach the performance of this library. These guys really knew what they did :-)
Now, when I started libfreevec, libmotovec's license was different than what it is now (now it uses a BSD-like license) and that was the reason I started libfreevec. Secondly, there were no efforts made to included it in a standard libc (like glibc or uclibc, or newlib, etc) as it would make sense then. libfreevec was started with that idea in mind, to eventually be incorporated into glibc. Thirdly, libmotovec is written in ppc assembly, which although is great for performance, it's really difficult to maintain/debug/whatever. Not many people are that proficient with ppc asm, I know I am not. libfreevec is written in C with some very small parts written in ppc asm, using the AltiVec intrinsics available in GCC. This means that as GCC gets better instruction scheduling for the G4, so libfreevec might benefit from this as well (and actually it has, gcc 4.2.x performs much better than gcc 3.x, which shows in libfreevec benchmarks).

In addition, the way it's written right now, it allows for easy expansion with new functions, or even optimization of the existing ones, with just fiddling with a couple of macro modules.

Finally, libfreevec offers more AltiVec optimized functions than libmotovec, plus a consistent cache-prefetching mechanism used in all of the available functions, and if I might say so myself, some of the libfreevec functions are even faster than the libmotovec equivalents.:-)

( categories: )