qemu-devel
[Top][All Lists]
Advanced

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

RE: [PATCH] Add support for a helper with 7 arguments


From: Taylor Simpson
Subject: RE: [PATCH] Add support for a helper with 7 arguments
Date: Sun, 9 Feb 2020 20:51:07 +0000


> -----Original Message-----
> From: Richard Henderson <address@hidden>
> Sent: Sunday, February 9, 2020 12:18 PM
> To: Taylor Simpson <address@hidden>; Richard Henderson
> <address@hidden>; address@hidden
> Cc: Paolo Bonzini <address@hidden>
> Subject: Re: [PATCH] Add support for a helper with 7 arguments
> We can optimize them.
>
> However, you should prefer to use tcg_gen_addi_* over tcg_gen_add_*
> (etc) when
> you know that one operand is constant.  This will optimize away the add zero
> immediately as opposed to allocating memory and walking the data
> structures to
> eliminate it later.

OK, will work on this.

>
> Why are you using a local temporary for EA?  That should be dead
> immediately
> after this slot is complete.

The declaration of EA is added by the generator.  It's declared as a local temp 
to be conservative in case there is control flow.  I'll work on making the 
generator smarter.  I think it will work to check if the instruction is 
predicated and use a temp if it isn't.


>
> What's with two temporaries both named "new_value"?
>

It's actually an array that parallels the GPRs.  I'm just passing the same 
string to each call to tcg_global_mem_new.  I'll change it to be a unique 
string for each.

> >> For a conditional load in slot 0, we can load directly into the final
> >> destination register and skip the temporary.
> >
> > In general, there will be lots of checks we would need to perform before
> > concluding that an instruction can write directly into the destination.  For
> > example, we have to make sure no other instruction later in the packet
> reads
> > r7.
>
> Which is of course all trivial for slot 0, being last.

Slot 0 might be last in the encoding, but that doesn't mean it is the last one 
to execute.  Remember that the packet gets reordered before TCG generation so 
that .new definitions are before their uses.  So, if the result of the slot 0 
instruction is used by a .new reference, it won't be last.


reply via email to

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