@@ -3727,30 +3727,16 @@ twobyte_insn:
btc: /* btc */
emulate_2op_SrcV_nobyte("btc", c->src, c->dst, ctxt->eflags);
break;
- case 0xbc: { /* bsf */
- u8 zf;
- __asm__ ("bsf %2, %0; setz %1"
- : "=r"(c->dst.val), "=q"(zf)
- : "r"(c->src.val));
- ctxt->eflags &= ~X86_EFLAGS_ZF;
- if (zf) {
- ctxt->eflags |= X86_EFLAGS_ZF;
- c->dst.type = OP_NONE; /* Disable writeback. */
- }
+ case 0xbc: /* bsf */
+ emulate_2op_SrcV_nobyte("bsf", c->src, c->dst, ctxt->eflags);
+ if (ctxt->eflags & X86_EFLAGS_ZF)
+ c->dst.type = OP_NONE; /* Disable writeback. */
break;
- }
- case 0xbd: { /* bsr */
- u8 zf;
- __asm__ ("bsr %2, %0; setz %1"
- : "=r"(c->dst.val), "=q"(zf)
- : "r"(c->src.val));
- ctxt->eflags &= ~X86_EFLAGS_ZF;
- if (zf) {
- ctxt->eflags |= X86_EFLAGS_ZF;
- c->dst.type = OP_NONE; /* Disable writeback. */
- }
+ case 0xbd: /* bsr */
+ emulate_2op_SrcV_nobyte("bsr", c->src, c->dst, ctxt->eflags);
+ if (ctxt->eflags & X86_EFLAGS_ZF)
+ c->dst.type = OP_NONE; /* Disable writeback. */
break;
- }
case 0xbe ... 0xbf: /* movsx */
c->dst.bytes = c->op_bytes;
c->dst.val = (c->d & ByteOp) ? (s8) c->src.val :