[fpc-devel] Re. z370 Cross Compilation, Pass 2 of ....

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Sep 1 21:37:02 CEST 2013

Bernd Oppolzer wrote:
> Am 01.09.2013 20:30, schrieb Mark Morgan Lloyd:
>> The problem here is that compiler design has moved on a lot since 
>> Wirth's day. It's not difficult to write a compiler using e.g. 
>> recursive descent or Meta-II which emits instructions for an abstract 
>> stack-based machine, and that might be a good match for a CPU with a 
>> small number of general-purpose registers. However it can be extremely 
>> difficult to optimise this for a modern CPU with a large register 
>> file, it's far more effective to give the frontend a rough idea of how 
>> many registers the backend has available to it and to warn it about 
>> known peculiarities.
> Agreed, but:
> you write:
> it's far more effective to give the frontend a rough idea ...
> the frontend?

For the purpose of this discussion: the compiler source files in e.g. 
/usr/local/src/fpc/fpcbuild/fpcsrc/compiler (but not in subdirectories). 
Note assembler writers in ag*pas, which are somewhat scattered.

The CPU-specific backends are in subdirectories, e.g. 
../compiler/sparc, .../compiler/mips and so on.

I wanted to avoid using terms like "portable", "non-machine-specific" 
and so on because the point has been made that there isn't an entirely 
clean division.

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list