[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CPU specific binaries



arto.astala@nokia.com writes:

> All this comes out of thin air, but here goes:
> 
> *  I think that currently the goal is to support the highest
>    optimization that does not hurt (noticeably) the low end

No, thats evil and uneccessary. I consider compiling with -O3 or
higher as a bug for non-critical functions. For things like the inner
loop of a fractal program its fine, but not for the wait loops. All
Source should be compiled with -O2 and thats it. (well, add
-fomit-frame-pointer or similar if you wish).

>    machines. I think this includes Pentium optimizations,

Pentium optimisation will only benefit original Pentium-mmx cpus and
slowdown all other cpus. 

>    but naturally none of the instruction set extensions.
>    Optimization for PII or higher is probably not ok.
> 
> *  Any optimization should not introduce compile time errors.

It shouldn´t even introduce warnings. Any package should compile with
-Wall -Werror and a few other warnings enabled, hardly any do.

>    Some may result in execution errors. Most of these are
>    illegal instructions. Some may be legal sequences of

Only the -mcpu option may do that, otherwise its a compiler bug.

>    instructions that just give a different result. Intel
>    has tried hard to avoid these, however, so it may be that
>    there are no such things.

Ouch, I hope so. Everybody would shoot Intel if they have such and if
for that reason windows crashes.

> *  There should be a set of optimizations that is always safe
>    to apply in any x86 architecture machine. The larger we
>    get this set and the better we ensure that all Debian
>    packages use it the better our base line is.

-O2 and a very few other options.

> *  The next thing would be to define a standard way to enable
>    some set of processor model specific optimizations. This
>    is really also a prerequisite for parallel binary model-
>    optimized distributions. It has to use auotobuild to work.

export CFLAGS=...
export CXXFLAGS=...

At least with autoconf/auomake/configure stuff, unless the maintainer
did disable that, which should be avoided and fixed.

May the Source be with you.
			Goswin


Reply to: