qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] gen_icount_start


From: Peter Maydell
Subject: Re: [Qemu-devel] gen_icount_start
Date: Mon, 31 Dec 2012 01:01:06 +0000

On 30 December 2012 23:14, biswaranjan panda
<address@hidden> wrote:
> What I understand is that in gen_icount_start 'icount_arg' keeps a pointer
> to gen_opparam_ptr which is used in gen_icount_end to patch up the value . I
> however didnt understand what the 'horrid hack' is about. Can any one give
> me some idea on this ?

My guess is that it's a hack because it's a layering violation. Functions
that generate TCG (intermediate representation) should do it by calling
the tcg_ functions, and the data structures and variables like
gen_opparam_ptr should be internal to the TCG layer. However here we
rely on knowing implementation details of how the TCG layer actually writes
out the ops and parameters when you call tcg_gen_subi_i32().
A clean design would make the TCG layer provide some kind of API for
writing out code and then fixing up the values afterwards, but on the other
hand if we only have one use case...

-- PMM



reply via email to

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