From: | rfg@monkeys.com (Ronald F. Guilmette) |
Newsgroups: | comp.compilers,comp.dsp |
Date: | 14 Mar 1996 17:00:11 -0500 |
Organization: | Infinite Monkeys & Co. |
References: | 96-03-006 96-03-033 |
Keywords: | C, performance |
ravindra@hal.com says...
>I've heard people say so many times, that hand-crafted (assembly) code
>is more compact than compiled C code for microcontrollers or DSPs.
Jens Hansson <jens.hansson@mailbox.swipnet.se> wrote:
>I think this is correct, but some researchers claim that this only
>depends on that the compiler writers are lazy and incompetent...
Nobody who _knows_ hard-working compiler writers would say this.
Nobody who has *been* a hard-working compiler writer would say this.
I would prefer to see it said that compiler writers are just
underpaid, and quite frankly, I actually do think that that is closer
to the truth. (Boy, it's tuff to take an unpopular stand like this in
comp.compilers. :-)
>... Standard C/C++ has problems computing with bits,
>bytes and single precision floats, since the standard says that
>everything should be converted to ints and doubles before computation...
Correction... What the C standard actually says is that the generated
code must ultimately behave AS IF all of these sorts of wideing
conversions had occured. But it never says that you _actually_ have
to do the widenings in practice if you can see that it makes no
difference either way. For example, given:
char c1, c2, c3;
void foobar () { c1 = c2 + c3; }
you don't really have to widen those chars out to ints before (or
after) the addition, and a good compiler writer will only do that if
it results in better, more efficient code (which it won't on most
8-bit processors). --
-- Ron Guilmette, Roseville, CA -------- Infinite Monkeys & Co. ------------
---- E-mail: rfg@monkeys.com ----------- Purveyors of Compiler Test Suites -
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.