Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2012-06

progress of freepascal for mips

37 messages · 10 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Fuxin Zhang

hi everybody,

With the attached patch (against revision 21440), most of the tests can now pass, for example, the test directory has only the following failinglist:

cat
faillist.testlog
test/cg/taddcurr //the Currency support is broken
test/cg/tcalext //no ctest.o
test/cg/tcalext3
test/cg/tcalext4
test/cg/tcalext5
test/cg/tcalext6
test/cg/tcnvint4
test/cg/tcnvint6
test/cg/tcppcl1
test/cg/tcppcl2
test/cg/tdivz2
test/cg/tnot
test/cg/tprintf
Note: This test requires a C library
test/cg/tprintf2
Note: This test requires a C library
test/cg/treadwrt
test/cg/tumin
test/talign2
test/tbrtlevt
test/tclass8

the related changes include:
commit 14d7ae388fd5b81300a69d277089c991c13fa0be
Author: Zhang Fuxin
Date: Wed Jun 1 19:12:43 2011 +0800

don't define cpuflags for mips
is_calljmp should include float branches: BC1T/BC1F no likely branch support: delete bc1tl/bc1fl for now new implementation for getting next fpu registers for LDC1/SDC1

commit 5d51e051a8979563af6b7d096381192e3d1b9b56
Author: Zhang Fuxin
Date: Fri Jun 1 11:34:51 2012 +0800

Commit all accumulated fixes:
1, add -Xs- -g to Makefile to retain symbols and debug info (removed) 2, systems/i_linux.pas: first_parm_offset set to 0 3, rtl/inc/systemh.inc: FPC_HAS_INTERNAL_SAR_DWORD for mips 4, rtl/linux/{ostypes.inc, linux.pp, oldlinux.pp}, macro definitions for mips: MAP_xxx
5, rtl/linux/mips/syscall.inc: don't use second stack 6, mips/*:
remove the use of NR_TCR*, allocate temporary registers instead use fake instructions A_BA/A_BC to handle all kinds of branches, remove other condition branch instructions, remove all likely branch
add support for boolean64
fix ldc1/sdc1 next register calculation
use r25 for interface call to better suite abi
fix inverse_cond
add bc1t/bc1f to is_calljmp

The next major one should be parameter passing, and then the PIC support.

Thank you for all your kind help.

Regards

Reply by email

Marco van de Voort
to Fuxin Zhang

In our previous episode, Fuxin Zhang said:

4, rtl/linux/{ostypes.inc, linux.pp, oldlinux.pp}, macro definitions for mips: MAP_xxx

Oldlinux is deprecated, and not even compiled by default anymore. Please consider it frozen, and please don't add anything to it. (it never has been truly architecture independent anyway).

It is only still in SVN to help people migrate old 1.0.x sources which are all x86.

Reply by email

Leonardo M. Ramé
to Fuxin Zhang: With the attached patch (against revision 21440), most of the tests can now pass, for…
Show quoted text 74 lines
________________________________ From: Fuxin Zhang To: FPC developers' list Sent: Friday, June 1, 2012 9:16 PM Subject: [fpc-devel] progress of freepascal for mips hi everybody,   With the attached patch (against revision 21440), most of the tests can now pass, for example, the test directory has only the following failinglist: cat faillist.testlog test/cg/taddcurr //the Currency support is broken test/cg/tcalext  //no ctest.o test/cg/tcalext3 test/cg/tcalext4 test/cg/tcalext5 test/cg/tcalext6 test/cg/tcnvint4 test/cg/tcnvint6 test/cg/tcppcl1 test/cg/tcppcl2 test/cg/tdivz2 test/cg/tnot test/cg/tprintf Note: This test requires a C library test/cg/tprintf2 Note: This test requires a C library test/cg/treadwrt test/cg/tumin test/talign2 test/tbrtlevt test/tclass8 the related changes include: commit 14d7ae388fd5b81300a69d277089c991c13fa0be Author: Zhang Fuxin Date:   Wed Jun 1 19:12:43 2011 +0800     don't define cpuflags for mips     is_calljmp should include float branches: BC1T/BC1F     no likely branch support: delete bc1tl/bc1fl for now     new implementation for getting next fpu registers for LDC1/SDC1 commit 5d51e051a8979563af6b7d096381192e3d1b9b56 Author: Zhang Fuxin Date:   Fri Jun 1 11:34:51 2012 +0800     Commit all accumulated fixes:      1, add -Xs- -g to Makefile to retain symbols and debug info (removed)      2, systems/i_linux.pas: first_parm_offset set to 0      3, rtl/inc/systemh.inc: FPC_HAS_INTERNAL_SAR_DWORD for mips      4, rtl/linux/{ostypes.inc, linux.pp, oldlinux.pp}, macro definitions for mips: MAP_xxx      5, rtl/linux/mips/syscall.inc: don't use second stack      6, mips/*:           remove the use of NR_TCR*, allocate temporary registers instead           use fake instructions A_BA/A_BC to handle all kinds of branches, remove other condition branch instructions, remove all likely branch           add support for boolean64           fix ldc1/sdc1 next register calculation           use r25 for interface call to better suite abi           fix inverse_cond           add bc1t/bc1f to is_calljmp The next major one should be parameter passing, and then the PIC support. Thank you for all your kind help. Regards

 
Hi, while this interesting discussion about fpc for Linux/MIPS is evolving, we've received an IBM Mips server from a customer (I don't know the model yet) to try to install an hypervisor. 

