qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/6] Add copy and constant propagation.


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/6] Add copy and constant propagation.
Date: Fri, 20 May 2011 20:46:53 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/20/2011 08:22 PM, Richard Henderson wrote:
I think it might be clearer to have these two in a structure, rather
than two separate arrays.  That does waste a bit of memory in padding
for 64-bit target, but I think it might clean up the code a bit.

You can use the padding to implement a generation count. O(1) clearing of the array might help performance somewhat. At this point making the arrays static makes sense again, because it allows to bump the generation count at the beginning of tcg_constant_folding (if you put it on the stack you have to zero the state).

It could also help to add a num_copies flag tracking whether a register is a copy of this one. If not, you can avoid processing the output registers in the default case.

That would be something like

struct {
    uint16_t state;
    uint16_t num_copies;
    uint32_t gen;
    tcg_target_ulong val;
};

Paolo



reply via email to

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