|
From: Philipp K. K. <pk...@sp...> - 2025-02-08 10:25:59
|
Am 08.02.25 um 10:34 schrieb Mark Burkley: > Hi, > > I maintain a backend for the TMS9900 CPU for gcc and am wondering if it > is possible to add it as a backend to sdcc. > > The ‘9900 is a 16-bit CPU that powered the Texas Instruments TI99/4A > computer (and others) in the 1980s. It has a few quirks, mostly to do > with byte ordering, that don’t play nicely with gcc and of course > maintaining for a project as big as gcc is a lot of work. > > It was suggested at a recent user group meeting that sdcc might be a > better compiler to use. Are there any howtos or other docs on where to > start adding a new backend? > > The gcc 4.4 backend is here https://github.com/mburkley/tms9900-gcc/ > blob/main/dev/gcc-4.4.0/gcc/config/tms9900/tms9900.md <https:// > github.com/mburkley/tms9900-gcc/blob/main/dev/gcc-4.4.0/gcc/config/ > tms9900/tms9900.md> > > Many thanks > > Mark There is a bit of information about adding a port at https://sourceforge.net/p/sdcc/wiki/Adding%20a%20port/ My main worry here is the large number (16) of large (16 bit) registers in the TMS9900. A Chaitin-style graph coloring register allocator, as used by GCC, is most likely better for that than the register allocators we currently have in SDCC. Also, I have no idea how much work it would be to get your existing GCC 4.4 backend updated for current GCC, so it is hard for me to compare with the effort of creating a new SDCC port. I haven't looked into the byte orderings yet. But "a few quirks", or a few more, is something you'll find in all SDCC targets. Philipp |