[MPlayer-dev-eng] Compile options

Guillaume POIRIER poirierg at gmail.com
Sat Sep 16 12:00:20 CEST 2006


Hi,

Please keep Fredrik Smedberg in copy as he's not subscribed.

On 9/15/06, Fredrik Smedberg <fredrik at cute.se> wrote:
> Hi!
>
> First of all, I have a 64-bit system running on an Athlon64.
>
> After I've ran "./configure" and did "make" MPlayer of course starts
> compiling. The thing is that among the many compiler options the source
> is compiled with these (among many more options of course):
>
> -O4 -march=k8 -mtune=k8
>
> What I don't get is why -O4? Isn't -O3 the highest optimize option gcc
> have? I've also heard a lot of people give the advice to use -O2 because
> -O3 many times generate slower code than -O2?

Well, it depends. 03 has a tendency of making codesize grow bigger
because of aggressive inlining. This can be a very bad thing on big
applications where it it won't pay off, but in the case of MPlayer,
they _usually_ pay off. I'd suggest you test both O2 and O3 and check
the speed of the resulting binary with -benchmark option over some
sample files.

I'd be curious to see the results (compiler options and compiler
version are a recurrent issue here, but usually ppl are too lazy to do
appropriate benchmarking).


> -march=k8 -mtune=k8 is
> even stranger. At least with gcc 4.1.* -march implies mtune. Why use
> both when only -march is needed? Wouldn't it be cleaner with a
> ./configure check like: if "gcc version > some version" -> only use -march ?

Yes, and no. It may be desirable to set different values for -march
and -mtune, like we do when MPlayer is compiled with runtime cpu
detection.

Check the 'configure' script for more details.

Guillaume
-- 
With DADVSI (http://en.wikipedia.org/wiki/DADVSI), France finally has
a lead on USA on selling out individuals right to corporations!
Vive la France!



More information about the MPlayer-dev-eng mailing list