David Brown wrote:
> The PIC16, on the other hand, is a brain-dead cpu that fits very badly
> with the structure used by most compilers (open source or otherwise) -
> it really needs a very specialised compiler to get good object code.
> The same applies to cores like the 8051, the COP8, and many small DSP
> devices.
Your point is well taken but...
C can map quite well on the extended 14 bit ISA used in some of the
PIC16 micros. The problem with most of the generic compiler implementations
is they are designed for a different type of processor and most of the
generic optimizations don't apply. An example is register spilling when
a processor has a primary accumulator and maybe an index register
doesn't map very well. They are other code generation approaches
built around data flow that have good mapping to micros. One specific
issue that rarely gets mentioned is that there are compilers that do port
quite well between embedded systems processors but are generally found
as part of commercial tools companies IP.
As an example a few weeks ago some one forwarded a link to
DCPU 16 a virtual 16 bit processor
http://0x10c.com/doc/dcpu-16.txt.
In 3 or 4 evenings I created a C compiler port for this ISA using our
tools that beat many benchmarks for several commercial processors. It
was a reasonable implementation even before ISA specific optimization.
It is possible to create generic tools that are oriented to the
architectures found in embedded systems.
Walter Banks
Byte Craft Limited