m68k calling conventions
Kiyo Inaba
inaba at src.ricoh.co.jp
Wed Mar 31 16:59:44 PST 1999
>First, I got some errors due to minor changes in the assembler syntax. I notice
>that some of the inline assembler code was changed to assemble under Linux.
>Why should the assembler syntax be different between Linux and NetBSD?
>Both systems use GAS, so the syntax will be the same.
Sorry. I found this mistake a few days ago, while I check several
different configurations (staticvm/staticlib, staticvm/dynamiclib...).
And as you may know, I found bugs in libtools related issue what
I have to tackle.
BTW, you are talking 'both systems use GAS', that can be true,
but GAS can be configured as to accept different syntax.
>I will experiment with different syntaxes, to try to find one that works on
>both NetBSD and Linux. We are only asking for trouble if we have two versions
>of each assembly routine that differ only in their syntax. I may be able to
>get access to a Linux/m68k system to test this.
You have to keep in mind at least three different assemblers
may be used. One is gas for linux and the other two are native
as and gas for netbsd. And what I also plans to check is
native as and gas for SunOS4. Someone may remember SunOS4 is my
first intention :-)
>Second, there appears to be a difference in the calling conventions between
>NetBSD and Linux in that a floating-point quantity is returned in d0/d1 on
>NetBSD but fp0 on Linux. Again, why?
Because libraries for these OSes return these values to different
registers.
Everytime I faced with new OS, I found different assmbler syntax
or different calling conventions :-<
>Kaffe's calling convention is NOT compatible with the standard C calling
>convention, because Kaffe does not respect callee-save registers. Rather,
>Kaffe assumes that all registers will be clobbered after a call to a function.
It's only true for current (and tentative) JIT/sysdepCallMethod
implementation for m68k. That's another issue what someone
(including me) have to fix in the future. That's why I propose
tentative solution several days ago.
Anyway, David's comment is helpful. Because it reminds me some
TODO list for m68k ports. As far as I know this should be
1. Support 68040
2. Compatible with -O or -O2
3. GDB friendly frame construction (for netbsd)
4. Configuration with static/static, static/dynamic, dynamic/dynamic
5. Native as/gas support
5. SunOS4 support (native as/gas)
6. OpenBSD support (it should be trivial)
7. AmigaOS, NextOS, A/UX support.
8. Documentation for cross compiling
9. And of course BUG fixes :-<
Do you find any other, David?
# When can I be back to MIPS port??? :-)
Kiyo
More information about the kaffe
mailing list