Changeset 37918 in vbox
- Timestamp:
- Jul 13, 2011 1:38:33 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72825
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r37090 r37918 5005 5005 #ifdef DEBUG 5006 5006 # define IEMOP_MNEMONIC(a_szMnemonic) \ 5007 Log2(("decode - %04x:%RGv %s%s \n", pIemCpu->CTX_SUFF(pCtx)->cs, pIemCpu->CTX_SUFF(pCtx)->rip, \5008 pIemCpu->fPrefixes & IEM_OP_PRF_LOCK ? "lock " : "", a_szMnemonic ))5007 Log2(("decode - %04x:%RGv %s%s [#%u]\n", pIemCpu->CTX_SUFF(pCtx)->cs, pIemCpu->CTX_SUFF(pCtx)->rip, \ 5008 pIemCpu->fPrefixes & IEM_OP_PRF_LOCK ? "lock " : "", a_szMnemonic, pIemCpu->cInstructions)) 5009 5009 # define IEMOP_MNEMONIC2(a_szMnemonic, a_szOps) \ 5010 Log2(("decode - %04x:%RGv %s%s %s \n", pIemCpu->CTX_SUFF(pCtx)->cs, pIemCpu->CTX_SUFF(pCtx)->rip, \5011 pIemCpu->fPrefixes & IEM_OP_PRF_LOCK ? "lock " : "", a_szMnemonic, a_szOps ))5010 Log2(("decode - %04x:%RGv %s%s %s [#%u]\n", pIemCpu->CTX_SUFF(pCtx)->cs, pIemCpu->CTX_SUFF(pCtx)->rip, \ 5011 pIemCpu->fPrefixes & IEM_OP_PRF_LOCK ? "lock " : "", a_szMnemonic, a_szOps, pIemCpu->cInstructions)) 5012 5012 #else 5013 5013 # define IEMOP_MNEMONIC(a_szMnemonic) do { } while (0) … … 5036 5036 do \ 5037 5037 { \ 5038 if (pIemCpu-> fPrefixes & IEM_OP_PRF_LOCK) \5038 if (pIemCpu->enmCpuMode == IEMMODE_64BIT) \ 5039 5039 return IEMOP_RAISE_INVALID_OPCODE(); \ 5040 5040 } while (0) … … 5823 5823 * Execute the instruction in REM. 5824 5824 */ 5825 int rc = REMR3EmulateInstruction(IEMCPU_TO_VM(pIemCpu), IEMCPU_TO_VMCPU(pIemCpu)); 5825 PVM pVM = IEMCPU_TO_VM(pIemCpu); 5826 EMRemLock(pVM); 5827 int rc = REMR3EmulateInstruction(pVM, IEMCPU_TO_VMCPU(pIemCpu)); 5826 5828 AssertRC(rc); 5829 EMRemUnlock(pVM); 5827 5830 5828 5831 /* -
trunk/src/VBox/VMM/VMMAll/IEMAllCImpl.cpp.h
r37079 r37918 44 44 return VINF_SUCCESS; 45 45 } 46 47 48 #if 0 49 /** 50 * Calculates the parity bit. 51 * 52 * @returns true if the bit is set, false if not. 53 * @param u8Result The least significant byte of the result. 54 */ 55 static bool iemHlpCalcParityFlag(uint8_t u8Result) 56 { 57 /* 58 * Parity is set if the number of bits in the least significant byte of 59 * the result is even. 60 */ 61 uint8_t cBits; 62 cBits = u8Result & 1; /* 0 */ 63 u8Result >>= 1; 64 cBits += u8Result & 1; 65 u8Result >>= 1; 66 cBits += u8Result & 1; 67 u8Result >>= 1; 68 cBits += u8Result & 1; 69 u8Result >>= 1; 70 cBits += u8Result & 1; /* 4 */ 71 u8Result >>= 1; 72 cBits += u8Result & 1; 73 u8Result >>= 1; 74 cBits += u8Result & 1; 75 u8Result >>= 1; 76 cBits += u8Result & 1; 77 return !(cBits & 1); 78 } 79 #endif /* not used */ 80 81 82 /** 83 * Updates the specified flags according to a 8-bit result. 84 * 85 * @param pIemCpu The. 86 * @param u8Result The result to set the flags according to. 87 * @param fToUpdate The flags to update. 88 * @param fUndefined The flags that are specified as undefined. 89 */ 90 static void iemHlpUpdateArithEFlagsU8(PIEMCPU pIemCpu, uint8_t u8Result, uint32_t fToUpdate, uint32_t fUndefined) 91 { 92 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 93 94 uint32_t fEFlags = pCtx->eflags.u; 95 iemAImpl_test_u8(&u8Result, u8Result, &fEFlags); 96 pCtx->eflags.u &= ~(fToUpdate | fUndefined); 97 pCtx->eflags.u |= (fToUpdate | fUndefined) & fEFlags; 98 } 99 46 100 47 101 /** @} */ … … 2878 2932 2879 2933 2934 /** 2935 * Implements 'AAD'. 2936 * 2937 * @param enmEffOpSize The effective operand size. 2938 */ 2939 IEM_CIMPL_DEF_1(iemCImpl_aad, uint8_t, bImm) 2940 { 2941 PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx); 2942 2943 uint16_t const ax = pCtx->ax; 2944 uint8_t const al = (uint8_t)ax + (uint8_t)(ax >> 8) * bImm; 2945 pCtx->ax = al; 2946 iemHlpUpdateArithEFlagsU8(pIemCpu, al, 2947 X86_EFL_SF | X86_EFL_SF | X86_EFL_PF, 2948 X86_EFL_OF | X86_EFL_AF | X86_EFL_CF); 2949 2950 iemRegAddToRip(pIemCpu, cbInstr); 2951 return VINF_SUCCESS; 2952 } 2953 2954 2955 2956 2880 2957 /* 2881 2958 * Instantiate the various string operation combinations. -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r37084 r37918 3274 3274 if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT)) 3275 3275 return IEMOP_RAISE_INVALID_OPCODE(); 3276 uint8_t const iGReg = ((bRm >> X86_MODRM_REG_SHIFT) & bRm &X86_MODRM_REG_SMASK) | pIemCpu->uRexReg;3276 uint8_t const iGReg = ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg; 3277 3277 3278 3278 switch (pIemCpu->enmEffOpSize) … … 9758 9758 /** Opcode 0xd4. */ 9759 9759 FNIEMOP_STUB(iemOp_aam_Ib); 9760 9761 9760 9762 /** Opcode 0xd5. */ 9761 FNIEMOP_STUB(iemOp_aad_Ib); 9763 FNIEMOP_DEF(iemOp_aad_Ib) 9764 { 9765 IEMOP_MNEMONIC("aad Ib"); 9766 uint8_t bImm; IEM_OPCODE_GET_NEXT_U8(&bImm); 9767 IEMOP_HLP_NO_LOCK_PREFIX(); 9768 IEMOP_HLP_NO_64BIT(); 9769 return IEM_MC_DEFER_TO_CIMPL_1(iemCImpl_aad, bImm); 9770 } 9762 9771 9763 9772
Note:
See TracChangeset
for help on using the changeset viewer.