From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JFRte-0005pX-MM for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JFRtd-0005oz-01 for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:54 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFRtc-0005ot-Ne for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:52 -0500 Received: from kassel160.server4you.de ([62.75.246.160] helo=csgraf.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JFRtc-0008My-8Z for qemu-devel@nongnu.org; Thu, 17 Jan 2008 05:22:52 -0500 Received: from [10.10.100.38] (charybdis-ext.suse.de [195.135.221.2]) by csgraf.de (Postfix) with ESMTP id 2313E615F for ; Thu, 17 Jan 2008 11:22:51 +0100 (CET) Message-ID: <478EF8F1.5060201@csgraf.de> Date: Thu, 17 Jan 2008 07:42:57 +0100 From: Alexander Graf MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010906090304010103010900" Subject: [Qemu-devel] [PATCH 4/5] (PPC) Fix Alpha target floating point Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------010906090304010103010900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This fixes the Alpha target for PowerPC hosts. It is merely a part of the original gcc4 patch posted by Michael Matz. --------------010906090304010103010900 Content-Type: text/x-patch; name="qemu-gcc4-ppc-alpha.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-gcc4-ppc-alpha.patch" --- qemu-0.9.0.cvs/target-alpha/op_template.h.mm 2007-08-22 03:17:57.000000000 +0000 +++ qemu-0.9.0.cvs/target-alpha/op_template.h 2007-08-22 03:15:49.000000000 +0000 @@ -28,7 +28,26 @@ void OPPROTO glue(op_reset_T, REG) (void void OPPROTO glue(op_reset_FT, REG) (void) { +#ifdef HOST_PPC + /* We have a problem with HOST_PPC here: + We want this code: + glue(FT, REG) = 0; + unfortunately GCC4 notices that this stores (double)0.0 into + env->ft0 and emits that constant into the .rodata, and instructions + to load that zero from there. But that construct can't be parsed by dyngen. + We could add -ffast-math for compiling op.c, that would just make it generate + two stores of zeros into both words of ft0. But -ffast-math may have other + side-effects regarding the emulation. We could use __builtin_memset, + which perhaps would be the sanest. That relies on -O2 and our other options + to inline that memset, which currently it does, but who knows for how long. + So, we simply do that by hand, and a barely typesafe way :-/ */ + union baeh { double d; unsigned int i[2];}; + union baeh *p = (union baeh*)&(glue(FT, REG)); + p->i[0] = 0; + p->i[1] = 0; +#else glue(FT, REG) = 0; +#endif RETURN(); } --------------010906090304010103010900--