From 71d40ba670d0d28be3b473a1e3042e82bf1ce9c1 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Tue, 15 Nov 2016 14:39:34 -0500 Subject: [PATCH] Add some s390x C calling convention constants. Guesses for now based on the ELF ABI supplement for zSeries. --- src/host/buildvm.c | 2 ++ src/lj_ccall.h | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/host/buildvm.c b/src/host/buildvm.c index 57b4dc97..ad2a8171 100644 --- a/src/host/buildvm.c +++ b/src/host/buildvm.c @@ -65,6 +65,8 @@ static int collect_reloc(BuildCtx *ctx, uint8_t *addr, int idx, int type); #include "../dynasm/dasm_ppc.h" #elif LJ_TARGET_MIPS #include "../dynasm/dasm_mips.h" +#elif LJ_TARGET_S390X +#include "../dynasm/dasm_s390x.h" #else #error "No support for this architecture (yet)" #endif diff --git a/src/lj_ccall.h b/src/lj_ccall.h index d97227a6..2a10a5e8 100644 --- a/src/lj_ccall.h +++ b/src/lj_ccall.h @@ -126,6 +126,17 @@ typedef union FPRArg { struct { LJ_ENDIAN_LOHI(float f; , float g;) }; } FPRArg; +#elif LJ_TARGET_S390X + +#define CCALL_NARG_GPR 5 /* GPR 2,3,4,5,6 */ +#define CCALL_NARG_FPR 4 /* FPR 0,2,4,8 */ +#define CCALL_NRET_GPR 1 /* GPR 2 */ +#define CCALL_NRET_FPR 1 /* FPR 0 */ +#define CCALL_SPS_EXTRA 20 /* 160-byte callee save area (not sure if this is the right place) */ +#define CCALL_SPS_FREE 0 + +typedef intptr_t GPRArg; +typedef double FPRArg; #else #error "Missing calling convention definitions for this architecture" #endif