[fpc-devel] progress of freepascal for mips
Pierre Free Pascal
pierre at freepascal.org
Fri Jun 8 10:24:58 CEST 2012
> -----Message d'origine-----
> De : fpc-devel-bounces at lists.freepascal.org [mailto:fpc-devel-
> bounces at lists.freepascal.org] De la part de Fuxin Zhang
> Envoyé : vendredi 8 juin 2012 02:07
> À : Jonas Maebe
> Cc : FPC developers' list
> Objet : Re: [fpc-devel] progress of freepascal for mips
> > Fuxin Zhang wrote on Sat, 02 Jun 2012:
> >> With the attached patch (against revision 21440), most of the tests
> >> can
> >> now pass, for example, the test directory has only the following
> >> failinglist:
> > When committing/submitting patches in the future, please split them up
> > into smaller independent patches. That makes it much easier to review
> > them.
> OK, I will take some time to clean up things and split them into
> independent trunks. Florian has open a branch for me, I will try to do it
> in the branch with clear log.
> These days I am fight with the parameter passing. It is almost mips O32
> compatible, only five of the test/cg/ still fail.
> foxsen at ubuntu-zfx:/software/data/fpc/tests$ cat
I committed to trunk your changes together with
a few changes to cpupara that allow me to generate
a compiler (not yet operational, but it"s going forward).
Florian asked be to commit it.
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.
More information about the fpc-devel