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

Sven Barth pascaldragon at googlemail.com
Sat Aug 24 23:43:39 CEST 2013


On 24.08.2013 21:44, Mark Morgan Lloyd wrote:
> 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.
>

Exactly. On Linux we'd simply use the Linux I/O API which is already 
implemented in FPC. This is why it's a good idea to use Linux at first: 
less work on the RTL.

>>  > 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.

Exactly. Thank you for explaining. :)

> Elaborate enough?

Yes, it was. But Pascal is a nieche language currently, so we need to be 
grateful already that we can use C libraries without much problems... 
also FPC comes with some header conversions already included, like MySQL 
including a database connection wrapper for TDataset ;)

Regards,
Sven



More information about the fpc-devel mailing list