[fpc-devel] progress of freepascal for mips

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Fri Jun 8 11:09:09 CEST 2012


Pierre Free Pascal wrote:

>   It is not closely following a specific abi, but for parameters
> it works like this:
>   Up to 6 parameters are passed in registers $r4 to $r9,
> others on the stack starting at offset 24 (=6*4).
> (I had to adapt the 6 parameter very of linux/mips/syscall.inc
> in order to get fpmmap to work).
> 
>   The startup code of the function pushes these registers
> back to the 6 4 byte slots from 0 to 24.
>   It sets $fp register ($r29 or $s8)
> to the previous value of the $sp stack register.
>   This way, function parameters can be accessed by
> offsets to $fp register, while locals or parameters
> of function that will be called inside the function
> are accessed via $sp register.
> 
>   The biggest problem now is that GDB is not
> pleased this, because it find that there is a frame register ($r29)
> so that it computes falsely the address of all locals and arguments...
> 
>   I think that we should add a list of all mips known ABI and
> create a record that lists their specificities,
>   This way, we should be able to convert some constants
> into ABI specific values.

I made a start at trying to get assembler and backend info into the 
Wiki, my intention was to at least have URLs for the various ABIs. I 
rather ground to a halt after getting examples of the assembler format 
together for most targets, if anybody could contribute ABI stuff it 
would be much appreciated.

http://wiki.lazarus.freepascal.org/Assembler_and_ABI_Resources

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