From 2bece2c88331f024a46527634e3dd91c71d22141 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 14 Jun 2010 17:35:27 -0700 Subject: tcg: Optionally sign-extend 32-bit arguments for 64-bit hosts. Some hosts (amd64, ia64) have an ABI that ignores the high bits of the 64-bit register when passing 32-bit arguments. Others require the value to be properly sign-extended for the type. I.e. "int32_t" must be sign-extended and "uint32_t" must be zero-extended to 64-bits. To effect this, extend the "sizemask" parameter to tcg_gen_callN to include the signedness of the type of each parameter. If the tcg target requires it, extend each 32-bit argument into a 64-bit temp and pass that to the function call. This ABI feature is required by sparc64, ppc64 and s390x. Signed-off-by: Richard Henderson Signed-off-by: Aurelien Jarno --- tcg/s390/tcg-target.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tcg/s390/tcg-target.h') diff --git a/tcg/s390/tcg-target.h b/tcg/s390/tcg-target.h index d7fe0c7..8c19262 100644 --- a/tcg/s390/tcg-target.h +++ b/tcg/s390/tcg-target.h @@ -87,6 +87,8 @@ enum { #define TCG_TARGET_STACK_ALIGN 8 #define TCG_TARGET_CALL_STACK_OFFSET 0 +#define TCG_TARGET_EXTEND_ARGS 1 + enum { /* Note: must be synced with dyngen-exec.h */ TCG_AREG0 = TCG_REG_R10, -- cgit v1.1