[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] MiNTLib for ColdFire
It looks like we are going to get a new Atari-clone
based on a ColdFire CPU :-)
http://acp.atari.org/news.html
http://acp.atari.org/news_de.html
http://acp.atari.org/news_fr.html
That computer will be able to run legacy 680x0 TOS programs thanks to an
emulation layer, but it would be nice if we could compile programs
specifically for ColdFire in order to get the maximum performance.
Any recent binutils/GCC built for the m68k target can produce code for any
ColdFire variant. There are several models of ColdFire CPUs, the most
powerful are the family 547X, based on the V4e core. In my latest build of
GCC 4.4.0, I included multilib support for the ColdFire V4e core, it can be
used by compiling with the "-cfv4e" option.
So we currently have the libraries provided by GCC (namely, libgcc.a and
libstdc++.a) already available. I checked that the 2-instruction stub inside
the extended MiNT header of the executables produced by the binutils is
compatible with the ColdFire.
We do not currently have a libm.a for the ColdFire, but I hope fdlibm or PML
will recompile nicely for it.
So the only big missing part for full ColdFire support is the MiNTLib.
I propose we start working on it.
We can start by adding WITH_V4E_LIB=no in configvars, and adding support in
the makefiles to build that new library variant. So it will not be built by
default, it will not break any compatibility.
The ColdFire CPU is build by Freescale Semiconductor.
It is actually the new name of Motorola Semiconductor !
ColdFire CPUs are basically like the 68030, a lot faster, cheaper, but with
a *reduced* instruction set. It is not a problem for C programs, since it is
the job of GCC to convert C to ASM, avoiding the missing instructions. But
assembler programs must be manually adjusted. It is also the case for C
programs with inline assembly, like some deep parts of the MiNTLib.
The homepage of the ColdFire 547X CPU is here :
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCF547X&nodeId=0162468rH3YTLC00M93426
You can get a lot of documentation there, especially the "ColdFire Family
Programmer's Reference Manual" with detailed instruction set.
http://www.freescale.com/files/dsp/doc/ref_manual/CFPRM.pdf?fpsp=1
Adding ColdFire support for assembler sources is usually easy (except for
some tricky cases). It requires to surround 680x0 specific instructions with
#ifdef, and to add ColdFire instructions in the alternative. That way, the
MiNTLib performance will absolutely not be decreased, while having a better
compatibility.
I hope you agree for this enhancement of the MiNTLib, and you will enjoy the
speed of that new executables on the new ColdFire computer.
--
Vincent Rivière