Changeset 49671 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Nov 26, 2013 6:09:07 PM (11 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r49482 r49671 5134 5134 * Implements 'AAD'. 5135 5135 * 5136 * @param enmEffOpSize The effective operand size.5136 * @param bImm The immediate operand. 5137 5137 */ 5138 5138 IEM_CIMPL_DEF_1(iemCImpl_aad, uint8_t, bImm) … … 5170 5170 X86_EFL_OF | X86_EFL_AF | X86_EFL_CF); 5171 5171 5172 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 5173 return VINF_SUCCESS; 5174 } 5175 5176 5177 /** 5178 * Implements 'DAA'. 5179 */ 5180 IEM_CIMPL_DEF_0(iemCImpl_daa) 5181 { 5182 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 5183 5184 uint8_t const al = pCtx->al; 5185 bool const fCarry = pCtx->eflags.Bits.u1CF; 5186 5187 if ( pCtx->eflags.Bits.u1AF 5188 || (al & 0xf) >= 10) 5189 { 5190 pCtx->al = al + 6; 5191 pCtx->eflags.Bits.u1AF = 1; 5192 } 5193 else 5194 pCtx->eflags.Bits.u1AF = 0; 5195 5196 if (al >= 0x9a || fCarry) 5197 { 5198 pCtx->al += 0x60; 5199 pCtx->eflags.Bits.u1CF = 1; 5200 } 5201 else 5202 pCtx->eflags.Bits.u1CF = 0; 5203 5204 iemHlpUpdateArithEFlagsU8(pIemCpu, pCtx->al, X86_EFL_SF | X86_EFL_ZF | X86_EFL_PF, X86_EFL_OF); 5205 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 5206 return VINF_SUCCESS; 5207 } 5208 5209 5210 /** 5211 * Implements 'DAS'. 5212 */ 5213 IEM_CIMPL_DEF_0(iemCImpl_das) 5214 { 5215 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 5216 5217 uint8_t const uInputAL = pCtx->al; 5218 bool const fCarry = pCtx->eflags.Bits.u1CF; 5219 5220 if ( pCtx->eflags.Bits.u1AF 5221 || (uInputAL & 0xf) >= 10) 5222 { 5223 pCtx->eflags.Bits.u1AF = 1; 5224 if (uInputAL < 6) 5225 pCtx->eflags.Bits.u1CF = 1; 5226 pCtx->al = uInputAL - 6; 5227 } 5228 else 5229 { 5230 pCtx->eflags.Bits.u1AF = 0; 5231 pCtx->eflags.Bits.u1CF = 0; 5232 } 5233 5234 if (uInputAL >= 0x9a || fCarry) 5235 { 5236 pCtx->al -= 0x60; 5237 pCtx->eflags.Bits.u1CF = 1; 5238 } 5239 5240 iemHlpUpdateArithEFlagsU8(pIemCpu, pCtx->al, X86_EFL_SF | X86_EFL_ZF | X86_EFL_PF, X86_EFL_OF); 5172 5241 iemRegAddToRipAndClearRF(pIemCpu, cbInstr); 5173 5242 return VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r49482 r49671 786 786 IEMOP_HLP_64BIT_OP_SIZE(); 787 787 IEM_MC_BEGIN(3, 1); 788 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/pIemCpu->iEffSeg,0);788 IEM_MC_ARG(uint8_t, iEffSeg, 0); 789 789 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 1); 790 790 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSizeArg,/*=*/pIemCpu->enmEffOpSize, 2); 791 791 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 792 792 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 793 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 793 794 IEM_MC_CALL_CIMPL_3(iemCImpl_sgdt, iEffSeg, GCPtrEffSrc, enmEffOpSizeArg); 794 795 IEM_MC_END(); … … 835 836 IEMOP_HLP_64BIT_OP_SIZE(); 836 837 IEM_MC_BEGIN(3, 1); 837 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/pIemCpu->iEffSeg,0);838 IEM_MC_ARG(uint8_t, iEffSeg, 0); 838 839 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 1); 839 840 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSizeArg,/*=*/pIemCpu->enmEffOpSize, 2); 840 841 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 841 842 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 843 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 842 844 IEM_MC_CALL_CIMPL_3(iemCImpl_sidt, iEffSeg, GCPtrEffSrc, enmEffOpSizeArg); 843 845 IEM_MC_END(); … … 868 870 { 869 871 IEMOP_MNEMONIC("lgdt"); 870 IEMOP_HLP_NO_LOCK_PREFIX();871 872 872 IEMOP_HLP_64BIT_OP_SIZE(); 873 873 IEM_MC_BEGIN(3, 1); 874 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/pIemCpu->iEffSeg,0);874 IEM_MC_ARG(uint8_t, iEffSeg, 0); 875 875 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 1); 876 876 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSizeArg,/*=*/pIemCpu->enmEffOpSize, 2); 877 877 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 878 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 879 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 878 880 IEM_MC_CALL_CIMPL_3(iemCImpl_lgdt, iEffSeg, GCPtrEffSrc, enmEffOpSizeArg); 879 881 IEM_MC_END(); … … 901 903 FNIEMOP_DEF_1(iemOp_Grp7_lidt, uint8_t, bRm) 902 904 { 903 IEMOP_HLP_NO_LOCK_PREFIX();904 905 905 IEMMODE enmEffOpSize = pIemCpu->enmCpuMode == IEMMODE_64BIT 906 906 ? IEMMODE_64BIT 907 907 : pIemCpu->enmEffOpSize; 908 908 IEM_MC_BEGIN(3, 1); 909 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/pIemCpu->iEffSeg,0);909 IEM_MC_ARG(uint8_t, iEffSeg, 0); 910 910 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 1); 911 911 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSizeArg,/*=*/enmEffOpSize, 2); 912 912 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 913 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 914 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 913 915 IEM_MC_CALL_CIMPL_3(iemCImpl_lidt, iEffSeg, GCPtrEffSrc, enmEffOpSizeArg); 914 916 IEM_MC_END(); … … 4922 4924 { 4923 4925 IEMOP_MNEMONIC("fxsave m512"); 4924 IEMOP_HLP_NO_LOCK_PREFIX();4925 4926 if (!IEM_IS_INTEL_CPUID_FEATURE_PRESENT_EDX(X86_CPUID_FEATURE_EDX_FXSR)) 4926 4927 return IEMOP_RAISE_INVALID_OPCODE(); 4927 4928 4928 4929 IEM_MC_BEGIN(3, 1); 4929 IEM_MC_ARG _CONST(uint8_t, iEffSeg,/*=*/pIemCpu->iEffSeg,0);4930 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4930 4931 IEM_MC_ARG(RTGCPTR, GCPtrEff, 1); 4931 4932 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pIemCpu->enmEffOpSize, 2); 4932 4933 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 4934 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 4935 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 4933 4936 IEM_MC_CALL_CIMPL_3(iemCImpl_fxsave, iEffSeg, GCPtrEff, enmEffOpSize); 4934 4937 IEM_MC_END(); … … 4941 4944 { 4942 4945 IEMOP_MNEMONIC("fxrstor m512"); 4943 IEMOP_HLP_NO_LOCK_PREFIX();4944 4946 if (!IEM_IS_INTEL_CPUID_FEATURE_PRESENT_EDX(X86_CPUID_FEATURE_EDX_FXSR)) 4945 4947 return IEMOP_RAISE_INVALID_OPCODE(); 4946 4948 4947 4949 IEM_MC_BEGIN(3, 1); 4948 IEM_MC_ARG _CONST(uint8_t, iEffSeg,/*=*/pIemCpu->iEffSeg,0);4950 IEM_MC_ARG(uint8_t, iEffSeg, 0); 4949 4951 IEM_MC_ARG(RTGCPTR, GCPtrEff, 1); 4950 4952 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize,/*=*/pIemCpu->enmEffOpSize, 2); 4951 4953 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEff, bRm, 0); 4954 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 4955 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 4952 4956 IEM_MC_CALL_CIMPL_3(iemCImpl_fxrstor, iEffSeg, GCPtrEff, enmEffOpSize); 4953 4957 IEM_MC_END(); … … 7188 7192 7189 7193 /** Opcode 0x27. */ 7190 FNIEMOP_STUB(iemOp_daa); 7194 FNIEMOP_DEF(iemOp_daa) 7195 { 7196 IEMOP_MNEMONIC("daa AL"); 7197 IEMOP_HLP_NO_64BIT(); 7198 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 7199 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF); 7200 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_daa); 7201 } 7191 7202 7192 7203 … … 7252 7263 7253 7264 /** Opcode 0x2f. */ 7254 FNIEMOP_STUB(iemOp_das); 7265 FNIEMOP_DEF(iemOp_das) 7266 { 7267 IEMOP_MNEMONIC("das AL"); 7268 IEMOP_HLP_NO_64BIT(); 7269 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 7270 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF); 7271 return IEM_MC_DEFER_TO_CIMPL_0(iemCImpl_das); 7272 } 7255 7273 7256 7274 … … 13110 13128 IEM_MC_BEGIN(3, 0); 13111 13129 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); 13112 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/ pIemCpu->iEffSeg,1);13130 IEM_MC_ARG(uint8_t, iEffSeg, 1); 13113 13131 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 2); 13114 13132 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 13115 13133 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 13116 13134 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 13135 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 13117 13136 IEM_MC_CALL_CIMPL_3(iemCImpl_fldenv, enmEffOpSize, iEffSeg, GCPtrEffSrc); 13118 13137 IEM_MC_END(); … … 13144 13163 IEM_MC_BEGIN(3, 0); 13145 13164 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); 13146 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/ pIemCpu->iEffSeg,1);13165 IEM_MC_ARG(uint8_t, iEffSeg, 1); 13147 13166 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 2); 13148 13167 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 13149 13168 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 13150 13169 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 13170 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 13151 13171 IEM_MC_CALL_CIMPL_3(iemCImpl_fnstenv, enmEffOpSize, iEffSeg, GCPtrEffDst); 13152 13172 IEM_MC_END(); … … 15006 15026 FNIEMOP_DEF_1(iemOp_frstor, uint8_t, bRm) 15007 15027 { 15008 IEMOP_MNEMONIC("f xrstor m94/108byte");15028 IEMOP_MNEMONIC("frstor m94/108byte"); 15009 15029 IEM_MC_BEGIN(3, 0); 15010 15030 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); 15011 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/ pIemCpu->iEffSeg,1);15031 IEM_MC_ARG(uint8_t, iEffSeg, 1); 15012 15032 IEM_MC_ARG(RTGCPTR, GCPtrEffSrc, 2); 15013 15033 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 15014 15034 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 15015 15035 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 15036 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 15016 15037 IEM_MC_CALL_CIMPL_3(iemCImpl_frstor, enmEffOpSize, iEffSeg, GCPtrEffSrc); 15017 15038 IEM_MC_END(); … … 15026 15047 IEM_MC_BEGIN(3, 0); 15027 15048 IEM_MC_ARG_CONST(IEMMODE, enmEffOpSize, /*=*/ pIemCpu->enmEffOpSize, 0); 15028 IEM_MC_ARG _CONST(uint8_t, iEffSeg, /*=*/ pIemCpu->iEffSeg,1);15049 IEM_MC_ARG(uint8_t, iEffSeg, 1); 15029 15050 IEM_MC_ARG(RTGCPTR, GCPtrEffDst, 2); 15030 15051 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 15031 15052 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 15032 15053 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 15054 IEM_MC_ASSIGN(iEffSeg, pIemCpu->iEffSeg); 15033 15055 IEM_MC_CALL_CIMPL_3(iemCImpl_fnsave, enmEffOpSize, iEffSeg, GCPtrEffDst); 15034 15056 IEM_MC_END();
Note:
See TracChangeset
for help on using the changeset viewer.