This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Backend for PicoBlaze
"Armin Vogl" <Armin.Vogl@gmx.net> writes:
> I would like to ask if it would be possible to write a gcc backend for the
> Xilinx PicoBlaze soft processor.
Porting gcc to an 8-bit microcontroller is not completely impossible,
but it is not easy. gcc was written to generate code for 32-bit
processors, and tends to get in a register crunch on very small
processors. While I didn't look at the PicoBlaze docs at all, small
processors also tend to have specialized addressing modes which tend
to confuse gcc. Fixing these problems in a gcc port tends to put you
into the most complex part of the compiler, which is reload.
> As I have never programmed anything like a compiler and am
> not familiar with gcc, I would like to ask how much time it would
> need to implement a backend. Is it realistic to do it myself or is
> there a place to request the addition of a backend.
>
> Is it realistic for somebody with zero gcc experience to implement a backend
> in a reasonable time (whatever that may mean :) ?
It's obviously hard to say. There is fairly decent documentation and
there are plenty of existing examples. One advantage of a small
processor is that there isn't all that much to implement--it's mostly
debugging. An excellent programmer could probably get up to speed and
do the backend port in a few months. (For comparison, I've written a
few gcc backend ports already, and last year I did a port to a 16-bit
microcontroller in less than a month, but the chip had the advantage
of having 16 registers and only one addressing mode (register
indirect)).
There is no place to request a backend port, other than the e-mail you
sent. Most such requests go unanswered. A backend port is hard
enough that most people wouldn't do one without a good reason.
Ian