From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKDWo-0006ax-Ek for qemu-devel@nongnu.org; Thu, 12 Sep 2013 16:30:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKDWg-0007pI-1F for qemu-devel@nongnu.org; Thu, 12 Sep 2013 16:30:14 -0400 Received: from mail-oa0-x232.google.com ([2607:f8b0:4003:c02::232]:50622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKDWf-0007nE-QM for qemu-devel@nongnu.org; Thu, 12 Sep 2013 16:30:05 -0400 Received: by mail-oa0-f50.google.com with SMTP id i4so348873oah.23 for ; Thu, 12 Sep 2013 13:30:05 -0700 (PDT) Sender: Richard Henderson Message-ID: <52322446.9000401@twiddle.net> Date: Thu, 12 Sep 2013 13:29:58 -0700 From: Richard Henderson MIME-Version: 1.0 References: <1379015124-21055-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1379015124-21055-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] tci: Detect function argument alignment List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Peter Maydell , qemu-devel On 09/12/2013 12:45 PM, Stefan Weil wrote: > +cat > $TMPC << EOF > +#include > +#include > +#include > +#include > +static bool call_align_args(uint32_t arg1, uint64_t arg2) { > + if (arg2 == 0x000000030000004ULL || arg2 == 0x0000000400000003ULL) { > + return true; > + } else if (arg2 == 2) { > + /* 64 bit host, 64 bit function arguments are not aligned. */ > + } else if (arg2 == 0x0000000200000003 || arg2 == 0x0000000300000002ULL) { > + /* 64 bit function arguments are not aligned. */ > + } else { > + fprintf(stderr, "unexpected 64 bit function argument 0x%016" PRIx64 "\n", arg2); > + } > + return false; > +} You will of course be printing that error when run on a 64-bit host. If you're going to go this way, rather than changing to rely on libffi, then you'll also need to detect TCG_TARGET_EXTEND_ARGS for 64-bit hosts. Or perhaps skip that detection and define it always. It's more likely to be right than not doing it. This will break if MIPS64 were added, but then we'd have to extend tcg_gen_callN for that anyway. r~