qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] User mode emulation and TCG_OPF_CALL_CLOBBER


From: Edgar E. Iglesias
Subject: Re: [Qemu-devel] User mode emulation and TCG_OPF_CALL_CLOBBER
Date: Mon, 29 Dec 2008 11:46:07 +0100
User-agent: Mutt/1.5.16 (2007-06-09)

On Fri, Dec 26, 2008 at 03:32:06PM +0100, Laurent Desnogues wrote:
> Hello,
> 
> while looking at generated code for a user mode emulated program
> I noticed some registers were saved/restored for qemu_{ld,st}
> operations.  My understanding is that this is only needed for softmmu
> (and even in that case for the slow path as a comment in tcg.c says)
> since in that case, a call to a helper might be generated.
> 
> This register save & restore behavior is enabled by the op flag
> TCG_OPF_CALL_CLOBBER.
> 
> A quick test on ARM target and x86_64 host for a SPEC2000 test
> shows removing that flag speeds up execution by about 15%.
> 
> Did I understand things correctly?  If so what would be the best

Hello Laurent,

I think you did and I think what you propose kind of makes sense but
unfortunately your patch exposes errors on my setup.

The i386 backend's ld64 seems to clobber registers (eax/edx) behind
tcg's back and with your patch at least CRIS no longer passes it's testsuite
on i386 hosts. (Actually, I can't see how the plain tcg_gen_ld_i64 can work
reliably with the i386 backend from svn.)

Anyway, I made a dirty local fix for the ld64 issue and I am seeing about
5% performance improvements with my tests.

Another issue I'm worried about is when apps segfault, I think there is a
risk that part of the CPUState remains in host registers making programs
much harder to debug.

I'd very much like to see the speedup but IMO we should first fix these
issues.

Thanks




reply via email to

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