Re: [Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr helpers to TCG

2012-09-25 Thread Aurelien Jarno
On Tue, Sep 25, 2012 at 02:57:20PM +0100, Peter Maydell wrote: > On 21 September 2012 20:33, Aurelien Jarno wrote: > > +static void gen_sar(TCGv dest, TCGv t0, TCGv t1) > > +{ > > +TCGv tmp1, tmp2, tmp3; > > +tmp1 = tcg_temp_new_i32(); > > +tcg_gen_andi_i32(tmp1, t1, 0xff); > > +tm

Re: [Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr helpers to TCG

2012-09-25 Thread Peter Maydell
On 21 September 2012 20:33, Aurelien Jarno wrote: > +static void gen_sar(TCGv dest, TCGv t0, TCGv t1) > +{ > +TCGv tmp1, tmp2, tmp3; > +tmp1 = tcg_temp_new_i32(); > +tcg_gen_andi_i32(tmp1, t1, 0xff); > +tmp2 = tcg_const_i32(0x1f); > +tmp3 = tcg_const_i32(0); > +tcg_gen_movc

Re: [Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr helpers to TCG

2012-09-22 Thread Aurelien Jarno
On Fri, Sep 21, 2012 at 04:14:29PM -0700, Richard Henderson wrote: > On 09/21/2012 12:33 PM, Aurelien Jarno wrote: > > +static void gen_sar(TCGv dest, TCGv t0, TCGv t1) > > +{ > > +TCGv tmp1, tmp2, tmp3; > > +tmp1 = tcg_temp_new_i32(); > > +tcg_gen_andi_i32(tmp1, t1, 0xff); > > +tmp

Re: [Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr helpers to TCG

2012-09-21 Thread Richard Henderson
On 09/21/2012 12:33 PM, Aurelien Jarno wrote: > +static void gen_sar(TCGv dest, TCGv t0, TCGv t1) > +{ > +TCGv tmp1, tmp2, tmp3; > +tmp1 = tcg_temp_new_i32(); > +tcg_gen_andi_i32(tmp1, t1, 0xff); > +tmp2 = tcg_const_i32(0x1f); > +tmp3 = tcg_const_i32(0); > +tcg_gen_movcond_i

[Qemu-devel] [PATCH v2 3/5] target-arm: convert sar, shl and shr helpers to TCG

2012-09-21 Thread Aurelien Jarno
Now that the movcond TCG op is available, it's possible to replace shl and shr helpers by TCG code. The code generated by TCG is slightly longer than the code generated by GCC for the helper but is still worth it as this avoid all the consequences of using an helper: globals saved back to memory, n