qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/4] target-i386: fix movntsd on big-endian host


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 1/4] target-i386: fix movntsd on big-endian hosts
Date: Wed, 14 Jan 2015 11:44:54 -0200
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Jan 14, 2015 at 02:24:57PM +0100, Paolo Bonzini wrote:
> On 14/01/2015 14:17, Eduardo Habkost wrote:
> >>> > > Do we have (or will patch 4/4 introduce) the same bug on the
> >>> > > tcg_gen_addi_ptr() calls that don't use the XMM_Q macro?
> >> > 
> >> > No, they all call into helpers that use the XMM_Q macro themselves.
> > tcg_gen_addi_ptr() is called sometimes using the fpregs[reg].mmx offset,
> > and sometimes using the xmm_regs[reg] offset. How can it know if the
> > XMM_Q macro is necessary or not?
> 
> It can't, but I audited the calls.
> 
> Note that one helper is foo_xmm, the other is foo_mmx:
> 
>                 tcg_gen_addi_ptr(cpu_ptr0, cpu_env, 
> offsetof(CPUX86State,xmm_regs[rm]));
>                 gen_helper_pmovmskb_xmm(cpu_tmp2_i32, cpu_env, cpu_ptr0);
>             } else {
>                 rm = (modrm & 7);
>                 tcg_gen_addi_ptr(cpu_ptr0, cpu_env, 
> offsetof(CPUX86State,fpregs[rm].mmx));
>                 gen_helper_pmovmskb_mmx(cpu_tmp2_i32, cpu_env, cpu_ptr0);

Oh, I was assuming tcg_gen_addi_ptr() would reference data at that
offset somehow, but now I see that it will just add the pointer to the
offset. Looks OK to me.

-- 
Eduardo



reply via email to

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