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: Peter Maydell
Subject: Re: [Qemu-devel] op-helper.c vs helper.c
Date: Mon, 19 Sep 2011 14:49:54 +0100

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. 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.

> 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



reply via email to

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