Re: [Qemu-devel] [PATCH 01/10] tcg: Split out swap_commutative as a subroutine

2012-10-09 Thread Richard Henderson
On 10/09/2012 08:31 AM, Aurelien Jarno wrote: > I am not talking about the code generated by TCG, but rather by the code > generated by GCC. Does using sum += and sum -= brings a gain to compare > to the equivalent if function? It's hard to tell. My guess is that it's about a wash. Adding an art

Re: [Qemu-devel] [PATCH 01/10] tcg: Split out swap_commutative as a subroutine

2012-10-09 Thread Aurelien Jarno
On Tue, Oct 09, 2012 at 08:23:27AM -0700, Richard Henderson wrote: > On 10/09/2012 08:13 AM, Aurelien Jarno wrote: > >> > It also prefers > >> > > >> > add r, r, c > >> > over > >> > add r, c, r > >> > > >> > when both inputs are known constants. This doesn't matter for true add, > >> > as

Re: [Qemu-devel] [PATCH 01/10] tcg: Split out swap_commutative as a subroutine

2012-10-09 Thread Richard Henderson
On 10/09/2012 08:13 AM, Aurelien Jarno wrote: >> > It also prefers >> > >> > add r, r, c >> > over >> > add r, c, r >> > >> > when both inputs are known constants. This doesn't matter for true add, as >> > we will fully constant fold that. But it matters for a follow-on patch >> > using >>

Re: [Qemu-devel] [PATCH 01/10] tcg: Split out swap_commutative as a subroutine

2012-10-09 Thread Aurelien Jarno
On Tue, Oct 02, 2012 at 11:32:21AM -0700, Richard Henderson wrote: > Reduces code duplication and prefers > > movcond d, c1, c2, const, s > to > movcond d, c1, c2, s, const > > It also prefers > > add r, r, c > over > add r, c, r > > when both inputs are known constants. This doesn't m

[Qemu-devel] [PATCH 01/10] tcg: Split out swap_commutative as a subroutine

2012-10-02 Thread Richard Henderson
Reduces code duplication and prefers movcond d, c1, c2, const, s to movcond d, c1, c2, s, const It also prefers add r, r, c over add r, c, r when both inputs are known constants. This doesn't matter for true add, as we will fully constant fold that. But it matters for a follow-on patc