On Sun, 30 Dec 2001 23:01:50 +0100, Richard Zidlicky wrote:

> On Sat, Dec 29, 2001 at 07:39:33PM +0100, Thierry Godefroy wrote:
> > On Sat, 29 Dec 2001 19:13:48 +0100 (CET), [EMAIL PROTECTED] wrote:
> > 
> > > Hi!
> > > 
> > > I have measured the time it takes to boot Linux on Q40 (starting at the
> > > penguin):
> > > 
> > > Kernel 2.2.17 : 62 sec
> > > Kernel 2.4.17 : 36 sec
> > > 
> > > I used the same installation, of course.
> > > Thierry, your kernel seems to be mega fast.
> > 
> > Well, Linux v2.4 is known (and designed) to be faster than v2.2, but
> > beyong that, I used the 68060 optimisation flag (-m68060) to compile
> > the Q60 kernel and the -m68040 flag for the Q40 kernel: the proper
> > flag can be selected when configuring the kernel (make menuconfig
> > or make xconfig), by selecting ONLY ONE of the 68020 / 68030 / 68040 /
> > 68060 support options.
> 
> It alwasy worth doing that.
> 
> >  If you select two of them (e.g. 68040 & 68060
> > for the Qx0), then no optimization flag is used at all (!) for the
> > compilation (thus defaulting to a 68000-compatible code and also
> > probably avoiding any 68000 instruction that would not work on higher
> > processor, e.g MOVE.W SR,Dn which is priviledged on 68020+).
> 
> not correct, we use gcc configured for linux-m68k which has DEFAULT_TARGET
> set to 68020. 

I was not aware of this fact...

> So the effect of actually using -m68040 will be next to zero for non-FPU code.

But even 68020, 68040 and 68060 have got significant differences between them
(cache size and organization, MMU functionnalities, a few instructions differ
also, some others running more or less faster depending on the processor model,
etc...) for a GOOD optimizing compiler (or a good assembler programmer ;-) to
take advantage of a targeted optimization...

> The reason why selecting a single CPU variant makes the kernel faster is
> that the differences between the m68k CPU's wrt cache, MMU, FPU and exception 
> handling are rather big, so each CPU needs its own cache and MMU handling 
> code.

Sure !  BTW don't even think (or try) to run a 68040 optimized kernel on a Q60:
it won't even initialize (because of the MMU and registers initialization at
the very start of the kernel code) !

> This code is mostly inlined and if support for more CPU variants is 
> compiled in the distinction has to happen at runtime.

This is a very valid point, although a well optimized code should test for the
processor just once and then be able to just test a flag (or even self-modify
itself !) IOT choose the good inlined part of the cache/MMU/exception processing
routines to run.

> It has also significant impact on code size.

I did not check this, but it seems logical that it has some impact...

Thierry.

Reply via email to