From: | fink@post.tau.ac.il (Udi Finkelstein) |
Newsgroups: | comp.compilers,comp.dsp |
Date: | 5 Mar 1996 12:24:31 -0500 |
Organization: | Tel-Aviv University Computation Center |
References: | 96-03-006 |
Keywords: | optimize, code, DSP |
ravindra@hal.com (Ravindra Divekar) wrote:
>I've heard people say so many times, that hand-crafted (assembly) code
>is more compact than compiled C code for microcontrollers or DSPs.
>
>So where is the problem?
>
>Is it a limitation of existing compiler technology (so much for the
>optimization hype) ?
Most DSP's are optimized for handcrafted assembly. Some has on chip
code stack which is only a few levels deep for subroutine calls. You
can't assume it's deep enough for any arbitrary code (and you can't
make the stack segment larger...). Most DSP's doesn't have enough
general purpose registers, and in fact don't have any notion of a data
stack or a stack frame! The problem can be solved in the same way as
it was solved in the 8051 C compilers (give the programmer better
control), analyze the call tree (see if it can fit the small 256 byte
stack), place automatic variable in fixed memory addresses if no
recursion is done, etc.
>Is it the choice of high level language i.e. C/C++ that matters ?
C++ is even worse. why bother?
>Is it the nature of application (scientific/real-time/control/float.pt)
>that creates porting problems?
No, it's the nature of the compiler vs. the nature of the chips!
>Or is it just the architectural features of typical microcontrollers that
>make things difficult ?
Yes. They are optimized for small programs, and not for general
purpose compiler support (arbitrary large stacks, uniform register
bank, indexing variables off a stack pointer, etc.)
Udi
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.