Port-atari archive

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

Re: gcc -m68060 option in kernel Makefiles



Hi,

On Sat, Jan 17, 2009 at 11:30:05PM +0000, David Brownlee wrote:

> Its a pity gcc doesn't have an -m68030-60, as that would be perfect in one 
> case...
> 
> I think we should change Makefile.atari from
...
> to something like:
>  
> if !empty(IDENT:M-DM68060)
> if !empty(IDENT:M-DM68030)
> CMACHFLAGS=     -m68020-60
> else
> CMACHFLAGS=     -m68060
> endif
> else
> CMACHFLAGS=     -m68030
> endif

<intercal>
       DO NOT CMACHFLAGS=     -m68020-60
PLEASE DO NOT CMACHFLAGS=     -m68060
</intercal>

There are no 68060 specific instructions which the compiler creates - 
other than FPU stuff (which are the same as for the 68040).

Userland-wise:

-m68060 allows the 68040/60 FPU instructions, and forbids the 
instructions that are NOT implemented in the 68060

-m68020-60 does not use the 68040/60 FPU instructions and forbids
the instructions not implemented on 68060

If you don't believe me, read the docs (they're 300km away from me,
so technically, I could be wrong) and correct me if necessary.

We use m68030 assembler, because of the inlined assembler for 68030
MMU access (which is also the subset of 68020/68851 we use), and
access 68040 and 68060 by hex code. That's the only magic why the
-Wa,-m68030 is used - the assembler shall recognize those MMU
instructions.

You might want to tell the compiler about specific CPUs if you only
compile for one of them, in the hope that it knows about pipeline
behaviour and can optimize the code, but you have to use -Wa,-m68030
in any case to make the assembler recognize the MMU and cache inline
assembler instructions used. 

This one:

> if empty(IDENT:M-DM68060)
> CMACHFLAGS=     -m68020
> else
> CMACHFLAGS=     -m68060 -Wa,-m68030
> endif

is technically wrong - -m68020-60 should be used, but wasn't
available when we wrote the 060 support, and it doesn't matter, as
we don't use the FPU in the kernel. I repeat - the 68060 has *less*
integer instructions, *not* more.

Major effect:

-m68020 code is faster in the filesystem, for example, on 
68020, 030 and 040. (32x32->64bit mul. 64/32->32bit div, maybe movep)

but those instructions trap on the '060.

Regards,
        Ignatios
-- 
seal your e-mail: http://www.gnupg.org/


Home | Main Index | Thread Index | Old Index