From: Andriy Gapon <avg@FreeBSD.org>
To: malc <av1474@comtv.ru>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] bug in popcnt emulation with some register operand(s)?
Date: Thu, 11 Oct 2012 00:03:50 +0300 [thread overview]
Message-ID: <5075E2B6.9060603@FreeBSD.org> (raw)
In-Reply-To: <5072968C.60000@FreeBSD.org>
on 08/10/2012 12:02 Andriy Gapon said the following:
> on 08/10/2012 10:52 malc said the following:
>> On Mon, 8 Oct 2012, Andriy Gapon wrote:
>>
>>>
>>> I am running Qemu (plain, no kvm, etc) on an AMD 10h machine that
>>> provides popcnt instruction. Qemu advertises availability of pocnt
>>> to a guest as well. What I see in the guest that popcnt
>>> 0x20(%r12),%r8 instruction actually placed its result into %rax.
>>> With %rdi and %rax operands the instruction worked fine though.
>>>
>>>
>>
>> Does following work?
>
> It does! Thank you very much.
Do you plan to commit this fix?
Is there anything that I should do to make that happen (sooner)?
>> diff --git a/target-i386/translate.c b/target-i386/translate.c
>> index e896abf..c36cc3e 100644
>> --- a/target-i386/translate.c
>> +++ b/target-i386/translate.c
>> @@ -7818,7 +7818,7 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
>> goto illegal_op;
>>
>> modrm = cpu_ldub_code(cpu_single_env, s->pc++);
>> - reg = ((modrm >> 3) & 7);
>> + reg = ((modrm >> 3) & 7) | rex_r;
>>
>> if (s->prefix & PREFIX_DATA)
>> ot = OT_WORD;
>>
>
>
--
Andriy Gapon
next prev parent reply other threads:[~2012-10-10 21:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-07 23:12 [Qemu-devel] bug in popcnt emulation with some register operand(s)? Andriy Gapon
2012-10-08 7:52 ` malc
2012-10-08 9:02 ` Andriy Gapon
2012-10-10 21:03 ` Andriy Gapon [this message]
2012-10-10 21:09 ` malc
2012-10-14 10:25 ` Andriy Gapon
2012-10-14 10:56 ` malc
2012-10-14 11:01 ` Andriy Gapon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5075E2B6.9060603@FreeBSD.org \
--to=avg@freebsd.org \
--cc=av1474@comtv.ru \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).