From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LbsGs-0000Vo-4g for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:04:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LbsGq-0000Vb-DD for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:04:04 -0500 Received: from [199.232.76.173] (port=44710 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LbsGq-0000VY-6S for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:04:04 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51531) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LbsGp-0004cy-HN for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:04:03 -0500 Received: from mail.nomovok.com ([83.150.122.238]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LbsGm-0002Ol-6y for qemu-devel@nongnu.org; Tue, 24 Feb 2009 03:04:00 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.nomovok.com (Postfix) with ESMTP id A3B6E1110D5 for ; Tue, 24 Feb 2009 10:03:56 +0200 (EET) Received: from mail.nomovok.com ([127.0.0.1]) by localhost (mail.nomovok.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vX9jW7PKBrs0 for ; Tue, 24 Feb 2009 10:03:52 +0200 (EET) Received: from [192.168.0.41] (a91-153-190-54.elisa-laajakaista.fi [91.153.190.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.nomovok.com (Postfix) with ESMTPSA id DBA0A1110D0 for ; Tue, 24 Feb 2009 10:03:52 +0200 (EET) Message-ID: <49A3A9EA.4040300@nomovok.com> Date: Tue, 24 Feb 2009 10:03:54 +0200 From: Pablo Virolainen MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Fix qemu_ld64 on arm 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 Emulating fldl on arm doesn't seem to work too well. It's the way qemu_ld64 is translated to arm instructions. tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0); tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4); Consider case where data_reg==0, data_reg2==1, and addr_reg==0. First load overwrited addr_reg. So let's put an if (data_ref==addr_reg). Index: tcg-target.c =================================================================== --- tcg-target.c (revision 6642) +++ tcg-target.c (working copy) @@ -1011,8 +1011,14 @@ case 3: /* TODO: use block load - * check that data_reg2 > data_reg or the other way */ - tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0); - tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4); + + if (data_reg==addr_reg) { + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4); + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0); + } else { + tcg_out_ld32_12(s, COND_AL, data_reg, addr_reg, 0); + tcg_out_ld32_12(s, COND_AL, data_reg2, addr_reg, 4); + } break; } #endif