Bernd Oppolzer wrote:

That's what the existing compilers on z-Arch normally do - they don't
compile the PUSH instructions one by one as in the first example, but in contrast, as there are no PUSH/POP instructions provided by the hardware, they do some efforts to do at least only one increment to the stack pointer (like outlined above) which
is done in the procedure or function prologue.

Now my question is:

do you think that this is a major problem for a FPC port to z-Arch?

No, but it's important to adhere to the calling conventions for the various target operating systems. As a particular example, on Linux compiled code /has/ to be able to link (statically or dynamically) to libraries such as the resolver that maps computer names to IP addresses.

Are my assumptions right so far?

I think so. The important thing is that Pascal mandates a stack due to the prevalence of recursion, and (in the case of Linux) the ABI specifies a combined parameter/return-address stack. The question at this point is obviously what registers the ABI reserves as stack and frame pointers.

Should we start with an easy solution and check the performance implications later?
Maybe there is a clever solution to that ...

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

[Opinions above are the author's, not those of his employers or colleagues]
_______________________________________________
fpc-devel maillist  -  [email protected]
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to