qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] op-helper.c vs helper.c


From: Xin Tong Utoronto
Subject: Re: [Qemu-devel] op-helper.c vs helper.c
Date: Thu, 22 Sep 2011 09:09:36 -0400



On Mon, Sep 19, 2011 at 9:49 AM, Peter Maydell <address@hidden> wrote:
On 19 September 2011 13:06, Xin Tong Utoronto <address@hidden> wrote:
> There are 2 files on helpers in target-ppc and target-i386 ( op-helper.c
>  helper.c), what are their differences ? also, what kind of functions are
> typically emulated using helpers ?

The key difference is that op_helper.c is compiled with compiler
flags and includes header files that give it access to a global
variable 'CPUState *env' which is kept in a fixed CPU register
during execution of translated code.

This is easier for the tcg to call ?
 
helper.c (and other foo_helper.c
files) are built as regular C files, and so if they need access to the
CPU state it has to be passed into the helper as an explicit parameter.
 
We're currently trying to cut back on the use of the implicit global,
so new helper functions should probably go in helper.c.

Why do we want to cut back on the use of the implicit global ? what is the criteria for a function to be in the implicit global list ?
 
> also, what kind of functions are typically emulated using helpers ?

Anything that seems too hard to do inline :-) tcg/README has a
paragraph at the end giving some rules of thumb.

-- PMM



--
Kind Regards

Xin Tong

reply via email to

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