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

Bernd Oppolzer bernd.oppolzer at t-online.de
Sun Sep 1 20:46:06 CEST 2013

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?

In my understanding the frontend of the compiler is the part that reads
the source (scanner, parser) and generates a compact representation
of the source - and different tables with identifiers, structure layouts 

The commercial IBM compilers even have different frontends - one
for PL/1, one for C - but when looking at the internals, it is the same

The need to know about the properties of the target machine appears
later, when it comes to code generation. This is in my opinion what the
backend does ...

but we will see ... I guess, the proper limit between frontend and backend
and the correct definition will always be subject of discussions.

Kind regards


More information about the fpc-devel mailing list