summaryrefslogtreecommitdiff
path: root/src/lj_ccall.h
diff options
context:
space:
mode:
authorMike Pall <mike>2011-08-01 18:59:16 +0200
committerMike Pall <mike>2011-08-01 18:59:16 +0200
commit4008b351f477d528ec950760689823f8ab785849 (patch)
treed6217942bc5168d3f016abd3c93ffe32f050df01 /src/lj_ccall.h
parent26106759d422438b1b3e974c43fd9f38ea055bdf (diff)
downloadluajit-4008b351f477d528ec950760689823f8ab785849.tar.gz
luajit-4008b351f477d528ec950760689823f8ab785849.tar.bz2
luajit-4008b351f477d528ec950760689823f8ab785849.zip
PPC: Add machine-specific part of FFI.
Diffstat (limited to 'src/lj_ccall.h')
-rw-r--r--src/lj_ccall.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lj_ccall.h b/src/lj_ccall.h
index d0979781..9a927745 100644
--- a/src/lj_ccall.h
+++ b/src/lj_ccall.h
@@ -53,10 +53,22 @@ typedef intptr_t GPRArg;
53#define CCALL_NARG_FPR 0 53#define CCALL_NARG_FPR 0
54#define CCALL_NRET_GPR 2 /* For softfp double. */ 54#define CCALL_NRET_GPR 2 /* For softfp double. */
55#define CCALL_NRET_FPR 0 55#define CCALL_NRET_FPR 0
56#define CCALL_SPS_FREE 0 /* NYI */ 56#define CCALL_SPS_FREE 0
57 57
58typedef intptr_t GPRArg; 58typedef intptr_t GPRArg;
59 59
60#elif LJ_TARGET_PPC
61
62#define CCALL_NARG_GPR 8
63#define CCALL_NARG_FPR 8
64#define CCALL_NRET_GPR 4 /* For complex double. */
65#define CCALL_NRET_FPR 1
66#define CCALL_SPS_EXTRA 3
67#define CCALL_SPS_FREE 1
68
69typedef intptr_t GPRArg;
70typedef double FPRArg;
71
60#elif LJ_TARGET_PPCSPE 72#elif LJ_TARGET_PPCSPE
61 73
62#define CCALL_NARG_GPR 8 74#define CCALL_NARG_GPR 8
@@ -100,8 +112,13 @@ typedef struct CCallState {
100 uint8_t nfpr; /* Number of arguments in FPRs. */ 112 uint8_t nfpr; /* Number of arguments in FPRs. */
101#elif LJ_TARGET_X86 113#elif LJ_TARGET_X86
102 uint8_t resx87; /* Result on x87 stack: 1:float, 2:double. */ 114 uint8_t resx87; /* Result on x87 stack: 1:float, 2:double. */
115#elif LJ_TARGET_PPC || LJ_TARGET_PPCSPE
116 uint8_t nfpr; /* Number of arguments in FPRs. */
103#endif 117#endif
104#if CCALL_NUM_FPR 118#if CCALL_NUM_FPR
119#if LJ_32
120 int32_t align1;
121#endif
105 FPRArg fpr[CCALL_NUM_FPR]; /* Arguments/results in FPRs. */ 122 FPRArg fpr[CCALL_NUM_FPR]; /* Arguments/results in FPRs. */
106#endif 123#endif
107 GPRArg gpr[CCALL_NUM_GPR]; /* Arguments/results in GPRs. */ 124 GPRArg gpr[CCALL_NUM_GPR]; /* Arguments/results in GPRs. */