Re: [Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-10-01 Thread Richard Henderson
On 2012-10-01 10:46, Aurelien Jarno wrote: > For the first add2 that seemed to have work correctly, this patch > optimized 0.2% of them. I am not sure it worth it as is. You're probably right. > I think optimizing add2, and in general all *2 ops is a good idea, but > we should be able to do more

Re: [Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-10-01 Thread Richard Henderson
On 2012-09-30 00:04, Blue Swirl wrote: >> We can't do complete constant folding because we lack "mov2", >> > or the ability to insert opcodes in the stream. But we can >> > at least canonicalize add2 operand ordering and simplify >> > add2 to add when the lowpart adds a constant 0. > Couldn't we i

Re: [Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-10-01 Thread Aurelien Jarno
On Thu, Sep 27, 2012 at 04:28:47PM -0700, Richard Henderson wrote: > On 09/27/2012 04:20 PM, Aurelien Jarno wrote: > > I understand that we can't easily insert an instruction, so the > > limitation comes from here, but is it really something happening often? > > It will certainly appear sometimes.

Re: [Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-09-30 Thread Blue Swirl
On Thu, Sep 27, 2012 at 5:19 PM, Richard Henderson wrote: > We can't do complete constant folding because we lack "mov2", > or the ability to insert opcodes in the stream. But we can > at least canonicalize add2 operand ordering and simplify > add2 to add when the lowpart adds a constant 0. Coul

Re: [Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-09-27 Thread Richard Henderson
On 09/27/2012 04:20 PM, Aurelien Jarno wrote: > I understand that we can't easily insert an instruction, so the > limitation comes from here, but is it really something happening often? It will certainly appear sometimes. E.g. s390x has an add immediate instruction that does exactly: r1 += imm16

Re: [Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-09-27 Thread Aurelien Jarno
On Thu, Sep 27, 2012 at 10:19:52AM -0700, Richard Henderson wrote: > We can't do complete constant folding because we lack "mov2", > or the ability to insert opcodes in the stream. But we can > at least canonicalize add2 operand ordering and simplify > add2 to add when the lowpart adds a constant

[Qemu-devel] [PATCH 2/7] tcg: Optimize add2 + sub2

2012-09-27 Thread Richard Henderson
We can't do complete constant folding because we lack "mov2", or the ability to insert opcodes in the stream. But we can at least canonicalize add2 operand ordering and simplify add2 to add when the lowpart adds a constant 0. Signed-off-by: Richard Henderson --- tcg/optimize.c | 31