Re: Some clarification on "Pre-Parsers" and other bits
- From: "f0dder" <f0dder_nospam@xxxxxxxxxxxxxxxx>
- Date: Tue, 23 May 2006 13:35:46 +0200
santosh wrote:
f0dder wrote:
zcoder wrote:
To ME C is a parser, it parses the C language into assembly text
which is then feed to a assembler.
GNU GCC does this, and a few others as well. Afaik most decent
compilers don't, they tend to perform their operations on the
pcode/AST, and then convert this directly to machine code instead of
going through AST->ascii assembly mnemonics->machine code. An asm
listing is just a different backend from the machine code backend.
At least I've seen no indication that MS Visual C++ (version 6.0 and
onwards) do a silly intermediate ascii-asm step.
I confess I don't know much with regard to language translators, their
theory and implementation. But why do you feel that it is "silly" to
go through an intermediate assembler step? Is it merely a matter of
loss of speed or does it affect the amount of optimisation the
compiler can perform?
A loss of speed as well as unncessary step. To do decent optimizations, the
compiler will work on an abstract representation of the source program
anyway for a decent amount of it's (processor-independent) optimizations.
Then there's the processor specific optimizations and register allocation
etc. And finally the machine code is generated - either directly, or with
asm intermediate.
I guess the justification for asm intermediate is that "we can then use a
single assembler to output multiple diffent object formats" and requiring
somewhat less code in the compiler. And "processors and harddrives are so
fast these days that the indirection doesn't matter, and we can even pipe
the assembly output to GAS without going through a disk file". *shrug*.
.
- Follow-Ups:
- Re: Some clarification on "Pre-Parsers" and other bits
- From: randyhyde@xxxxxxxxxxxxx
- Re: Some clarification on "Pre-Parsers" and other bits
- From: Dragontamer
- Re: Some clarification on "Pre-Parsers" and other bits
- References:
- Some clarification on "Pre-Parsers" and other bits
- From: greg . johnston
- Re: Some clarification on "Pre-Parsers" and other bits
- From: randyhyde@xxxxxxxxxxxxx
- Re: Some clarification on "Pre-Parsers" and other bits
- From: zcoder
- Re: Some clarification on "Pre-Parsers" and other bits
- From: f0dder
- Re: Some clarification on "Pre-Parsers" and other bits
- From: santosh
- Some clarification on "Pre-Parsers" and other bits
- Prev by Date: Re: masmforum temporarily down
- Next by Date: Re: I wonder who was stupid enough to hack the masmforum server ?
- Previous by thread: Re: Some clarification on "Pre-Parsers" and other bits
- Next by thread: Re: Some clarification on "Pre-Parsers" and other bits
- Index(es):
Relevant Pages
|