Skip to content

Commit f7857f3

Browse files
avikivitymatosatti
authored andcommitted
KVM: x86 emulator: add macros for defining 2-operand fastop emulation
Acked-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi.kivity@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
1 parent 45a1467 commit f7857f3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎arch/x86/kvm/emulate.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,17 @@ static void invalidate_registers(struct x86_emulate_ctxt *ctxt)
465465
ON64(FOP1E(op##q, rax)) \
466466
FOP_END
467467

468+
#define FOP2E(op, dst, src) \
469+
FOP_ALIGN #op " %" #src ", %" #dst " \n\t" FOP_RET
470+
471+
#define FASTOP2(op) \
472+
FOP_START(op) \
473+
FOP2E(op##b, al, bl) \
474+
FOP2E(op##w, ax, bx) \
475+
FOP2E(op##l, eax, ebx) \
476+
ON64(FOP2E(op##q, rax, rbx)) \
477+
FOP_END
478+
468479
#define __emulate_1op_rax_rdx(ctxt, _op, _suffix, _ex) \
469480
do { \
470481
unsigned long _tmp; \
@@ -3696,6 +3707,7 @@ static int check_perm_out(struct x86_emulate_ctxt *ctxt)
36963707
#define D2bv(_f) D((_f) | ByteOp), D(_f)
36973708
#define D2bvIP(_f, _i, _p) DIP((_f) | ByteOp, _i, _p), DIP(_f, _i, _p)
36983709
#define I2bv(_f, _e) I((_f) | ByteOp, _e), I(_f, _e)
3710+
#define F2bv(_f, _e) F((_f) | ByteOp, _e), F(_f, _e)
36993711
#define I2bvIP(_f, _e, _i, _p) \
37003712
IIP((_f) | ByteOp, _e, _i, _p), IIP(_f, _e, _i, _p)
37013713

0 commit comments

Comments
 (0)