On Mon, Sep 19, 2011 at 9:49 AM, Peter Maydell <peter.mayd...@linaro.org>wrote:

> On 19 September 2011 13:06, Xin Tong Utoronto <x.t...@utoronto.ca> 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