Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-02-09 Thread Blue Swirl
On Wed, Feb 9, 2011 at 9:41 AM, Paolo Bonzini wrote: > On 02/08/2011 07:05 PM, Richard Henderson wrote: >> >> (Which is probably a mistake from a translator point of view -- there's >> no reason we can't emulate 16-bit operations with 32-bit operations given >> that the high bits are ignorable.) >

[Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-02-08 Thread Paolo Bonzini
On 02/08/2011 07:05 PM, Richard Henderson wrote: (Which is probably a mistake from a translator point of view -- there's no reason we can't emulate 16-bit operations with 32-bit operations given that the high bits are ignorable.) Not really, you never know if the guest is going to use a 66 pref

Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-10 Thread Richard Henderson
On 01/10/2011 10:37 AM, Aurelien Jarno wrote: >> mov y,x >> deposit y,y,x,8,8 >> >> So I could simply put a tcg_abort there. It would be up to whoever >> improves the register allocator to provide some mechanism for a >> backend to allocate a scratch. What do you think? >> > > Do y

Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-10 Thread Aurelien Jarno
On Sun, Jan 09, 2011 at 02:55:13PM -0800, Richard Henderson wrote: > On 01/09/2011 01:53 PM, Aurelien Jarno wrote: > >> +if (inout == val) { > >> +TCGType type = rexw ? TCG_TYPE_I64 : TCG_TYPE_I32; > >> +TCGRegSet inuse = s->reserved_regs; > >> + > >> +tcg_regset_set_reg

Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-10 Thread Aurelien Jarno
On Sun, Jan 09, 2011 at 04:43:22PM -0800, Richard Henderson wrote: > On 01/09/2011 04:16 PM, Aurelien Jarno wrote: > > The code being written now or latter doesn't change the question to know > > if it is always possible to allocate one scratch register here on i386. > > Yes. > > Here there's onl

Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-09 Thread Richard Henderson
On 01/09/2011 04:16 PM, Aurelien Jarno wrote: > The code being written now or latter doesn't change the question to know > if it is always possible to allocate one scratch register here on i386. Yes. Here there's only one register that needs to remain live. In the worst case, we'll spill one li

Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-09 Thread Aurelien Jarno
On Sun, Jan 09, 2011 at 02:55:13PM -0800, Richard Henderson wrote: > On 01/09/2011 01:53 PM, Aurelien Jarno wrote: > >> +if (inout == val) { > >> +TCGType type = rexw ? TCG_TYPE_I64 : TCG_TYPE_I32; > >> +TCGRegSet inuse = s->reserved_regs; > >> + > >> +tcg_regset_set_reg

Re: [Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-09 Thread Richard Henderson
On 01/09/2011 01:53 PM, Aurelien Jarno wrote: >> +if (inout == val) { >> +TCGType type = rexw ? TCG_TYPE_I64 : TCG_TYPE_I32; >> +TCGRegSet inuse = s->reserved_regs; >> + >> +tcg_regset_set_reg(inuse, inout); >> +val = tcg_reg_alloc(s, tcg_target_available_regs[ty

[Qemu-devel] Re: [PATCH 5/7] tcg-i386: Implement deposit operation.

2011-01-09 Thread Aurelien Jarno
On Fri, Jan 07, 2011 at 02:43:01PM -0800, Richard Henderson wrote: > Special case deposits that are implementable with byte and word stores. > Otherwise implement with double-word shift plus rotates. > > Expose tcg_reg_alloc to the backend for allocation of scratch registers. > There's an edge con