Port-atari archive

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

Re: gcc -m68060 option in kernel Makefiles



From: Ignatios Souvatzis <is%netbsd.org@localhost>

> <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/

From: Ignatios Souvatzis <is%netbsd.org@localhost>

Thanks for the detailed clarification. So, the most best form would 
probably be (even though gcc may use the same effective instruction set and 
scheduling for 68060 and 68020-60, in which case it would make no 
difference).

if !empty(IDENT:M-DM68060)
if !empty(IDENT:M-DM68030)
CMACHFLAGS=     -m68020-60 -Wa,-m68030
else
CMACHFLAGS=     -m68060 -Wa,-m68030
endif
else
CMACHFLAGS=     -m68030
endif
 
I though the 040 added Move16? Whether or not thats useful in kernel or 
even used by gcc is another matter...



Home | Main Index | Thread Index | Old Index