qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] TCG on i386 can't generate qemu_st64 for 32-bit target


From: Blue Swirl
Subject: [Qemu-devel] TCG on i386 can't generate qemu_st64 for 32-bit target
Date: Tue, 26 Feb 2008 21:55:08 +0200

Hi,

There is a problem with the Sparc32 target on i386 host. Store double
word op (std) cannot be generated and TCG just aborts. It looks like
the registers are so few on i386 that TCG can't find registers for the
qemu_st64 call. The problem does not appear on x86_64 host, or for
Sparc64 target (stx/ldx) on i386, or with 64-bit load (ldd) on Sparc32
target.

The attached patch would work around the problem, but I agree that
it's ugly and it would bring back one instance of T2 use. I also tried
preallocating a 64-bit register but that didn't help.

I suppose instead the following piece (tcg/i386/tcg-target.c:737)
could be modified to lower the pressure for registers but I'm not that
familiar with x86 assembly.

#if TARGET_LONG_BITS == 32
    if (opc == 3) {
        tcg_out_mov(s, TCG_REG_EDX, data_reg);
        tcg_out_mov(s, TCG_REG_ECX, data_reg2);
        tcg_out8(s, 0x6a); /* push Ib */
        tcg_out8(s, mem_index);
        tcg_out8(s, 0xe8);
        tcg_out32(s, (tcg_target_long)qemu_st_helpers[s_bits] -
                  (tcg_target_long)s->code_ptr - 4);
        tcg_out_addi(s, TCG_REG_ESP, 4);
    } else {

Attachment: std_fix_i386.diff
Description: Text Data


reply via email to

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