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

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sat Aug 24 21:44:38 CEST 2013

Steve wrote:

>  > The point with using Linux as a first target is that you would not need
>  > to implement a new RTL, but only the code generator and the processor
>  > specific RTL code.
> Hmmm! I think it will be more complex than that... Certainly, anything
> related to I/O will need to be drastically rethought, even before it's
> rewritten. The I/O architecture is just too different.

It's not. Linux on 390 (caveat: my experience is on Hercules, but I have 
no reason to believe that the distro I was using had been tailored for 
emulation) looks like Linux on SPARC, Linux on MIPS, Linux on PPC... and 
so on. The only significant departure is that they don't see Ethernet 
hardware, but instead talk SLIP to a gateway provided by Hercules or use 
some sort of offload engine.

>  > The point for gas/ld was simply that we have existing writers for these
>  > two, but writing your own writers for IBM specific tools isn't rocket
>  > science either... But it's another thing you'd need to implement.
> You don't have existing writers! They may be familiar with the basic syntax
> that gas/ld use, but IBM assembler, gas, Assembler F or High Level 
> Assembler
> has a totally different vocabulary. The semantics are also unique. CALL
> exists but is different, RET doesn't exist. JMP and it's variants are 
> called
> B (B for Branch) and the variants are different. What is the difference
> between L and LA? What are L and LA? MOV doesn't exist, there a whole host
> of different instructions for moving data depending upon source, 
> destination
> and format. Do they understand what the 16M line and the 2G bar are and
> their implications for code? And a whole other list longer than my arm. The
> manual that defines the Assembler language is, at last count, 1292 pages of
> A4! All of it different from what your pool of gas coders is familiar with,
> unless they have previously written IBM Assembler, in which case they
> probably used Assembler F or one of it's successors.

STOP. I think that between us we've got a terminology problem: Sven 
wasn't using "writer" to refer to somebody writing assembler code, but 
to an object embedded in the compiler that is tailored for emitting 
assembler statements.

In other words, when we say that an existing assembler writer outputting 
gas-format statements for (say) MIPS or 68K can probably be adapted 
without too much trouble for s390, we aren't referring to coders on the 
development team but to a body of code that comprises a significant 
proportion of the compiler's backend.

I'm skipping over the remainder of the message with minimal comment, 
since the significant detail is that if the initial FPC implementation 
is for Linux than it will obviously have to have the ability to link to 
standard libraries on the same system.

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