Port-amiga archive

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

m68060 flags for optimisation



> > Personally, I prefer to do all of me installs via the pkgsrc tree,
> > as I prefer my localbase to be /usr/local, not /usr/pkg, and I
> > prefer to optimise for each processor (CFLAGS+=-m68060 and
> > M68060=YES, for example).
>
> CFLAGS+=-m68060
> M68060=YES
>
> Do both flags just _optimize_ the code for 68060 in terms of faster
> execution, but still executable on other 680x0 CPUs, or does it mean
> that the code _only_ runs on 68060?

>From (gcc.info), M680X0  Options:
      This option inhibits the use of 68020 and 68881/68882 instructions
      that have to be emulated by software on the 68060.  Use this
      option if your 68060 does not have code to emulate those
      instructions.

Since there are no userland instructions on the m68060 that are not on the
m68020-040, this code will work on other processors. However, things like
64 bit multiply and divide and floating point formats not natively
supported on the m68060 won't be used.

The M68060=YES option is used in a different way: when you compile
software that has assembly (doesn't violate the NetSBD philosophy as long
as there's generic code should you compile on some mystery CPU), the
compiler can include 680x0 code, 68040 code, or 68060 code based upon
these flags.

This was extremely important for SSH and other related packages because
they use assembly which made use of the 64 bit multiply and divide
instructions. When those instructions were emulated on the 68060, the
result  was dreadfully slow, even slower than if generic C had been used
in place of assembler.

So binaries built for an m68060 should work fine on an m68040, but the
reverse is probably not a good idea.

John Klos




Home | Main Index | Thread Index | Old Index