We need to run at least Windows and Linux servers on it. Do you know if Xen/VMWare or similar hypervisors run on this architecture?.

If I can install an hypervisor, I could create one virtual machine to let the FPC team test the MIPS version on this machine, it can be online 24/7.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Reply by email

Unknown author
to Leonardo M. Ramé
  Hi, while this interesting discussion about fpc for Linux/MIPS is evolving, we've received an IBM Mips server from a customer (I don't know the model yet) to try to install an hypervisor. 

Sorry if this has already been answered but I have tons of mail and haven't read them all yet.

I am near certain IBM doesn't make any MIPS hardware at all and never has in their history. In the past they've made all sorts of odd things but at the moment all they make is Intel and POWER servers, as far as servers go. MIPS in IBM-speak is "millions of instructions per second" which is how they describe mainframe performance since they don't publish clock speeds.

We need to run at least Windows and Linux servers on it. Do you know if Xen/VMWare or similar hypervisors run on this architecture?.

AFAIK, as far as Windows, nothing but Windows CE (not XP, 7, Vista etc) runs on MIPS and I don't think Windows CE will run on server hardware. And all of the virtualization options available are Intel-only except for Oracle's SPARC VM, so no, you don't have any virtualization options except for perhaps QEMU, but so does everyone who has an Intel box, so there isn't anything to offer via virtualization.

If I can install an hypervisor, I could create one virtual machine to let the FPC team test the MIPS version on this machine, it can be online 24/7.

Virtualization is thin to none on anything but Intel hardware. But there is QEMU and it provides support for various architectures including MIPS. If you install Linux on your MIPS server (if it really is a MIPS server, which I don't think it is, or if it is, it isn't IBM) you can use QEMU like Fuxin Zhang wrote he was using, but then so can everyone else who has an Intel box (everybody) so I don't think it's going to be very helpful.

And the guy working on fpc on MIPS, Fuxin, is working for a MIPS manufacturer so I would guess he has all the hardware he needs ;-)

Reply by email

Marco van de Voort
to Unknown author

In our previous episode, said:

AFAIK, as far as Windows, nothing but Windows CE (not XP, 7, Vista etc) runs on MIPS

Afaik NT up to and including 4.0 ran on MIPS (r3000/4000). After 4.0 architectures were severely cut.

NT3.51 also ran SPARC.

Reply by email

Mark Morgan Lloyd
to Unknown author: On Sat, 2 Jun 2012 07:04:24 -0700 (PDT) Sorry if this has already been answered but I…
Show quoted text 5 lines
I am near certain IBM doesn't make any MIPS hardware at all and never has in their history. In the past they've made all sorts of odd things but at the moment all they make is Intel and POWER servers, as far as servers go. MIPS in IBM-speak is "millions of instructions per second" which is how they describe mainframe performance since they don't publish clock speeds.

That's my understanding as well.

Show quoted text 5 lines
> If I can install an hypervisor, I could create one virtual machine to let > the FPC team test the MIPS version on this machine, it can be online 24/7. Virtualization is thin to none on anything but Intel hardware. But there is QEMU and it provides support for various architectures including MIPS.

Agreed. However larger SPARC systems can, I believe, be divided into multiple domains, and larger IBM PPC systems can be partitioned into LPARs. I don't have practical experience of either of these technologies, but if Leonardo's been told "there's a system on its way to you and we expect you to use its virtualisation facilities" and if it's non-x86 then that's the sort of thing he's likely to have to contend with.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Unknown author
to Marco van de Voort: In our previous episode, said: Afaik NT up to and including 4.0 ran on MIPS…

From Sun Jun 3 08:34:51 2012

Show quoted text 8 lines
In our previous episode, said: > AFAIK, as far as Windows, nothing but Windows CE (not XP, 7, Vista etc) > runs on MIPS Afaik NT up to and including 4.0 ran on MIPS (r3000/4000). After 4.0 architectures were severely cut. NT3.51 also ran SPARC.

Given the question was about wanting to run Windows and Linux on an IBM MIPS server and do virtualization, I didn't think it would help to discuss Windows NT, etc. I am aware Windows was supposed to have run on more platforms in the old days. My point was that you can't run XP, 7, or Vista on MIPS hardware, not that I was trying to beat anyone out in a trivia contest about what versions of various things were ever rumored to run on MIPS ;-)

Reply by email

Leonardo M. Ramé
to Unknown author: On Sat, 2 Jun 2012 07:04:24 -0700 (PDT) Sorry if this has already been answered but I…

You are right, the machine (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't have a MIPS processor, but an IBM's Power6.

BTW, does anyone know which Linux distribution runs on that machine?, can FPC be compiled to run on it?.  
Leonardo M. Ramé
http://leonardorame.blogspot.com

Show quoted text 52 lines
________________________________ From: "" To: Sent: Saturday, June 2, 2012 3:58 PM Subject: Re: [fpc-devel] progress of freepascal for mips On Sat, 2 Jun 2012 07:04:24 -0700 (PDT) Leonardo M. Ramé wrote: >   > Hi, while this interesting discussion about fpc for Linux/MIPS is > evolving, we've received an IBM Mips server from a customer (I don't know > the model yet) to try to install an hypervisor.  Sorry if this has already been answered but I have tons of mail and haven't read them all yet. I am near certain IBM doesn't make any MIPS hardware at all and never has in their history. In the past they've made all sorts of odd things but at the moment all they make is Intel and POWER servers, as far as servers go. MIPS in IBM-speak is "millions of instructions per second" which is how they describe mainframe performance since they don't publish clock speeds. > We need to run at least Windows and Linux servers on it. Do you know if > Xen/VMWare or similar hypervisors run on this architecture?. AFAIK, as far as Windows, nothing but Windows CE (not XP, 7, Vista etc) runs on MIPS and I don't think Windows CE will run on server hardware. And all of the virtualization options available are Intel-only except for Oracle's SPARC VM, so no, you don't have any virtualization options except for perhaps QEMU, but so does everyone who has an Intel box, so there isn't anything to offer via virtualization. > If I can install an hypervisor, I could create one virtual machine to let > the FPC team test the MIPS version on this machine, it can be online 24/7. Virtualization is thin to none on anything but Intel hardware. But there is QEMU and it provides support for various architectures including MIPS. If you install Linux on your MIPS server (if it really is a MIPS server, which I don't think it is, or if it is, it isn't IBM) you can use QEMU like Fuxin Zhang wrote he was using, but then so can everyone else who has an Intel box (everybody) so I don't think it's going to be very helpful. And the guy working on fpc on MIPS, Fuxin, is working for a MIPS manufacturer so I would guess he has all the hardware he needs ;-) _______________________________________________ fpc-devel maillist  -  http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Jonas Maebe
to Leonardo M. Ramé
Leonardo M. Ramé wrote
You are right, the machine (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't have a MIPS processor, but an IBM's Power6. BTW, does anyone know which Linux distribution runs on that machine?

http://www.google.be/search?hl=en&q=IBM+Power+560+Express+linux ->
http://www.acclinet.com/ibm-servers/ibm-power-560-server.asp

can FPC be compiled to run on it?.

Yes, both under AIX and under Linux (either the ppc32 or the ppc64 version of FPC).

Jonas

Reply by email

Leonardo M. Ramé
to Jonas Maebe
Show quoted text 21 lines
________________________________ From: Jonas Maebe To: Leonardo M. Ramé ; FPC developers' list Sent: Monday, June 4, 2012 7:19 PM Subject: Re: [fpc-devel] progress of freepascal for mips On 04 Jun 2012, at 23:56, Leonardo M. Ramé wrote: > You are right, the machine (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't have a MIPS processor, but an IBM's Power6. > > BTW, does anyone know which Linux distribution runs on that machine?   http://www.google.be/search?hl=en&q=IBM+Power+560+Express+linux ->   http://www.acclinet.com/ibm-servers/ibm-power-560-server.asp > can FPC be compiled to run on it?. Yes, both under AIX and under Linux (either the ppc32 or the ppc64 version of FPC).

 
That means that there is a native version of FPC or an emulated x86 version?

Leonardo M. Ramé
http://leonardorame.blogspot.com

Reply by email

Unknown author
to Leonardo M. Ramé: You are right, the machine (http://www-03.ibm.com/systems/power/hardware/560/specs.html)…
Show quoted text 8 lines
You are right, the machine (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't have a MIPS processor, but an IBM's Power6. BTW, does anyone know which Linux distribution runs on that machine?, can FPC be compiled to run on it?. Leonardo M. Ramé http://leonardorame.blogspot.com

Congrats, that's a nice box. POWER6 is one generation behind but from what I read it can still run the latest version of AIX.

The best OS is the one IBM made for it, AIX which is a POSIX UNIX with IBM extensions (and great doc!). You should be able to get a copy without too much difficulty if one isn't already installed.

On the same page you linked above, there is a list of some Linux that are certified to run on your box. Running Linux on it would be a horrible waste of a good server. You can probably virtualize Linux and BSD instances under AIX though, as you had mentioned in your first post.

If you find you're not happy with the server, just tell me how much it would cost to ship and I'll take it off your hands ;-)

Reply by email

Sven Barth
to Leonardo M. Ramé:   That means that there is a native version of FPC or an emulated x86 version? Leonardo…
Leonardo M. Ramé wrote 23 lines
> ________________________________ > From: Jonas Maebe > To: Leonardo M. Ramé; FPC developers' list > Sent: Monday, June 4, 2012 7:19 PM > Subject: Re: [fpc-devel] progress of freepascal for mips > > > On 04 Jun 2012, at 23:56, Leonardo M. Ramé wrote: > >> You are right, the machine (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't have a MIPS processor, but an IBM's Power6. >> >> BTW, does anyone know which Linux distribution runs on that machine? > > http://www.google.be/search?hl=en&q=IBM+Power+560+Express+linux > -> > http://www.acclinet.com/ibm-servers/ibm-power-560-server.asp > >> can FPC be compiled to run on it?. > > Yes, both under AIX and under Linux (either the ppc32 or the ppc64 version of FPC). > That means that there is a native version of FPC or an emulated x86 version?

Natively for both AIX and Linux.

Regards,
Sven

Reply by email

Jonas Maebe
to Unknown author: On Mon, 4 Jun 2012 14:56:06 -0700 (PDT) Congrats, that's a nice box. POWER6 is one…

microcode wrote on Tue, 05 Jun 2012:

The best OS is the one IBM made for it, AIX which is a POSIX UNIX with IBM extensions (and great doc!).

It's true that IBM has great documentation. But AIX has quite a few quirks compared to other Unices, even commercial/traditional big iron ones like Solaris. My main pet peeve is that it does not protect against reads from nil pointers for optimization reasons. I've collected some more at
http://wiki.freepascal.org/FPC_AIX_Port#AIX_quirks

Another one, which isn't mentioned on that page because it doesn't affect end users of the compiler/RTL, is that AIX uses different code page names in libiconv than all other Unix-based platforms we support. That's in part because the iconv standard isn't worth the name "standard" (it defines almost nothing), but it would have been nice if the IBM people could have added some extra code page names so as to be more compatible with other libiconv implementations.

Jonas

Reply by email

Mark Morgan Lloyd
to Unknown author: On Mon, 4 Jun 2012 14:56:06 -0700 (PDT) Congrats, that's a nice box. POWER6 is one…
Show quoted text 23 lines
On Mon, 4 Jun 2012 14:56:06 -0700 (PDT) Leonardo M. Ramé wrote: > You are right, the machine > (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't > have a MIPS processor, but an IBM's Power6. > > BTW, does anyone know which Linux distribution runs on that machine?, can > FPC be compiled to run on it?. > Leonardo M. Ramé > http://leonardorame.blogspot.com Congrats, that's a nice box. POWER6 is one generation behind but from what I read it can still run the latest version of AIX. The best OS is the one IBM made for it, AIX which is a POSIX UNIX with IBM extensions (and great doc!). You should be able to get a copy without too much difficulty if one isn't already installed. On the same page you linked above, there is a list of some Linux that are certified to run on your box. Running Linux on it would be a horrible waste of a good server. You can probably virtualize Linux and BSD instances under AIX though, as you had mentioned in your first post.

With the caveat that, as I understand it, this is a hardware-assisted partitioning operation and is likely to have a very different "feel" from things like VMWare. As an example (and possibly you can confirm this), my understanding is that there are facilities in the system firmware, i.e. accessed from something analogous to a "BIOS setup screen", that dictate how SCSI devices will be distributed between LPARs.

In any event, if Leonardo successfully runs Linux or BSD in a partition I hope he writes it up somewhere. My PPC system is only an old Mac running Debian, but I think having the info would be useful.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Leonardo M. Ramé
to Mark Morgan Lloyd
Show quoted text 38 lines
________________________________ From: Mark Morgan Lloyd To: Sent: Tuesday, June 5, 2012 6:38 AM Subject: Re: [fpc-devel] progress of freepascal for mips wrote: > On Mon, 4 Jun 2012 14:56:06 -0700 (PDT) > Leonardo M. Ramé wrote: > >> You are right, the machine >> (http://www-03.ibm.com/systems/power/hardware/560/specs.html) doesn't >> have a MIPS processor, but an IBM's Power6. >> >> BTW, does anyone know which Linux distribution runs on that machine?, can >> FPC be compiled to run on it?. Leonardo M. Ramé >> http://leonardorame.blogspot.com > > Congrats, that's a nice box. POWER6 is one generation behind but from what > I read it can still run the latest version of AIX. > > The best OS is the one IBM made for it, AIX which is a POSIX UNIX with > IBM extensions (and great doc!). You should be able to get a copy without > too much difficulty if one isn't already installed. > > On the same page you linked above, there is a list of some Linux that are > certified to run on your box. Running Linux on it would be a horrible > waste of a good server. You can probably virtualize Linux and BSD instances > under AIX though, as you had mentioned in your first post. With the caveat that, as I understand it, this is a hardware-assisted partitioning operation and is likely to have a very different "feel" from things like VMWare. As an example (and possibly you can confirm this), my understanding is that there are facilities in the system firmware, i.e. accessed from something analogous to a "BIOS setup screen", that dictate how SCSI devices will be distributed between LPARs. In any event, if Leonardo successfully runs Linux or BSD in a partition I hope he writes it up somewhere. My PPC system is only an old Mac running Debian, but I think having the info would be useful. -- Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

I have no problem at all, in fact, I would like to create a VM for the FPC team for testing. Hopefully I'll start trying to create a Linux or Bsd machine on it this week.

Leonardo M. Ramé
http://leonardorame.blogspot.com

Reply by email

Fuxin Zhang
Show quoted text 12 lines
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.
cat
output/mipsel-linux/faillist.testlog
test/cg/tdivz2
test/cg/tprintf
test/cg/tprintf2
test/cg/treadwrt
test/cg/tumin
...

Jonas

Reply by email

Pierre Free Pascal
to Fuxin Zhang
Show quoted text 32 lines
-----Message d'origine----- De : [mailto:fpc-devel- 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. cat output/mipsel-linux/faillist.testlog test/cg/tdivz2 test/cg/tprintf test/cg/tprintf2 test/cg/treadwrt test/cg/tumin

Hi Fuxin,

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.

Pierre

Reply by email

Fuxin Zhang
Show quoted text 6 lines
Hi Fuxin, 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.

Thank you for your work, then I will start based on the trunk.

Show quoted text 7 lines
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).

Yes, I did the same work to make some tests work.

Show quoted text 9 lines
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.

Understand.

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

We have to study how GDB analysis mips stack, up to now I use gdb only with instruction level debugging: break *0x4001da, si, info registers etc.:)
But I think it won't be hard. I have looked at lots of c compiler's code,we are not very far away from it.

Show quoted text 5 lines
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.

In the real world the MIPS O32 abi is still a de facto ABI. N32/N64 support is still not very robust for linux/mips. So I think we should first add the support of O32. My new code is almost O32 compatible and I will upload it as soon as possible.

What do you mean by stating 'create a record that lists their specificities'? Is it that we create a readme file for mips ABI and upload it to the repository? There is an old ABI document for O32 called "System V APPLICATION BINARY INTERFACE MIPS RISC Processor supplement", you can get it from http://www.lemote.com/upfiles/mipsabi32.pdf.

Regards

Show quoted text 7 lines
Pierre

Reply by email

Mark Morgan Lloyd
to Pierre Free Pascal: I committed to trunk your changes together with a few changes to cpupara that allow me to…
Pierre Free Pascal wrote 24 lines
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]

Reply by email

Fuxin Zhang
Show quoted text 7 lines
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

I have added a link to mips O32 ABI file to the MIPS section.

Show quoted text 11 lines
-- 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 - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Unknown author
to Fuxin Zhang
Show quoted text 10 lines
> 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 I have added a link to mips O32 ABI file to the MIPS section.

Mark, guys, were you wanting the information itself on the wiki or are links good enough? If the latter and they aren't there already, I'll add the SPARC ABI links next week.

Fuxin, is there a formal 64 bit ABI from MIPS Inc.? I think you said earlier the Linux 64 bit ABI is not exactly stable, but there are a few other OS running on 64 bit MIPS (OpenBSD and FreeBSD and NetBSD, as far as I know). If MIPS or some other standards body has documented the 64 bit MIPS ABI I'd like to get a copy of it. I found some old SGI doc but I don't know how universal it is.

Thanks.

Reply by email

Mark Morgan Lloyd
to Unknown author
Show quoted text 16 lines
On Fri, 8 Jun 2012 17:15:51 +0800 (CST) "Fuxin Zhang" wrote: >> 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 > I have added a link to mips O32 ABI file to the MIPS section. Mark, guys, were you wanting the information itself on the wiki or are links good enough? If the latter and they aren't there already, I'll add the SPARC ABI links next week.

My intention was to put links in, although obviously a note would be in order where FPC and/or GCC departs from conventions. One of the reasons that I started that page was that some manufacturers require you to register with them before they will give you full processor info- I think that MIPS was one of those. At that point a link to a copy of the document which happens to have been published on e.g. a university website has some value to people who don't want to raise their head above the parapet.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Unknown author
to Mark Morgan Lloyd
Show quoted text 20 lines
wrote: > On Fri, 8 Jun 2012 17:15:51 +0800 (CST) > "Fuxin Zhang" wrote: > >>> 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 > >> I have added a link to mips O32 ABI file to the MIPS section. > > Mark, guys, were you wanting the information itself on the wiki or are > links good enough? If the latter and they aren't there already, I'll add > the SPARC ABI links next week. My intention was to put links in, although obviously a note would be in order where FPC and/or GCC departs from conventions.

I don't know enough about either FPC or GCC to speak to this issue.

One of the reasons that I started that page was that some manufacturers require you to register with them before they will give you full processor info- I think that MIPS was one of those.

Yes, definitely. ARM is also.

At that point a link to a copy of the document which happens to have been published on e.g. a university website has some value to people who don't want to raise their head above the parapet.

Fortunately the SPARC doc is all open.

Reply by email

Fuxin Zhang
Show quoted text 8 lines
Fuxin, is there a formal 64 bit ABI from MIPS Inc.? I think you said earlier the Linux 64 bit ABI is not exactly stable, but there are a few other OS running on 64 bit MIPS (OpenBSD and FreeBSD and NetBSD, as far as I know). If MIPS or some other standards body has documented the 64 bit MIPS ABI I'd like to get a copy of it. I found some old SGI doc but I don't know how universal it is.

I get a copy from my colleague for N32 ABI, no N64 found yet.See http://www.lemote.com/upfiles/mips-abi-n32.pdf. I put it here because no confidential sign in the document. But I am not sure whether it comes from MIPS as a material to licensee. Will check later.

Show quoted text 9 lines
Thanks. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Fuxin Zhang
Show quoted text 14 lines
> > Fuxin, is there a formal 64 bit ABI from MIPS Inc.? I think you said > earlier the Linux 64 bit ABI is not exactly stable, but there are a few > other OS running on 64 bit MIPS (OpenBSD and FreeBSD and NetBSD, as far > as > I know). If MIPS or some other standards body has documented the 64 bit > MIPS ABI I'd like to get a copy of it. I found some old SGI doc but I > don't > know how universal it is. I get a copy from my colleague for N32 ABI, no N64 found yet.See http://www.lemote.com/upfiles/mips-abi-n32.pdf. I put it here because no confidential sign in the document. But I am not sure whether it comes from MIPS as a material to licensee. Will check later.

The same document also describe about N64, since it is very close to N32.

Show quoted text 15 lines
> > Thanks. > > > > _______________________________________________ > fpc-devel maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-devel > _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Nikolai Zhubr
to Fuxin Zhang: I get a copy from my colleague for N32 ABI, no N64 found yet.See…

Hi,
09.06.2012 5:27, Fuxin Zhang:

I get a copy from my colleague for N32 ABI, no N64 found yet.See http://www.lemote.com/upfiles/mips-abi-n32.pdf. I put it here because no confidential sign in the document. But I am not sure whether it comes from MIPS as a material to licensee. Will check later.

BTW, I'd like to remind that there is some errata for 24k cpu. I've faild to find any relevant official document on mips site but see e.g. "Lost Data on Stores During Refill" in this patch:

http://cygwin.com/ml/binutils/2011-04/txt00020.txt

As far as I understand it, the problem was fixed on assembler level so it'd seem it should not bother FPC. Anyway, one of my mips boxes is exactly 24k (wndr3800), another one is 74k (asus n16). Supposedly 74k does not suffer this problem.

Nikolai

Show quoted text 5 lines
> > Thanks. > > >

Reply by email

Florian Klämpfl
to Unknown author: On Fri, 8 Jun 2012 17:15:51 +0800 (CST) Mark, guys, were you wanting the information…

Am 08.06.2012 14:54, schrieb

Show quoted text 16 lines
On Fri, 8 Jun 2012 17:15:51 +0800 (CST) "Fuxin Zhang" wrote: > >> 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 > I have added a link to mips O32 ABI file to the MIPS section. Mark, guys, were you wanting the information itself on the wiki or are links good enough?

Please keep copyright in mind when adding new stuff!

Reply by email

Mark Morgan Lloyd
to Florian Klämpfl
Florian Klämpfl wrote 16 lines
Am 08.06.2012 14:54, schrieb > On Fri, 8 Jun 2012 17:15:51 +0800 (CST) > "Fuxin Zhang" wrote: > >>> 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 >> I have added a link to mips O32 ABI file to the MIPS section. > Mark, guys, were you wanting the information itself on the wiki or are > links good enough? Please keep copyright in mind when adding new stuff!

Absolutely. However I think that a paraphrased description of e.g. the calling conventions used by a particular CPU isn't something that could be copyrighted: patented, perhaps, or viewed as a leaked trade secret, but not copyrighted.

But I think that in most cases good links will be an adequate resource. Possibly with notes where GCC and/or FPC is known to deviate.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Florian Klämpfl
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 22 lines
Florian Klämpfl wrote: > Am 08.06.2012 14:54, schrieb >> On Fri, 8 Jun 2012 17:15:51 +0800 (CST) >> "Fuxin Zhang" wrote: >> >>>> 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 >>> I have added a link to mips O32 ABI file to the MIPS section. >> Mark, guys, were you wanting the information itself on the wiki or are >> links good enough? > > Please keep copyright in mind when adding new stuff! Absolutely. However I think that a paraphrased description of e.g. the calling conventions used by a particular CPU isn't something that could be copyrighted: patented, perhaps, or viewed as a leaked trade secret, but not copyrighted.

Yes, true, however, I was more aiming at uploading files.

Reply by email

Unknown author
to Fuxin Zhang: I get a copy from my colleague for N32 ABI, no N64 found yet.See…
Show quoted text 13 lines
> > Fuxin, is there a formal 64 bit ABI from MIPS Inc.? I think you said > earlier the Linux 64 bit ABI is not exactly stable, but there are a few > other OS running on 64 bit MIPS (OpenBSD and FreeBSD and NetBSD, as far > as I know). If MIPS or some other standards body has documented the 64 > bit MIPS ABI I'd like to get a copy of it. I found some old SGI doc but > I don't > know how universal it is. I get a copy from my colleague for N32 ABI, no N64 found yet.See http://www.lemote.com/upfiles/mips-abi-n32.pdf. I put it here because no confidential sign in the document. But I am not sure whether it comes from MIPS as a material to licensee. Will check later.

Thanks, I already have several copies of n32 doc. I'm specifically looking for n64 doc. UNIX is chaos, it seems like there is no single place to get the ABIs for all platforms.

Reply by email

Unknown author
to Florian Klämpfl: Am 08.06.2012 14:54, schrieb Please keep copyright in mind when adding new stuff!
Show quoted text 19 lines
Am 08.06.2012 14:54, schrieb > On Fri, 8 Jun 2012 17:15:51 +0800 (CST) > "Fuxin Zhang" wrote: > >> >>> 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 > >> I have added a link to mips O32 ABI file to the MIPS section. > > Mark, guys, were you wanting the information itself on the wiki or are > links good enough? Please keep copyright in mind when adding new stuff!

Links definitely help if you're worried about copyrights.

Reply by email

Mark Morgan Lloyd
to Unknown author: On Sat, 9 Jun 2012 09:27:30 +0800 (CST) Thanks, I already have several copies of n32 doc.…
Show quoted text 18 lines
On Sat, 9 Jun 2012 09:27:30 +0800 (CST) "Fuxin Zhang" wrote: >> Fuxin, is there a formal 64 bit ABI from MIPS Inc.? I think you said >> earlier the Linux 64 bit ABI is not exactly stable, but there are a few >> other OS running on 64 bit MIPS (OpenBSD and FreeBSD and NetBSD, as far >> as I know). If MIPS or some other standards body has documented the 64 >> bit MIPS ABI I'd like to get a copy of it. I found some old SGI doc but >> I don't >> know how universal it is. > I get a copy from my colleague for N32 ABI, no N64 found yet.See > http://www.lemote.com/upfiles/mips-abi-n32.pdf. I put it here because no > confidential sign in the document. But I am not sure whether it comes from > MIPS as a material to licensee. Will check later. Thanks, I already have several copies of n32 doc. I'm specifically looking for n64 doc. UNIX is chaos, it seems like there is no single place to get the ABIs for all platforms.

So guess why I started that wiki page? :-)

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Fuxin Zhang
>> >> Please keep copyright in mind when adding new stuff!

I have removed the link in the wiki and the files from lemote web. Sorry for the thinkless action.
Opening the ABI documents should be a good thing to help its eco-system, if I have chance I will try to pasuade mips.

Show quoted text 12 lines
> > Absolutely. However I think that a paraphrased description of e.g. the > calling conventions used by a particular CPU isn't something that could > be copyrighted: patented, perhaps, or viewed as a leaked trade secret, > but not copyrighted. Yes, true, however, I was more aiming at uploading files. _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email

Unknown author
to Mark Morgan Lloyd: So guess why I started that wiki page? :-) Mark Morgan Lloyd markMLl .AT. telemetry.co…
Show quoted text 21 lines
wrote: > On Sat, 9 Jun 2012 09:27:30 +0800 (CST) > "Fuxin Zhang" wrote: > >>> Fuxin, is there a formal 64 bit ABI from MIPS Inc.? I think you said >>> earlier the Linux 64 bit ABI is not exactly stable, but there are a >>> few other OS running on 64 bit MIPS (OpenBSD and FreeBSD and NetBSD, >>> as far as I know). If MIPS or some other standards body has >>> documented the 64 bit MIPS ABI I'd like to get a copy of it. I found >>> some old SGI doc but I don't >>> know how universal it is. >> I get a copy from my colleague for N32 ABI, no N64 found yet.See >> http://www.lemote.com/upfiles/mips-abi-n32.pdf. I put it here because >> no confidential sign in the document. But I am not sure whether it >> comes from MIPS as a material to licensee. Will check later. > > Thanks, I already have several copies of n32 doc. I'm specifically > looking for n64 doc. UNIX is chaos, it seems like there is no single > place to get the ABIs for all platforms. So guess why I started that wiki page? :-)

It's a good idea but I'm not sure we can solve the greater problem which is there's no authority on which specs are "official", "valid" etc. When you're lucky enough to find some doc on the net, you are never sure it's the latest copy since there is no top-level official repository.

Reply by email

Unknown author
to Fuxin Zhang: I have removed the link in the wiki and the files from lemote web. Sorry for the…
Show quoted text 7 lines
>>> >>> Please keep copyright in mind when adding new stuff! I have removed the link in the wiki and the files from lemote web. Sorry for the thinkless action. Opening the ABI documents should be a good thing to help its eco-system, if I have chance I will try to pasuade mips.

The n32 ABI and a 64 bit conversion guide are available in SGI pubs from SGI's site without signing up. I don't think you have anything to be concerned about. MIPS lets anyone who signs up download their doc. It seems there aren't any trade secrets involved and it seems to me linking to their doc would be the safe thing to do. I don't think you did anything wrong though.

Reply by email