Related articles |
---|
[5 earlier articles] |
Re: C as assembly language felixundduni@freenet.de (felix) (2001-04-10) |
Re: C as assembly language fjh@cs.mu.OZ.AU (2001-04-10) |
Re: C as assembly language fjh@cs.mu.OZ.AU (2001-04-12) |
Re: C as assembly language vbdis@aol.com (2001-04-12) |
Re: C as assembly language felixundduni@freenet.de (felix) (2001-04-14) |
Re: C as assembly language fjh@cs.mu.OZ.AU (2001-04-14) |
Re: C as assembly language rhyde@transdimension.com (Randall Hyde) (2001-04-14) |
Re: C as assembly language vbdis@aol.com (2001-04-15) |
Re: C as assembly language jim.granville@designtools.co.nz (Jim Granville) (2001-04-18) |
Re: C as assembly language joachim_d@gmx.de (Joachim Durchholz) (2001-05-03) |
Re: C as assembly language joachim_d@gmx.de (Joachim Durchholz) (2001-05-07) |
Re: C as assembly language Hans_Boehm@hp.com (Hans Boehm) (2001-05-07) |
Re: C as assembly language jthorn@galileo.thp.univie.ac.at (2001-05-13) |
[2 later articles] |
From: | "Randall Hyde" <rhyde@transdimension.com> |
Newsgroups: | comp.compilers |
Date: | 14 Apr 2001 17:17:46 -0400 |
Organization: | Posted via Supernews, http://www.supernews.com |
References: | 01-04-027 01-04-085 |
Keywords: | C, assembler |
Posted-Date: | 14 Apr 2001 17:17:46 EDT |
"VBDis" <vbdis@aol.com> wrote in message news:01-04-085@comp.compilers...
> "Joachim Durchholz" <joachim_d@gmx.de> schreibt:
>
> >Hmm... there are a few additional cases where C is simply inappropriate:
>
> C was /designed/ as a replacement for assembly language, and IMO this
> goal is reached nowadays, too. No real assembler will define or deal
> with exceptions and like constructs, which are beyond the creation of
> CPU instructions.
Guess it depends upon how you define "real" assembler. HLA (the High
Level Assembler) certain provides syntax for handling exceptions. HLA
doesn't feel any less "real" because it provides this capability
(after all, if it offends your sensibilities, you can always ignore
the exception handling syntax). Note, btw, that I implemented the
same syntax HLA uses within MASM using macros. Few people would argue
that MASM is not a real assembler.
> IMO it's easier to make an assembler understand C, than to make an C
> compiler understand machine specific constructs. No smilie here,
> opposed to my first intention. C was designed for a specific set of
> processors, existing at that time (many decades ago), not at all for
> processors in general.
OTOH, most modern processors in wide use were certainly designed to
execute C code efficiently. Indeed, I largely suspect that the
architectural changes appearing in more modern processors are more
largely responsible for the narrowing gap between compiler output and
human-written assembly code performance than the quality of
optimizers. When CPU manufacturers like Intel depreciate all the old
cool instructions by making them slow (and others just don't include
them), it really begins to limit the options assembly programmers have
(and limits them to the same sequences the compilers would generate).
This isn't necessarily a bad thing, of course, just an explanation.
Randy Hyde
[Many of those old cool instructions looked to me like they were
suffering from the Vax fallacy, complex instructions that might make
it easy to write or generate code for some constructs, but are really
hard to make run fast. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.