Hi,
To dispell the silence a bit (hehe, any D&D fans here ;), I thought I'd write a mail here :)
Ok, the purpose is this: Since I now have more time, I would like to become actively invovled (actively as in "I want to write some code").
Are there any projects up for grabs that I can look into ?
Regards,
Hi Thomas,
On 2/05/2005, you wrote:
Are there any projects up for grabs that I can look into ?
What about some advice on coding habits? I'd ask privately, but the answer will be of general interest anyway, both in the project I am currently working on and those in the future like OO and Kaffe.
Much old 68k code is fast and efficient because it relies on parameters like library and structure pointers remaining persistent in allocated 68k registers, eg a2, a6 always point to particular structures. In a big module consisting of dozens if not hundreds of very small functions, only one or two registers are ever used for volatile data. Most parameters are passed in assumed registers, so loading of arguments is minimised.
So what is a good way to maintain this register shortcut in a C version of a big program originally written in assembler? Obviously I can specify parameters to be passed in 68k registers, but I am trying to write this thing in a portable fashion, machine-independent.
I have no experience with PPC code yet. Is there a way to ask gcc to use registers for certain parameters, in a platform-independent way? I want the C code to remain pure ANSI-compliant. It would be nice to leave the code unchanged from its present SAS/C environment to PPC and gcc.
cheers
Hi,
Tony Wyatt wrote:
What about some advice on coding habits?
Bah, I'm not a teacher :) And I don't have any skill sin teaching whatsoever... I can't even explain very well...
Much old 68k code is fast and efficient because it relies on parameters like library and structure pointers remaining persistent in allocated 68k registers, eg a2, a6 always point to particular structures. In a big module consisting of dozens if not hundreds of very small functions, only one or two registers are ever used for volatile data. Most parameters are passed in assumed registers, so loading of arguments is minimised.
Uh, I beg to differ. I think he old habbit of keeping certain registers set up with a default meaning is the worst you can do, /especially/ when you have so little registers as the 68k. You say loading of arguments is minimised, but that's wrong.
The effect is two-fold:
1. Since some registers are fixed, this results in lots of splilling of scratch registers. A lot of code is "just" about moving stuff from memory into registers, manipulating it, and storing it back. Sure, the 68k can do a lot of it's operations also in memory, but that's much slower. The result is that with fixed registers like this, theamount of availabele registers is decreased. 2. Fixing registers will make them hang around forever, even when they aren't used. What use is it to have a2 and a6 constantly setup when there's no need for them at the moment, and they could be reused for other stuff ?
Modern compilers make "lifeliness analysis" (sp?): They assume "virtual" registers, analyse their life cycle, and assign them to hardware registers. This is nearly optimal in modern compilers, and far bettern than you would do it in your hand-written assembly code.
So what is a good way to maintain this register shortcut in a C version of a big program originally written in assembler? Obviously I can specify parameters to be passed in 68k registers, but I am trying to write this thing in a portable fashion, machine-independent.
There's not really any way to enforce this in C on the PPC. You can not assign a register to a variable, for example, and as I explained above, I wouldn't do that. One of the things to remember about the PPC is that it is a pure load/store architecture: You can not, like on the 68k, manipulate data in memory. It _must_ be in registers to be processed. The compiler will do this optimally, it will also try to keep variables in registers where appropriate, based on it's analysis.
I have no experience with PPC code yet. Is there a way to ask gcc to use registers for certain parameters, in a platform-independent way? I want the C code to remain pure ANSI-compliant. It would be nice to leave the code unchanged from its present SAS/C environment to PPC and gcc.
ANSI-compliant and specifying registers doesn't really mix ;)
There's no way to specify the placement of parameters on OS4. It's fully System V.4 compliant.
System V.4 places integer and pointer parameters into r3 - r10, and floating point parameters into f1 - f10. Excess parameters (which doesn't happen that often) are put on the stack. The only exception to this in OS4 is the VARARGS68K attribute, which places all parameters on the stack, to cope with 68k compatibility.
BTW, Linux PPC also uses the System V.4 ABI, so if for example Kaffee already contains trampoline code for Linux PPC, you can re-use that, it won't be different in OS4.
So bottom line, the best way to do it on OS4 is not to specify the placement, and everything should fall into place. Plus, the compiler will definitely know better how to use registers.
Regards,
Hello Thomas
On 02/05/05, you wrote:
< - SNIP - >
System V.4 places integer and pointer parameters into r3 - r10, and floating point parameters into f1 - f10. Excess parameters (which doesn't happen that often) are put on the stack.
< - SNIP - >
Excuse the dumb question, but why use the stack for "Excess parameters" when the PPC has 32 general purpose and 32 floating point registers?
Please note the last time I've done any 68K ASM was on the "Sinclair QL" many years ago. I have not looked at PPC ASM yet either.
Is this "System V.4" limitation something to do with GCC?
Thanks,
Regards, Tim
Hi,
Timothy Cameron wrote:
Excuse the dumb question, but why use the stack for "Excess parameters" when the PPC has 32 general purpose and 32 floating point registers?
The other registers (r14 +) are "non-volatile", i.e. they must be preserved across function calls. The compilers uses them for local variables. r0, r3-r10, r11, r12 are volatile, i.e. they need not be preserved (with r3-r10 used as parameters when a function is called). Similar rules are in place for the floating point registers.
Please note the last time I've done any 68K ASM was on the "Sinclair QL" many years ago. I have not looked at PPC ASM yet either.
Is this "System V.4" limitation something to do with GCC?
Well, it's one possible ABI gcc supports (besides PowerOpen, AIX and WindowsNT).
However, it's not really a limitation, but a set of rules. It makes things a lot easier, since parameters are now defined by the C prototype of a function, and no compiler specific bindings for parameter passing is necessary... On the old system, every compiler had it's own rules: Aztec C used to pass parameters on the stack, SAS/C could select stack or register arguments, gcc used stack, etc.
Regards,
Le 02/05/2005, Thomas Frieden a écrit :
Hi,
To dispell the silence a bit (hehe, any D&D fans here ;),
You called?
I thought I'd write a mail here :)
Ok, the purpose is this: Since I now have more time, I would like to become actively invovled (actively as in "I want to write some code").
Are there any projects up for grabs that I can look into ?
You are a very foolish perso, posting things like this.
Actually, if someone could find it in him to write a Guide to Porting *nix Apps to OS4, even just a rough one that could be tidied up later, and/or by others, it would be a useful start. And if it were coupled with a How To Compile Using GCC for AmigaUsers, we might even be able to draw in a few extra coders...
Salutations
Hi,
Rose Humphrey wrote:
To dispell the silence a bit (hehe, any D&D fans here ;),
You called?
I knew you would say that ;)
Are there any projects up for grabs that I can look into ?
You are a very foolish perso, posting things like this.
No, just brave enough ;)
Actually, if someone could find it in him to write a Guide to Porting *nix Apps to OS4, even just a rough one that could be tidied up later, and/or by others, it would be a useful start.
Argh... I would love to do something like that, but my writing skills suck, and I can not really explain anything in a way people understand... sorry...
And if it were coupled with a How To Compile Using GCC for AmigaUsers, we might even be able to draw in a few extra coders...
You touch a sore point there, I have to admit. Documentation is really missing right now, but we are lacking the resources to do that properly... The only thing we can offer is to answer questons when people ask them...
Regards,
Hi Thomas,
Thanks for the reassuring words on argument passing. I'll just leave it all to gcc.
On 2/05/2005, you wrote:
And if it were coupled with a How To Compile Using GCC for AmigaUsers, we might even be able to draw in a few extra coders...
You touch a sore point there, I have to admit. Documentation is really missing right now, but we are lacking the resources to do that properly... The only thing we can offer is to answer questons when people ask them...
I wish I had more time for this project. Some years ago I spent three years writing technical manuals, both hardware and software. Now if I had a clone or two, maybe . . .
copy clone /me ""
cheers
Le 02/05/2005, Thomas Frieden a écrit :
And if it were coupled with a How To Compile Using GCC for AmigaUsers, we might even be able to draw in a few extra coders...
You touch a sore point there, I have to admit. Documentation is really missing right now, but we are lacking the resources to do that properly... The only thing we can offer is to answer questons when people ask them...
I suppose if someone, even a total idiot (as far as programming is concerned) like me collected all the hints and tips it might help?
Maybe a Wiki format, although I'm not too happy with the "anyone can write/modify/delete" ethos. I'll need to look at this.
Salutations
Hi,
Rose Humphrey wrote:
I suppose if someone, even a total idiot (as far as programming is concerned) like me collected all the hints and tips it might help?
Theoretically, if you understood what I said... I normally don't understand it when I re-read it :S
Regards,
Le 03/05/2005, Thomas Frieden a écrit :
Hi,
Rose Humphrey wrote:
I suppose if someone, even a total idiot (as far as programming is concerned) like me collected all the hints and tips it might help?
Theoretically, if you understood what I said... I normally don't understand it when I re-read it :S
Sounds like a perfect demonstration of the Second Law of Thermodynamics using knowledge instead of energy.
Salutations
On 2005-05-02, Thomas Frieden wrote:
<SNIP>
Actually, if someone could find it in him to write a Guide to Porting *nix Apps to OS4, even just a rough one that could be tidied up later, and/or by others, it would be a useful start.
Argh... I would love to do something like that, but my writing skills suck, and I can not really explain anything in a way people understand... sorry...
If it would help, I could attempt to aid you in writing such a document (or write it with your input and corrections). Not that I have a lot of time, but I do work as a teacher (ComputerScience/SystemsProgramming) and even if I am not great at writing I have a little bit of practice.
The work on NAS can be put on ice for the moment (not that is was progressing very quickly) with little in the way of repercussions since most of the work has gone into clib2 anyway.
So, if you feel up to it I can probably come up with a (very) rough outline of such a document during the weekend (or possibly earlier) and we can take it from there. (If you say yes, you should also know that I write everything in LaTeX)
-Peter aka. Archprogrammer
Reality is for people who cannot face ScienceFiction. Only lefthanded people are in their right minds.
Hi,
Peter Bengtsson wrote:
Argh... I would love to do something like that, but my writing skills suck, and I can not really explain anything in a way people understand... sorry...
If it would help, I could attempt to aid you in writing such a document (or write it with your input and corrections). Not that I have a lot of time, but I do work as a teacher (ComputerScience/SystemsProgramming) and even if I am not great at writing I have a little bit of practice.
Thanks for the offer, but as I said, my skills at explaining are rotten...
So, if you feel up to it I can probably come up with a (very) rough outline of such a document during the weekend (or possibly earlier) and we can take it from there. (If you say yes, you should also know that I write everything in LaTeX)
Whoa, LaTeX, the word processor's assembly language :) Used that during my university days, but that's long past ...
Regards,
On 2005-05-03, Thomas Frieden wrote:
<SNIP>
Thanks for the offer, but as I said, my skills at explaining are rotten...
Well, just think about it. Ok? (And if I can dechiper the uncommented assembly listings my students sometimes turn in I think I at least have a decent chance of figuring out what you mean :)
<SNIP>
Whoa, LaTeX, the word processor's assembly language :) Used that during my university days, but that's long past ...
Well, I think plain TeX would be closer to WP assembly, but then I teach assembly programming (among other things) so perhaps I am biased. :-)
Yours,
-Peter aka. Archprogrammer
Reality is for people who cannot face ScienceFiction. Only lefthanded people are in their right minds.
Hello Thomas,
The automake and autoconf scripts need testing now we have perl, also a port of sane is needed (or maybe as I suggested looking into a while ago we should consider porting/updating betascan?)
Mark
On 02/052005, you wrote:
Hi,
To dispell the silence a bit (hehe, any D&D fans here ;), I thought I'd write a mail here :)
Ok, the purpose is this: Since I now have more time, I would like to become actively invovled (actively as in "I want to write some code").
Are there any projects up for grabs that I can look into ?
Regards,
Hi,
Sorry, late, I know...
Mark Bond wrote:
The automake and autoconf scripts need testing now we have perl,
Are these already available for download ? I looked at the site, and couldn't find them.
Regards,
On 30/052005, you wrote:
Hi,
Sorry, late, I know...
Mark Bond wrote:
The automake and autoconf scripts need testing now we have perl,
Are these already available for download ? I looked at the site, and couldn't find them.
Regards,
Thomas,
All the details are on the project site, but from what I can remember, the investigator said teh scripts are all just perl scripts (and so should just need testing), although I highly suspect a unix type shell will be needed, from the testing of perl that I've done generally.
Mark
Thomas Frieden wrote:
Are there any projects up for grabs that I can look into ?
Slightly worrying is that our fearless leader hasn't stepped up with something for you to do :)
What were the dependencies and which ones have already been taken?
Hello Olly,
On 03/052005, you wrote:
Thomas Frieden wrote:
Are there any projects up for grabs that I can look into ?
Slightly worrying is that our fearless leader hasn't stepped up with something for you to do :)
Our fearless leader, has two assistants (one of whom is myself), in his prolonged abscence (no I have no idea where he is), I did reply with a couple of tasks for Thomas.
What were the dependencies and which ones have already been taken?
Regards
Mark