From: Simon Wright <simon@pushface.org>
Subject: Re: signature like constructions
Date: 09 Aug 2003 09:32:36 +0100
Date: 2003-08-09T09:32:36+01:00 [thread overview]
Message-ID: <x7vd6ffi63f.fsf@smaug.pushface.org> (raw)
In-Reply-To: 3F337798.2030008@attbi.com
"Robert I. Eachus" <rieachus@attbi.com> writes:
> My favorite example involved the LALR parser generator on Multics.
> Pat Prange was about to go through the gory effort to allow an array
> of Boolean data to span multiple segments. I asked why he didn't
> use a packed representation, and he answered at length. But once we
> got all the requirements written down, it turned out that the major
> operation on the array was a search in a particular row for the
> first set bit. After another half hour of discussion Pat ran off to
> implement the new version. To make a long story short, it used the
> translate and test instruction in the character string processing
> unit. The single instruction generated used a 512-element table to
> look up the first non-zero (9-bit) byte detected, and of course the
> values in the table were the index of the first set bit. Six lines
> of PL/I carefully written so the code generator would emit a single
> instruction!
>
> The net result was to decrease the running time for the tool by over
> 90%, from just over 20 minutes to generate an optimized LALR1 parser
> for Ada, to just under two minutes. But the point to take away is
> not that PL/I was great for this purpose, or Multics. I could write
> the same code in COBOL for an IBM mainframe, or C for an x86 or
> 680x0 chip. (Or in Ada, or just about any language that let you get
> close to the metal when necessary.) The expertise required is in
> first figuring out the actual machine code you want generated, then
> knowing the compiler internals well enough to make it happen.
At some point you need (a) a machine-independent solution to the
problem, (b) a machine-dependent optimisation. Clearly it's good if
the machine-independent solution is also efficient, but it seems to me
like overkill to write 6 very clever lines in the hope that the
compiler (and future revisions) will always emit one machine code
instruction. Why not use an assembler insert?
next prev parent reply other threads:[~2003-08-09 8:32 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-30 11:32 XML DOM Binding for Ada 95 - matter of style DENNY VRANDECIC
2003-07-30 12:33 ` Martin Dowie
2003-07-30 15:20 ` Denny Vrandecic
2003-07-30 16:33 ` Stephen Leake
2003-07-31 10:57 ` Marin David Condic
2003-07-31 11:27 ` Preben Randhol
2003-07-31 13:10 ` Matthew Heaney
2003-07-31 19:04 ` Simon Wright
2003-08-02 14:40 ` Matthew Heaney
2003-07-31 20:25 ` Randy Brukardt
2003-08-01 11:46 ` Marin David Condic
2003-08-02 3:40 ` Matthew Heaney
2003-08-02 12:08 ` Marin David Condic
2003-08-02 14:46 ` Matthew Heaney
2003-08-02 21:25 ` Ed Falis
2003-08-05 19:59 ` Marin David Condic
2003-08-03 16:42 ` Matthew Heaney
2003-08-04 8:04 ` Dmitry A. Kazakov
2003-08-05 8:00 ` Georg Bauhaus
2003-08-05 11:46 ` Dmitry A. Kazakov
2003-08-05 13:34 ` Georg Bauhaus
2003-08-06 9:03 ` Dmitry A. Kazakov
2003-08-06 18:15 ` signature like constructions (was: Re: XML DOM Binding for Ada 95 - matter of style) Georg Bauhaus
2003-08-07 10:12 ` Dmitry A. Kazakov
2003-08-07 16:22 ` signature like constructions Georg Bauhaus
2003-08-08 8:31 ` Dmitry A. Kazakov
2003-08-08 10:12 ` Robert I. Eachus
2003-08-08 13:29 ` Dmitry A. Kazakov
2003-08-08 19:37 ` Robert I. Eachus
2003-08-09 0:58 ` Alexander Kopilovitch
2003-08-09 7:39 ` Robert I. Eachus
2003-08-10 1:30 ` Alexander Kopilovitch
2003-08-10 4:11 ` Robert I. Eachus
2003-08-11 10:25 ` Dmitry A. Kazakov
2003-08-08 23:44 ` Alexander Kopilovitch
2003-08-11 9:54 ` Dmitry A. Kazakov
2003-08-11 14:59 ` Alexander Kopilovitch
2003-08-12 9:54 ` Dmitry A. Kazakov
2003-08-13 22:28 ` Alexander Kopilovitch
2003-08-09 8:32 ` Simon Wright [this message]
2003-08-09 15:32 ` Robert I. Eachus
2003-08-07 12:52 ` XML DOM Binding for Ada 95 - matter of style Matthew Heaney
2003-08-07 15:03 ` Dmitry A. Kazakov
2003-08-07 12:28 ` Matthew Heaney
2003-08-05 20:05 ` Marin David Condic
2003-07-30 16:34 ` Martin Dowie
2003-07-30 17:54 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox