From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK2PK-0003cx-AO for qemu-devel@nongnu.org; Mon, 04 Jul 2016 07:51:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK2PH-0005Wa-4F for qemu-devel@nongnu.org; Mon, 04 Jul 2016 07:51:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK2PG-0005WP-Uy for qemu-devel@nongnu.org; Mon, 04 Jul 2016 07:51:19 -0400 References: <1467392693-22715-1-git-send-email-rth@twiddle.net> <1467392693-22715-7-git-send-email-rth@twiddle.net> From: Paolo Bonzini Message-ID: Date: Mon, 4 Jul 2016 13:51:14 +0200 MIME-Version: 1.0 In-Reply-To: <1467392693-22715-7-git-send-email-rth@twiddle.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/27] int128: Use complex numbers if advisable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-devel@nongnu.org Cc: cota@braap.org, alex.bennee@linaro.org, peter.maydell@linaro.org, serge.fdrv@gmail.com On 01/07/2016 19:04, Richard Henderson wrote: > If __int128 is not supported, prefer a base type that is > returned in registers rather than memory. > > Signed-off-by: Richard Henderson > --- > include/qemu/int128.h | 110 +++++++++++++++++++++++++++++++------------------- > 1 file changed, 69 insertions(+), 41 deletions(-) > > diff --git a/include/qemu/int128.h b/include/qemu/int128.h > index 67440fa..ab67275 100644 > --- a/include/qemu/int128.h > +++ b/include/qemu/int128.h > @@ -139,27 +139,37 @@ static inline void int128_subfrom(Int128 *a, Int128 b) > > #else /* !CONFIG_INT128 */ > > -typedef struct Int128 Int128; > +/* Here we are catering to the ABI of the host. If the host returns > + 64-bit complex in registers, but the 128-bit structure in memory, > + then choose the complex representation. */ > +#if defined(__GNUC__) \ > + && (defined(__powerpc__) || defined(__sparc__)) \ > + && !defined(CONFIG_TCG_INTERPRETER) > +typedef _Complex unsigned long long Int128; Is there any reason not to do that unconditionally? Paolo