Lines Matching refs:op
238 struct opcode op[8]; member
315 #define FOP_START(op) \ argument
316 extern void em_##op(struct fastop *fake); \
318 ".global em_" #op " \n\t" \
320 "em_" #op ": \n\t"
327 #define FOP1E(op, dst) \ argument
328 FOP_ALIGN "10: " #op " %" #dst " \n\t" FOP_RET
330 #define FOP1EEX(op, dst) \ argument
331 FOP1E(op, dst) _ASM_EXTABLE(10b, kvm_fastop_exception)
333 #define FASTOP1(op) \ argument
334 FOP_START(op) \
335 FOP1E(op##b, al) \
336 FOP1E(op##w, ax) \
337 FOP1E(op##l, eax) \
338 ON64(FOP1E(op##q, rax)) \
342 #define FASTOP1SRC2(op, name) \ argument
344 FOP1E(op, cl) \
345 FOP1E(op, cx) \
346 FOP1E(op, ecx) \
347 ON64(FOP1E(op, rcx)) \
351 #define FASTOP1SRC2EX(op, name) \ argument
353 FOP1EEX(op, cl) \
354 FOP1EEX(op, cx) \
355 FOP1EEX(op, ecx) \
356 ON64(FOP1EEX(op, rcx)) \
359 #define FOP2E(op, dst, src) \ argument
360 FOP_ALIGN #op " %" #src ", %" #dst " \n\t" FOP_RET
362 #define FASTOP2(op) \ argument
363 FOP_START(op) \
364 FOP2E(op##b, al, dl) \
365 FOP2E(op##w, ax, dx) \
366 FOP2E(op##l, eax, edx) \
367 ON64(FOP2E(op##q, rax, rdx)) \
371 #define FASTOP2W(op) \ argument
372 FOP_START(op) \
374 FOP2E(op##w, ax, dx) \
375 FOP2E(op##l, eax, edx) \
376 ON64(FOP2E(op##q, rax, rdx)) \
380 #define FASTOP2CL(op) \ argument
381 FOP_START(op) \
382 FOP2E(op##b, al, cl) \
383 FOP2E(op##w, ax, cl) \
384 FOP2E(op##l, eax, cl) \
385 ON64(FOP2E(op##q, rax, cl)) \
389 #define FASTOP2R(op, name) \ argument
391 FOP2E(op##b, dl, al) \
392 FOP2E(op##w, dx, ax) \
393 FOP2E(op##l, edx, eax) \
394 ON64(FOP2E(op##q, rdx, rax)) \
397 #define FOP3E(op, dst, src, src2) \ argument
398 FOP_ALIGN #op " %" #src2 ", %" #src ", %" #dst " \n\t" FOP_RET
401 #define FASTOP3WCL(op) \ argument
402 FOP_START(op) \
404 FOP3E(op##w, ax, dx, cl) \
405 FOP3E(op##l, eax, edx, cl) \
406 ON64(FOP3E(op##q, rax, rdx, cl)) \
410 #define FOP_SETCC(op) ".align 4; " #op " %al; ret \n\t" argument
970 static void fetch_register_operand(struct operand *op) in fetch_register_operand() argument
972 switch (op->bytes) { in fetch_register_operand()
974 op->val = *(u8 *)op->addr.reg; in fetch_register_operand()
977 op->val = *(u16 *)op->addr.reg; in fetch_register_operand()
980 op->val = *(u32 *)op->addr.reg; in fetch_register_operand()
983 op->val = *(u64 *)op->addr.reg; in fetch_register_operand()
1121 struct operand *op) in decode_register_operand() argument
1129 op->type = OP_XMM; in decode_register_operand()
1130 op->bytes = 16; in decode_register_operand()
1131 op->addr.xmm = reg; in decode_register_operand()
1132 read_sse_reg(ctxt, &op->vec_val, reg); in decode_register_operand()
1137 op->type = OP_MM; in decode_register_operand()
1138 op->bytes = 8; in decode_register_operand()
1139 op->addr.mm = reg; in decode_register_operand()
1143 op->type = OP_REG; in decode_register_operand()
1144 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; in decode_register_operand()
1145 op->addr.reg = decode_register(ctxt, reg, ctxt->d & ByteOp); in decode_register_operand()
1147 fetch_register_operand(op); in decode_register_operand()
1148 op->orig_val = op->val; in decode_register_operand()
1158 struct operand *op) in decode_modrm() argument
1175 op->type = OP_REG; in decode_modrm()
1176 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; in decode_modrm()
1177 op->addr.reg = decode_register(ctxt, ctxt->modrm_rm, in decode_modrm()
1180 op->type = OP_XMM; in decode_modrm()
1181 op->bytes = 16; in decode_modrm()
1182 op->addr.xmm = ctxt->modrm_rm; in decode_modrm()
1183 read_sse_reg(ctxt, &op->vec_val, ctxt->modrm_rm); in decode_modrm()
1187 op->type = OP_MM; in decode_modrm()
1188 op->bytes = 8; in decode_modrm()
1189 op->addr.mm = ctxt->modrm_rm & 7; in decode_modrm()
1192 fetch_register_operand(op); in decode_modrm()
1196 op->type = OP_MEM; in decode_modrm()
1286 op->addr.mem.ea = modrm_ea; in decode_modrm()
1295 struct operand *op) in decode_abs() argument
1299 op->type = OP_MEM; in decode_abs()
1302 op->addr.mem.ea = insn_fetch(u16, ctxt); in decode_abs()
1305 op->addr.mem.ea = insn_fetch(u32, ctxt); in decode_abs()
1308 op->addr.mem.ea = insn_fetch(u64, ctxt); in decode_abs()
1705 static void write_register_operand(struct operand *op) in write_register_operand() argument
1707 return assign_register(op->addr.reg, op->val, op->bytes); in write_register_operand()
1710 static int writeback(struct x86_emulate_ctxt *ctxt, struct operand *op) in writeback() argument
1712 switch (op->type) { in writeback()
1714 write_register_operand(op); in writeback()
1719 op->addr.mem, in writeback()
1720 &op->orig_val, in writeback()
1721 &op->val, in writeback()
1722 op->bytes); in writeback()
1725 op->addr.mem, in writeback()
1726 &op->val, in writeback()
1727 op->bytes); in writeback()
1731 op->addr.mem, in writeback()
1732 op->data, in writeback()
1733 op->bytes * op->count); in writeback()
1736 write_sse_reg(ctxt, &op->vec_val, op->addr.xmm); in writeback()
1739 write_mmx_reg(ctxt, &op->mm_val, op->addr.mm); in writeback()
3263 struct operand *op) in string_addr_inc() argument
3265 int df = (ctxt->eflags & X86_EFLAGS_DF) ? -op->count : op->count; in string_addr_inc()
3267 register_address_increment(ctxt, reg, df * op->bytes); in string_addr_inc()
3268 op->addr.mem.ea = register_address(ctxt, reg); in string_addr_inc()
4569 static int decode_imm(struct x86_emulate_ctxt *ctxt, struct operand *op, in decode_imm() argument
4574 op->type = OP_IMM; in decode_imm()
4575 op->bytes = size; in decode_imm()
4576 op->addr.mem.ea = ctxt->_eip; in decode_imm()
4578 switch (op->bytes) { in decode_imm()
4580 op->val = insn_fetch(s8, ctxt); in decode_imm()
4583 op->val = insn_fetch(s16, ctxt); in decode_imm()
4586 op->val = insn_fetch(s32, ctxt); in decode_imm()
4589 op->val = insn_fetch(s64, ctxt); in decode_imm()
4593 switch (op->bytes) { in decode_imm()
4595 op->val &= 0xff; in decode_imm()
4598 op->val &= 0xffff; in decode_imm()
4601 op->val &= 0xffffffff; in decode_imm()
4609 static int decode_operand(struct x86_emulate_ctxt *ctxt, struct operand *op, in decode_operand() argument
4616 decode_register_operand(ctxt, op); in decode_operand()
4619 rc = decode_imm(ctxt, op, 1, false); in decode_operand()
4624 *op = ctxt->memop; in decode_operand()
4625 ctxt->memopp = op; in decode_operand()
4628 op->orig_val = op->val; in decode_operand()
4634 op->type = OP_REG; in decode_operand()
4635 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; in decode_operand()
4636 op->addr.reg = reg_rmw(ctxt, VCPU_REGS_RAX); in decode_operand()
4637 fetch_register_operand(op); in decode_operand()
4638 op->orig_val = op->val; in decode_operand()
4641 op->type = OP_REG; in decode_operand()
4642 op->bytes = (ctxt->d & ByteOp) ? 2 : ctxt->op_bytes; in decode_operand()
4643 op->addr.reg = reg_rmw(ctxt, VCPU_REGS_RAX); in decode_operand()
4644 fetch_register_operand(op); in decode_operand()
4645 op->orig_val = op->val; in decode_operand()
4649 op->type = OP_NONE; in decode_operand()
4652 op->type = OP_REG; in decode_operand()
4653 op->bytes = ctxt->op_bytes; in decode_operand()
4654 op->addr.reg = reg_rmw(ctxt, VCPU_REGS_RDX); in decode_operand()
4655 fetch_register_operand(op); in decode_operand()
4656 op->orig_val = op->val; in decode_operand()
4659 op->type = OP_MEM; in decode_operand()
4660 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; in decode_operand()
4661 op->addr.mem.ea = in decode_operand()
4663 op->addr.mem.seg = VCPU_SREG_ES; in decode_operand()
4664 op->val = 0; in decode_operand()
4665 op->count = 1; in decode_operand()
4668 op->type = OP_REG; in decode_operand()
4669 op->bytes = 2; in decode_operand()
4670 op->addr.reg = reg_rmw(ctxt, VCPU_REGS_RDX); in decode_operand()
4671 fetch_register_operand(op); in decode_operand()
4674 op->type = OP_IMM; in decode_operand()
4675 op->bytes = 1; in decode_operand()
4676 op->val = reg_read(ctxt, VCPU_REGS_RCX) & 0xff; in decode_operand()
4679 rc = decode_imm(ctxt, op, 1, true); in decode_operand()
4682 op->type = OP_IMM; in decode_operand()
4683 op->bytes = 1; in decode_operand()
4684 op->val = 1; in decode_operand()
4687 rc = decode_imm(ctxt, op, imm_size(ctxt), true); in decode_operand()
4690 rc = decode_imm(ctxt, op, ctxt->op_bytes, true); in decode_operand()
4707 rc = decode_imm(ctxt, op, 2, false); in decode_operand()
4710 rc = decode_imm(ctxt, op, imm_size(ctxt), false); in decode_operand()
4713 op->type = OP_MEM; in decode_operand()
4714 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; in decode_operand()
4715 op->addr.mem.ea = in decode_operand()
4717 op->addr.mem.seg = ctxt->seg_override; in decode_operand()
4718 op->val = 0; in decode_operand()
4719 op->count = 1; in decode_operand()
4722 op->type = OP_MEM; in decode_operand()
4723 op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes; in decode_operand()
4724 op->addr.mem.ea = in decode_operand()
4728 op->addr.mem.seg = ctxt->seg_override; in decode_operand()
4729 op->val = 0; in decode_operand()
4732 op->type = OP_IMM; in decode_operand()
4733 op->addr.mem.ea = ctxt->_eip; in decode_operand()
4734 op->bytes = ctxt->op_bytes + 2; in decode_operand()
4735 insn_fetch_arr(op->valptr, op->bytes, ctxt); in decode_operand()
4741 op->type = OP_IMM; in decode_operand()
4742 op->val = VCPU_SREG_ES; in decode_operand()
4745 op->type = OP_IMM; in decode_operand()
4746 op->val = VCPU_SREG_CS; in decode_operand()
4749 op->type = OP_IMM; in decode_operand()
4750 op->val = VCPU_SREG_SS; in decode_operand()
4753 op->type = OP_IMM; in decode_operand()
4754 op->val = VCPU_SREG_DS; in decode_operand()
4757 op->type = OP_IMM; in decode_operand()
4758 op->val = VCPU_SREG_FS; in decode_operand()
4761 op->type = OP_IMM; in decode_operand()
4762 op->val = VCPU_SREG_GS; in decode_operand()
4767 op->type = OP_NONE; /* Disable writeback. */ in decode_operand()
4933 opcode = opcode.u.esc->op[(ctxt->modrm >> 3) & 7]; in x86_decode_insn()
5092 struct operand *op) in fetch_possible_mmx_operand() argument
5094 if (op->type == OP_MM) in fetch_possible_mmx_operand()
5095 read_mmx_reg(ctxt, &op->mm_val, op->addr.mm); in fetch_possible_mmx_operand()