qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] tcg: fix cvtsi2ssq & friends on 32 bit hosts (was:


From: Juergen Lock
Subject: [Qemu-devel] [PATCH] tcg: fix cvtsi2ssq & friends on 32 bit hosts (was: fixed one bug, found another :)
Date: Sun, 6 Jul 2008 20:29:31 +0200
User-agent: Mutt/1.5.17 (2007-11-01)

(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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]