qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-ppc] [PATCH] Bug fix for #986241: spell env corre


From: Peter Maydell
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] Bug fix for #986241: spell env correctly
Date: Mon, 23 Apr 2012 08:24:10 +0100

On 23 April 2012 03:25, Peter Portante <address@hidden> wrote:
> Can somebody speak to the history of using a global variable for env state
> instead of passing it around in function calls? Is this because we could not
> trust the compiler to keep it in a register between function calls? If so,
> then do you think it might be worth a look at what the compilers can do to
> help simplify somewhat complicated code and still maintain the performance?
> Or was it that env had to be added to so many functions that it became too
> tedious to maintain?

It's historical legacy, really. env is in a fixed register when running
in TCG code, and so some functions called directly from TCG code have
also been compiled to assume env to be in that fixed register, to avoid
the overhead of having TCG code marshall it in as a function parameter.
Blue Swirl has been working on patchsets that move towards always
passing it in a register; unfortunately there is apparently a performance
hit associated with this, though.

-- PMM



reply via email to

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