[Lunar-commits] r25168 - moonbase/trunk/graphics/libpng

Kok, Auke sofar at foo-projects.org
Wed Jul 18 07:14:52 CEST 2007


Zbigniew Luszpinski wrote:
> Author: zbiggy
> Date: 2007-07-18 03:32:46 +0200 (Wed, 18 Jul 2007)
> New Revision: 25168
> 
> Added:
>    moonbase/trunk/graphics/libpng/BUILD
> Log:
> Bugfix: now libpng is compiled with low level MMX assembly optimization when
> MMX ready CPU is detected during compilation.
> This built-in asm optimization is faster than general CFLAGS.
> libpng MMX check is a little bit crazy and _turns off_ building MMX code when:
> - march is higher than i686 (because it autoenables supported by CPU simd optimizations)
> - mmx,sse,3dnow are enabled manually using -m parameter or -mfpmath=
> If MMX optimization is turned off you'll see PNG_NO_MMX_CODE flag in compilation log several times.
> This bugfix fixes this problem by temporary turning off bad flags and by providing alternative optimization.
> libpng built with this bugfix returns:
> checking if assembler code in pnggccrd.c can be compiled without PNG_NO_MMX_CODE... yes
> in configure stage.
> In compilation log you will not see PNG_NO_MMX_CODE anymore.
> 
> 
> Added: moonbase/trunk/graphics/libpng/BUILD
> ===================================================================
> --- moonbase/trunk/graphics/libpng/BUILD	                        (rev 0)
> +++ moonbase/trunk/graphics/libpng/BUILD	2007-07-18 01:32:46 UTC (rev 25168)
> @@ -0,0 +1,12 @@
> +(
> +
> +CFLAGS="${CFLAGS//march/mtune}"
> +CFLAGS="${CFLAGS//=sse/=387}"
> +CFLAGS="${CFLAGS//=387,387/=387}"
> +CFLAGS="${CFLAGS//-mmmx/-mno-mmx}"
> +CFLAGS="${CFLAGS//-m3dnow/-mno-3dnow}"
> +CFLAGS="${CFLAGS//-msse/-mno-sse}"
> +CFLAGS="-march=`uname -m` $CFLAGS"
> +default_build

really, this kind of optimization is silly. did you measure the performance 
difference? How much is the average user going to benefit from this?


Auke




More information about the Lunar-dev mailing list