From d6da8bbe8ae346ec72d72084ca1257e00d46a723 Mon Sep 17 00:00:00 2001 From: Klaus Treichel Date: Sun, 16 Dec 2007 11:46:53 +0000 Subject: [PATCH] Add support for multi os archs. Fix jit_builtin_apply for x86_64 by adding r10 and r11 to the clobber list. Fix compiler warnings in _JIT_ALIGN_CHECK_TYPE. --- configure.in | 10 ++++++++++ jit/jit-apply-x86-64.h | 7 +++++++ jit/jit-internal.h | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index becebde..aa00e4a 100644 --- a/configure.in +++ b/configure.in @@ -428,6 +428,16 @@ AC_TRY_COMPILE([], [ ], AC_DEFINE(HAVE_PIC_COMPUTED_GOTO, 1, [Define if you have PIC support for computed gotos]) piccompgoto=yes, piccompgoto=no) AC_MSG_RESULT($piccompgoto) +dnl Check for building on a multi os system +if test x$GCC = xyes ; then + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + *) libdir=$libdir/$multi_os_directory ;; + esac +fi +AC_SUBST(libdir) + dnl Checks for library functions. if test "x$suppress_libm" = "xno" ; then AC_CHECK_LIB(m, sin) diff --git a/jit/jit-apply-x86-64.h b/jit/jit-apply-x86-64.h index 61bb000..6ec4b77 100644 --- a/jit/jit-apply-x86-64.h +++ b/jit/jit-apply-x86-64.h @@ -47,6 +47,12 @@ #define JIT_MEMCPY "jit_memcpy@PLT" #endif +/* + * We have to add all registers not saved by the caller to the clobber list + * and not only the registers used for parameter passing because we do + * function calls. + * Maybe we should add the xmm* registers too? + */ #define jit_builtin_apply(func,args,size,return_float,return_buf) \ do { \ void *__func = (void *)(func); \ @@ -86,6 +92,7 @@ "addq %%rdx, %%rsp\n\t" \ : : "m"(__func), "m"(__args), "m"(__size), "m"(__return_buf) \ : "rax", "rcx", "rdx", "rdi", "rsi", "r8", "r9", \ + "r10", "r11", \ "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", \ "xmm5", "xmm6", "xmm7" \ ); \ diff --git a/jit/jit-internal.h b/jit/jit-internal.h index 91d1828..bfc2663 100644 --- a/jit/jit-internal.h +++ b/jit/jit-internal.h @@ -66,7 +66,7 @@ extern "C" { } #define _JIT_ALIGN_FOR_TYPE(name) \ - ((unsigned)(&(((struct _JIT_align_##name *)0)->field))) + ((jit_nuint)(&(((struct _JIT_align_##name *)0)->field))) #define _JIT_ALIGN_MAX(a,b) \ ((a) > (b) ? (a) : (b)) -- 2.47.3