Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KFZ12-0007jp-S5 for qemu-devel@nongnu.org; Sun, 06 Jul 2008 14:31:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KFZ10-0007iw-9o for qemu-devel@nongnu.org; Sun, 06 Jul 2008 14:31:15 -0400 Received: from [199.232.76.173] (port=35183 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KFZ10-0007io-5K for qemu-devel@nongnu.org; Sun, 06 Jul 2008 14:31:14 -0400 Received: from gwyn.kn-bremen.de ([212.63.36.242]:40377) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KFZ0z-0007YK-K4 for qemu-devel@nongnu.org; Sun, 06 Jul 2008 14:31:13 -0400 Received: from saturn.kn-bremen.de (nox@localhost [127.0.0.1]) by saturn.kn-bremen.de (8.14.2/8.13.8) with ESMTP id m66ITVkW019015 for ; Sun, 6 Jul 2008 20:29:31 +0200 (CEST) (envelope-from nox@saturn.kn-bremen.de) Received: (from nox@localhost) by saturn.kn-bremen.de (8.14.2/8.13.6/Submit) id m66ITVix019014 for qemu-devel@nongnu.org; Sun, 6 Jul 2008 20:29:31 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Sun, 6 Jul 2008 20:29:31 +0200 Message-ID: <20080706182931.GA17953@saturn.kn-bremen.de> References: <20080704193204.GA19298@saturn.kn-bremen.de> <20080705212946.GA91468@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080705212946.GA91468@saturn.kn-bremen.de> Subject: [Qemu-devel] [PATCH] tcg: fix cvtsi2ssq & friends on 32 bit hosts (was: fixed one bug, found another :) 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 (I just noticed I didn't mark the previous post with `[PATCH]', its at http://lists.gnu.org/archive/html/qemu-devel/2008-07/msg00137.html if anyone missed it.) On Sat, Jul 05, 2008 at 11:29:46PM +0200, I wrote: > [...] > Ok while writing this I was waiting for a Linux/amd64 guest to boot, which > still failed, and the reason seems to be that either floats or conversion > of floats to integers are also broken for amd64 guests on i386 hosts, > as can be seen by: > > (gdb) p 1. > $1 = -nan(0x8000000000000) Ok and the reason for this was cvtsi2ssq and friends were not handled right: Index: qemu/target-i386/translate.c @@ -3330,8 +3330,12 @@ op1_offset = offsetof(CPUX86State,xmm_regs[reg]); tcg_gen_addi_ptr(cpu_ptr0, cpu_env, op1_offset); sse_op2 = sse_op_table3[(s->dflag == 2) * 2 + ((b >> 8) - 2)]; - tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); - tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_tmp2_i32); + if (ot == OT_LONG) { + tcg_gen_trunc_tl_i32(cpu_tmp2_i32, cpu_T[0]); + tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_tmp2_i32); + } else { + tcg_gen_helper_0_2(sse_op2, cpu_ptr0, cpu_T[0]); + } break; case 0x02c: /* cvttps2pi */ case 0x12c: /* cvttpd2pi */ With this my Linux/amd64 guest ( sidux-2008-02-erebos-kde-full-i386-amd64-200806251839.iso debian sid based, see http://sidux.com ) now finally boots in 64 bit mode, only X doesn't start for some reason, manually invoking startx seems to work though. And more important, I get the same behaviour when using the older 20080302 snapshot, so that bug doesn't seem to have much to do with tcg at least. :) Thanx, Juergen