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

Re: comparing x86 and powerpc laptops

On Wed, Apr 09, 2003 at 02:28:15PM +0200, Giuseppe Sacco wrote:
> > I currently own an iBook2, and have often wondered if it would have been a
> > better plan to go for a laptop with support for `multimedia' activities
> > (e.g. Altivec in a G4), and also whether I would have a copy of gcc that
> > would allow me to take advantage of such hardware.
> Hi Ed,
> I actually recompiled CPU intensive application on a powerbook G4 and I
> found that gcc-3.2.1 have options for the altivec support. I recompiled
> bochs using -mcpu=7450 -mtune=7450 -maltivec -mabi=altivec and the new
> bochs boot a complete Debian Woody system in 1'28" instead of more the
> 5'. I also found that -O3 generate slower executables then -O2
> (strange?)

No, completely normal. Except for the most critical inner loops where
it may be win, -O3 is a loss unless you have an infinitely large
i-cache (infrequent these days ;-)). With current (and increasingly large)
differences between core cycle time and memory latencies, you should 
only optimize high repeat loop counts for speed.

There is a lot of room to improve code generation in GCC for 32 bit PPC
(pardoxically some of the things that should be done on 32 bit PPC are
automagically done on 64 bit versions it seems). I've been playing with 
some of the instruction generation patterns and sometimes got
significant improvements on specific benchmarks. But most of the gains
which can be obtained require more tuning in the compiler code
generation phase and it's not trivial, if you've seen the size of
the GCC source tree (besides the fact that I can't stand C source
code formatted according to the GNU convention).

In some cases, -Os will even be faster (especially on 603/603e which
have a smaller i-cache and no fancy out of order execution).


Reply to: