Related articles |
---|
[18 earlier articles] |
Re: Why do we still assemble? mfx@cs.tu-berlin.de (1994-04-11) |
Re: Why do we still assemble? johnm@cory.EECS.Berkeley.EDU (1994-04-11) |
Re: Why do we still assemble? conway@munta.cs.mu.OZ.AU (1994-04-11) |
Re: Why do we still assemble? rcskb@minyos.xx.rmit.EDU.AU (1994-04-12) |
Re: Why do we still assemble? bill@amber.ssd.csd.harris.com (1994-04-12) |
Re: Why do we still assemble? bill@amber.ssd.csd.harris.com (1994-04-12) |
Re: Why do we still assemble? pardo@cs.washington.edu (1994-04-13) |
Re: Why do we still assemble? hbaker@netcom.com (1994-04-13) |
Re: Why do we still assemble? ok@cs.rmit.oz.au (1994-04-13) |
Re: Why do we still assemble? rfg@netcom.com (1994-04-13) |
Re: Why do we still assemble? rfg@netcom.com (1994-04-13) |
Re: Why do we still assemble? zstern@adobe.com (1994-04-13) |
Re: Why do we still assemble? mps@dent.uchicago.edu (1994-04-14) |
[9 later articles] |
Newsgroups: | comp.compilers |
From: | pardo@cs.washington.edu (David Keppel) |
Keywords: | assembler, design |
Organization: | Computer Science & Engineering, U. of Washington, Seattle |
References: | 94-04-032 94-04-042 |
Date: | Wed, 13 Apr 1994 01:23:47 GMT |
Nand.Mulchandani@Eng.Sun.COM writes:
>[Object code formatting complicates the code generator
> since it can't just do `printf', it has to create a node with
> the right information.]
Warning: wild speculative opinions, no references or experiments to
back them up.
(`printf' here is used in the vernacular; both the `before' and
`after' versions will want to avoid varargs routines in general.)
Although interface complexity may be a problem in practice, it should,
in principal, be possible to replace a call to `printf' with a
stylized call to the appropriate post-parsing code in the assembler
and rely on the assembler code to build the right nodes. For example:
printf ("and %s, %s, %s\n", reg[r->n], string(r->const),
reg[r->n]);
could be replaced with
emit (AND, reg[r->n], string(r->const), reg[r->n])
Here, `emit' generates a bunch of tokens that are passed --
``pre-tokenized'' -- to the assembler. The assembler still needs to
do parsing, but the lexing phase is avoided. The interface could even
take care of some of the parsing:
emit (AND, REG0|CONST1|REG2, r->n, r->const, r->n);
This is still probably 2X slower than a carefully-tuned interface,
but the motivation is that most time is spent in character handling,
and this ``simple approach'' gets rid of a lot of that, so it may
still do the trick.
;-D on ( My token contribution to the discussion ) Pardo
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.