aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorAvi Kivity <avi.kivity@gmail.com>2013-01-19 12:51:56 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2013-01-23 19:15:39 -0500
commit34b77652b9e98b5796b3a69df600e1717572e51d (patch)
tree377ce1799cf1bf2ec4df4fd730cac99120133632 /arch/x86/kvm/emulate.c
parent4d7583493e1777f42cc0fda9573d312e4753aa3c (diff)
KVM: x86 emulator: rearrange fastop definitions
Make fastop opcodes usable in other emulations. Reviewed-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi.kivity@gmail.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 45ddec8b7566..d06354d9a16a 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -972,6 +972,41 @@ static int read_descriptor(struct x86_emulate_ctxt *ctxt,
972 return rc; 972 return rc;
973} 973}
974 974
975FASTOP2(add);
976FASTOP2(or);
977FASTOP2(adc);
978FASTOP2(sbb);
979FASTOP2(and);
980FASTOP2(sub);
981FASTOP2(xor);
982FASTOP2(cmp);
983FASTOP2(test);
984
985FASTOP3WCL(shld);
986FASTOP3WCL(shrd);
987
988FASTOP2W(imul);
989
990FASTOP1(not);
991FASTOP1(neg);
992FASTOP1(inc);
993FASTOP1(dec);
994
995FASTOP2CL(rol);
996FASTOP2CL(ror);
997FASTOP2CL(rcl);
998FASTOP2CL(rcr);
999FASTOP2CL(shl);
1000FASTOP2CL(shr);
1001FASTOP2CL(sar);
1002
1003FASTOP2W(bsf);
1004FASTOP2W(bsr);
1005FASTOP2W(bt);
1006FASTOP2W(bts);
1007FASTOP2W(btr);
1008FASTOP2W(btc);
1009
975static u8 test_cc(unsigned int condition, unsigned long flags) 1010static u8 test_cc(unsigned int condition, unsigned long flags)
976{ 1011{
977 u8 rc; 1012 u8 rc;
@@ -2064,26 +2099,6 @@ static int em_jmp_far(struct x86_emulate_ctxt *ctxt)
2064 return X86EMUL_CONTINUE; 2099 return X86EMUL_CONTINUE;
2065} 2100}
2066 2101
2067FASTOP1(not);
2068FASTOP1(neg);
2069FASTOP1(inc);
2070FASTOP1(dec);
2071
2072FASTOP2CL(rol);
2073FASTOP2CL(ror);
2074FASTOP2CL(rcl);
2075FASTOP2CL(rcr);
2076FASTOP2CL(shl);
2077FASTOP2CL(shr);
2078FASTOP2CL(sar);
2079
2080FASTOP2W(bsf);
2081FASTOP2W(bsr);
2082FASTOP2W(bt);
2083FASTOP2W(bts);
2084FASTOP2W(btr);
2085FASTOP2W(btc);
2086
2087static int em_mul_ex(struct x86_emulate_ctxt *ctxt) 2102static int em_mul_ex(struct x86_emulate_ctxt *ctxt)
2088{ 2103{
2089 u8 ex = 0; 2104 u8 ex = 0;
@@ -3040,21 +3055,6 @@ static int em_ret_near_imm(struct x86_emulate_ctxt *ctxt)
3040 return X86EMUL_CONTINUE; 3055 return X86EMUL_CONTINUE;
3041} 3056}
3042 3057
3043FASTOP2(add);
3044FASTOP2(or);
3045FASTOP2(adc);
3046FASTOP2(sbb);
3047FASTOP2(and);
3048FASTOP2(sub);
3049FASTOP2(xor);
3050FASTOP2(cmp);
3051FASTOP2(test);
3052
3053FASTOP3WCL(shld);
3054FASTOP3WCL(shrd);
3055
3056FASTOP2W(imul);
3057
3058static int em_xchg(struct x86_emulate_ctxt *ctxt) 3058static int em_xchg(struct x86_emulate_ctxt *ctxt)
3059{ 3059{
3060 /* Write back the register source. */ 3060 /* Write back the register source. */