Am 06.12.2009 um 06:13 schrieb malc:
On Sun, 6 Dec 2009, Andreas Faerber wrote:
Darwin/ppc64 does not use function descriptors,
adapt prologue and tcg_out_call accordingly.
GPR2 is available for general use, so let's use it.
http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/LowLevelABI/110-64-bit_PowerPC_Function_Calling_Conventions/64bitPowerPC.html
Signed-off-by: Andreas Faerber <andreas.faer...@web.de>
Cc: malc <av1...@comtv.ru>
---
tcg/ppc64/tcg-target.c | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c
index a612e10..bf9b7d9 100644
--- a/tcg/ppc64/tcg-target.c
+++ b/tcg/ppc64/tcg-target.c
@@ -859,10 +882,12 @@ void tcg_target_qemu_prologue (TCGContext *s)
;
frame_size = (frame_size + 15) & ~15;
+#ifndef __APPLE__
/* First emit adhoc function descriptor */
addr = (uint64_t) s->code_ptr + 24;
tcg_out32 (s, addr >> 32); tcg_out32 (s, addr); /* entry point */
s->code_ptr += 16; /* skip TOC and environment pointer
*/
+#endif
/* Prologue */
tcg_out32 (s, MFSPR | RT (0) | LR);
The frame format is different to that of PPC-elf64abi, shouldn't
really
make a difference here, then again i don't have access to PPC64 Mac
OSX,
so can't really verify that.
I checked that the linkage area is 48, too, the LR offset is 16, too.
The parameter area was depicted as 64 < 128.
So I guess we're good there.
Otherwise looks good.. Should i commit it with R13 fixed?
About the callee-save stuff I was less certain. Feel free to make
modifications (e.g., moving tcg_out_call up?) or have me resubmit.
Thanks,
Andreas