From: Avi Kivity <avi@redhat.com>
To: Wei Yongjun <yjwei@cn.fujitsu.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86 emulator: add bsf/bsr instruction emulation
Date: Mon, 09 Aug 2010 23:14:21 -0400 [thread overview]
Message-ID: <4C60C40D.7070905@redhat.com> (raw)
In-Reply-To: <4C5FD1A5.5040805@cn.fujitsu.com>
On 08/09/2010 06:00 AM, Wei Yongjun wrote:
> Add bsf/bsr instruction emulation (opcode 0x0f 0xbc~0xbd)
>
> @@ -3464,6 +3464,30 @@ twobyte_insn:
> btc: /* btc */
> emulate_2op_SrcV_nobyte("btc", c->src, c->dst, ctxt->eflags);
> break;
> + case 0xbc: { /* bsf */
> + int zf;
> + __asm__ ("bsf %2, %0; setz %b1"
> + : "=r"(c->dst.val), "=q"(zf)
> + : "r"(c->src.val), "1" (0));
Won't the high bytes of zf remain clear? Please examine the assembly.
Declaring it u8 is probably better.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
next prev parent reply other threads:[~2010-08-10 3:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-09 10:00 [PATCH] KVM: x86 emulator: add bsf/bsr instruction emulation Wei Yongjun
2010-08-10 3:14 ` Avi Kivity [this message]
2010-08-10 5:48 ` [PATCH v2] " Wei Yongjun
2010-08-10 10:21 ` Avi Kivity
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=4C60C40D.7070905@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=yjwei@cn.fujitsu.com \
/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).