qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RISU v2 07/11] test_i386: change syntax from nasm to g


From: Jan Bobek
Subject: Re: [Qemu-devel] [RISU v2 07/11] test_i386: change syntax from nasm to gas
Date: Tue, 21 May 2019 13:07:27 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 5/21/19 12:56 PM, Richard Henderson wrote:
> On 5/21/19 12:48 PM, Jan Bobek wrote:
>> I get the same behavior, but it only occurs on 32bit builds of
>> RISU. Specifically, in risu_reginfo_i386.c, lines 172--178:
>>
>>     for (i = 0; i < nvecregs; ++i) {
>> #ifdef __x86_64__
>>         memcpy(&ri->vregs[i], &fp->xmm_space[i], 16);
>> #else
>>         memcpy(&ri->vregs[i], &fp->_xmm[i * 4], 16);
>> #endif
>>     }
>>
>> In the #else branch, fp->_xmm has type _libc_xmmreg[16], and
>> _libc_xmmreg itself is a struct with a 4-element array of uint32s. On
>> my box, this gets fixed by dropping the multiplication from the index,
>> i.e.
>>
>>         memcpy(&ri->vregs[i], &fp->_xmm[i], 16);
>>
>> I wonder why Richard wrote it like this in the first place; did
>> fp->_xmm use to be an array of uint32s in previous versions of this
>> API?
> 
> I dunno what happened, but these indexes are backward.
> 
>>From <asm/sigcontext.h>:
> 
> struct _fpstate_32 {
>     ...
>         struct _xmmreg _xmm[8];
> 
> 
> struct _fpstate_64 {
>     ...
>         __u32 xmm_space[64];  /* 16x XMM registers, 16 bytes each */

Indeed; that makes for one more fix in v3.

-Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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