[FFmpeg-devel] Fix Altivec detection on Linux.

Luca Barbato lu_zero
Wed Mar 19 15:03:22 CET 2008

David Woodhouse wrote:
> This patch should use /proc/$$/auxv to safely detect whether Altivec is
> available.


> I see we also build everything with -maltivec anyway, which with GCC now
> doing autovectorisation means that we're likely to be using Altivec
> anywhere, and this check is mostly pointless. 

Since we do not like runtime cpu detection it is indeed pointless and 
put there just to make happy the "usual suspects". The -maltivec stuff 
should be triggered by default but you should be able to tune the cflags 
to something useful (e.g G3 tuning) while still be able to build the 
altivec stuff (they get -maltivec -mabi=altivec only in this case).

> We should stop doing that. If GCC is managing to autovectorise any C
> code and it actually makes a significant difference, then we should
> think about building those components twice -- once with -maltivec and
> once without -- and putting the Altivec version in /lib/altivec where
> the dynamic linker will find it on appropriate systems.

This part seems interesting, is there any standard/guideline about this?

I like better building twice the library than having cpu runtime 
detection builtin. (and that would make room for altivectorized 
libavutil variants)



Luca Barbato
Gentoo Council Member
Gentoo/linux Gentoo/PPC

More information about the ffmpeg-devel mailing list