diff options
author | Avi Kivity <avi.kivity@gmail.com> | 2013-01-19 12:51:56 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-01-23 19:15:39 -0500 |
commit | 34b77652b9e98b5796b3a69df600e1717572e51d (patch) | |
tree | 377ce1799cf1bf2ec4df4fd730cac99120133632 /arch/x86/kvm/emulate.c | |
parent | 4d7583493e1777f42cc0fda9573d312e4753aa3c (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.c | 70 |
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 | ||
975 | FASTOP2(add); | ||
976 | FASTOP2(or); | ||
977 | FASTOP2(adc); | ||
978 | FASTOP2(sbb); | ||
979 | FASTOP2(and); | ||
980 | FASTOP2(sub); | ||
981 | FASTOP2(xor); | ||
982 | FASTOP2(cmp); | ||
983 | FASTOP2(test); | ||
984 | |||
985 | FASTOP3WCL(shld); | ||
986 | FASTOP3WCL(shrd); | ||
987 | |||
988 | FASTOP2W(imul); | ||
989 | |||
990 | FASTOP1(not); | ||
991 | FASTOP1(neg); | ||
992 | FASTOP1(inc); | ||
993 | FASTOP1(dec); | ||
994 | |||
995 | FASTOP2CL(rol); | ||
996 | FASTOP2CL(ror); | ||
997 | FASTOP2CL(rcl); | ||
998 | FASTOP2CL(rcr); | ||
999 | FASTOP2CL(shl); | ||
1000 | FASTOP2CL(shr); | ||
1001 | FASTOP2CL(sar); | ||
1002 | |||
1003 | FASTOP2W(bsf); | ||
1004 | FASTOP2W(bsr); | ||
1005 | FASTOP2W(bt); | ||
1006 | FASTOP2W(bts); | ||
1007 | FASTOP2W(btr); | ||
1008 | FASTOP2W(btc); | ||
1009 | |||
975 | static u8 test_cc(unsigned int condition, unsigned long flags) | 1010 | static 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 | ||
2067 | FASTOP1(not); | ||
2068 | FASTOP1(neg); | ||
2069 | FASTOP1(inc); | ||
2070 | FASTOP1(dec); | ||
2071 | |||
2072 | FASTOP2CL(rol); | ||
2073 | FASTOP2CL(ror); | ||
2074 | FASTOP2CL(rcl); | ||
2075 | FASTOP2CL(rcr); | ||
2076 | FASTOP2CL(shl); | ||
2077 | FASTOP2CL(shr); | ||
2078 | FASTOP2CL(sar); | ||
2079 | |||
2080 | FASTOP2W(bsf); | ||
2081 | FASTOP2W(bsr); | ||
2082 | FASTOP2W(bt); | ||
2083 | FASTOP2W(bts); | ||
2084 | FASTOP2W(btr); | ||
2085 | FASTOP2W(btc); | ||
2086 | |||
2087 | static int em_mul_ex(struct x86_emulate_ctxt *ctxt) | 2102 | static 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 | ||
3043 | FASTOP2(add); | ||
3044 | FASTOP2(or); | ||
3045 | FASTOP2(adc); | ||
3046 | FASTOP2(sbb); | ||
3047 | FASTOP2(and); | ||
3048 | FASTOP2(sub); | ||
3049 | FASTOP2(xor); | ||
3050 | FASTOP2(cmp); | ||
3051 | FASTOP2(test); | ||
3052 | |||
3053 | FASTOP3WCL(shld); | ||
3054 | FASTOP3WCL(shrd); | ||
3055 | |||
3056 | FASTOP2W(imul); | ||
3057 | |||
3058 | static int em_xchg(struct x86_emulate_ctxt *ctxt) | 3058 | static int em_xchg(struct x86_emulate_ctxt *ctxt) |
3059 | { | 3059 | { |
3060 | /* Write back the register source. */ | 3060 | /* Write back the register source. */ |