Skip to content

Commit 45a1467

Browse files
avikivitymatosatti
authored andcommitted
KVM: x86 emulator: convert NOT, NEG to fastop
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 75f7284 commit 45a1467

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

‎arch/x86/kvm/emulate.c‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2050,17 +2050,8 @@ static int em_grp2(struct x86_emulate_ctxt *ctxt)
20502050
return X86EMUL_CONTINUE;
20512051
}
20522052

2053-
static int em_not(struct x86_emulate_ctxt *ctxt)
2054-
{
2055-
ctxt->dst.val = ~ctxt->dst.val;
2056-
return X86EMUL_CONTINUE;
2057-
}
2058-
2059-
static int em_neg(struct x86_emulate_ctxt *ctxt)
2060-
{
2061-
emulate_1op(ctxt, "neg");
2062-
return X86EMUL_CONTINUE;
2063-
}
2053+
FASTOP1(not);
2054+
FASTOP1(neg);
20642055

20652056
static int em_mul_ex(struct x86_emulate_ctxt *ctxt)
20662057
{
@@ -3753,8 +3744,8 @@ static const struct opcode group1A[] = {
37533744
static const struct opcode group3[] = {
37543745
I(DstMem | SrcImm | NoWrite, em_test),
37553746
I(DstMem | SrcImm | NoWrite, em_test),
3756-
I(DstMem | SrcNone | Lock, em_not),
3757-
I(DstMem | SrcNone | Lock, em_neg),
3747+
F(DstMem | SrcNone | Lock, em_not),
3748+
F(DstMem | SrcNone | Lock, em_neg),
37583749
I(SrcMem, em_mul_ex),
37593750
I(SrcMem, em_imul_ex),
37603751
I(SrcMem, em_div_ex),

0 commit comments

Comments
 (0)