Re: [patch 2 of 2] Emulate CMPS instruction

Guillaume Thouvenin
2007-11-26T09:58:45Z

On Fri, 23 Nov 2007 19:54:46 +0200
Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org> wrote:

>
> No new macros in the emulator please. Just inline it at the callsite.
>

Ok I make the modification.
: c->dst.bytes);
> > break;
> > case 0xa6 ... 0xa7: /* cmps */
> > - DPRINTF("Urk! I don't handle CMPS.\n");
> > - goto cannot_emulate;
> > + c->src.type = OP_NONE;
> >
>
> Shouldn't this be OP_MEM?

As bytes to be compared are just read I use OP_NONE to disable writeback.

>
> > + c->dst.bytes = (c->d & ByteOp) ? 1 : c->op_bytes;
> > + c->dst.ptr = (unsigned long *)register_address(
> > + ctxt->es_base,
> > + c->regs[VCPU_REGS_RSI]);
> > +
> > + DPRINTF("cmps: mem1=0x%p mem2=0x%p\n", c->src.ptr, c->dst.ptr);
> > +
> >
>
> Where is the actual memory access?

Oops I missed that point.... I fix that immediately.

Thanks for your help,
Guillaume