Re: C code .vs. Assembly code for Microcontrollers/DSPs ?

rfg@monkeys.com (Ronald F. Guilmette)
14 Mar 1996 17:00:11 -0500

          From comp.compilers

Related articles
[16 earlier articles]
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? koopman@cs.cmu.edu (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? hbaker@netcom.com (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? mac@coos.dartmouth.edu (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-08)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? regnirps@aol.com (1996-03-10)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? rjridder@knoware.nl (Robert Jan Ridder) (1996-03-10)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? rfg@monkeys.com (1996-03-14)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? sberg@camtronics.com (1996-03-14)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? bobduff@world.std.com (1996-03-14)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? bobduff@world.std.com (1996-03-14)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? john.r.strohm@BIX.com (1996-03-15)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-15)
Re: C code .vs. Assembly code for Microcontrollers/DSPs ? cdg@nullstone.com (1996-03-16)
[27 later articles]
| List of all articles for this month |
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 -
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.