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.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html