CC> OK. Here's the deal. Way back when, compiler specialists implemented
CC> an idea called bootstrapping. What's bootstrapping? You break a
compiler
CC> into 5 different section. The later sections are machine dependant,
t
Actually, boot strapping implies starting with a very small and limited
version and use that to compile a more complicated version. After a
couple of times, you've managed to write the entire compiler on a new
machine with some very crude initial tools.
Generally, that first stage was a very portable one that either
generated some sort of interpreted code and you needed to just write an
interpreter on the target machine (like with UCSD pascal) or did have a
very generic output section, like with the classic Small-C.
Many compilers were and are done the way you describe, including GNU C.
Not all though. Some never need or are intended for porting. Those
include things such as Borelands Turbo C, etc.
Some newer, more sophisticated compilers aren't done that way either.
From what I've heard, the types of optimizations and instruction
reordering and RISCification/CISCification require too much knowledge
sharing between the language parser, code generator and optimizor, and
it's simply easier and more efficient to remove most of the portability
and just 'be done with it'.
CC> The optimization spoken of lately resides in the code generator for
CC> machine specific optimization.
To a degree. The choice between coding for the array type indexing used
or internally converting it to pointers has to be done a bit higher up.
Also, the types of optimizations being descussed were more along the
lines of tuning your code for the specific way your single compiler
behaves. You are hardwiring your program to a particular version of a
particular compiler.
As for the other type optimizations... Well, he was also using a 486, so
that playing field was level. The differences were caused by 1)
differences in the compiler and the code the generate (most important)
and 2) differences in the system (cache etc.) and 3) differences in the
brands of 486 cpus.
--- QScan/PCB v1.19b / 01-0162
---------------
* Origin: Jackalope Junction 501-785-5381 Ft Smith AR (1:3822/1)
|