VirtualBox

Changeset 36821 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Apr 22, 2011 9:35:32 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71380
Message:

IEM: imul, fixes & optimization hack.

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r36815 r36821  
    4545*   Header Files                                                               *
    4646*******************************************************************************/
    47 #define RT_STRICT
    48 #define LOG_ENABLED
     47//#define RT_STRICT
     48//#define LOG_ENABLED
    4949#define LOG_GROUP   LOG_GROUP_EM /** @todo add log group */
    5050#include <VBox/vmm/iem.h>
     
    346346    iemAImpl_test_u32, NULL,
    347347    iemAImpl_test_u64, NULL
     348};
     349
     350/** Function table for the IMUL instruction. */
     351static const IEMOPBINSIZES g_iemAImpl_imul_two =
     352{
     353    NULL,  NULL,
     354    iemAImpl_imul_two_u16, NULL,
     355    iemAImpl_imul_two_u32, NULL,
     356    iemAImpl_imul_two_u64, NULL
    348357};
    349358
     
    554563static VBOXSTRICTRC iemInitDecoderAndPrefetchOpcodes(PIEMCPU pIemCpu)
    555564{
     565#ifdef IEM_VERIFICATION_MODE
     566    uint8_t const cbOldOpcodes = pIemCpu->cbOpcode;
     567#endif
    556568    iemInitDecode(pIemCpu);
    557569
     
    596608     *        TLB... */
    597609
     610#ifdef IEM_VERIFICATION_MODE
     611    /*
     612     * Optimistic optimization: Use unconsumed opcode bytes from the previous
     613     *                          instruction.
     614     */
     615    /** @todo optimize this differently by not using PGMPhysRead. */
     616    RTGCPHYS const offPrevOpcodes = GCPhys - pIemCpu->GCPhysOpcodes;
     617    pIemCpu->GCPhysOpcodes = GCPhys;
     618    if (offPrevOpcodes < cbOldOpcodes)
     619    {
     620        uint8_t cbNew = cbOldOpcodes - (uint8_t)offPrevOpcodes;
     621        memmove(&pIemCpu->abOpcode[0], &pIemCpu->abOpcode[offPrevOpcodes], cbNew);
     622        pIemCpu->cbOpcode = cbNew;
     623        return VINF_SUCCESS;
     624    }
     625#endif
     626
    598627    /*
    599628     * Read the bytes at this address.
     
    604633    if (cbToTryRead > sizeof(pIemCpu->abOpcode))
    605634        cbToTryRead = sizeof(pIemCpu->abOpcode);
     635    /** @todo patch manager */
    606636    if (!pIemCpu->fByPassHandlers)
    607637        rc = PGMPhysRead(IEMCPU_TO_VM(pIemCpu), GCPhys, pIemCpu->abOpcode, cbToTryRead);
     
    60006030                            case 6: u32EffAddr = pCtx->esi; break;
    60016031                            case 7: u32EffAddr = pCtx->edi; break;
     6032                            IEM_NOT_REACHED_DEFAULT_CASE_RET();
    60026033                        }
    60036034                        u32EffAddr <<= (bSib >> X86_SIB_SCALE_SHIFT) & X86_SIB_SCALE_SMASK;
     
    60266057                            case 6: u32EffAddr += pCtx->esi; break;
    60276058                            case 7: u32EffAddr += pCtx->edi; break;
     6059                            IEM_NOT_REACHED_DEFAULT_CASE_RET();
    60286060                        }
    60296061                        break;
     
    60326064                    case 6: u32EffAddr = pCtx->esi; break;
    60336065                    case 7: u32EffAddr = pCtx->edi; break;
     6066                    IEM_NOT_REACHED_DEFAULT_CASE_RET();
    60346067                }
    60356068
     
    62546287    pIemCpu->cIOWrites   = 0;
    62556288    pIemCpu->fMulDivHack = false;
    6256     pIemCpu->fShlHack    = false;
    6257 
     6289    pIemCpu->fShiftOfHack= false;
     6290
     6291# ifndef IEM_VERIFICATION_MODE_NO_REM
    62586292    /*
    62596293     * Free all verification records.
     
    62756309        pIemCpu->ppOtherEvtRecNext = &pIemCpu->pOtherEvtRecHead;
    62766310    } while (pEvtRec);
     6311# endif
    62776312}
    62786313
     
    66376672        if (pIemCpu->fMulDivHack)
    66386673            fFlagsMask &= ~(X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF);
    6639         if (pIemCpu->fShlHack)
     6674        if (pIemCpu->fShiftOfHack)
    66406675            fFlagsMask &= ~(X86_EFL_OF);
    66416676        if ((pOrgCtx->rflags.u & fFlagsMask) != (pDebugCtx->rflags.u & fFlagsMask))
     
    68446879#ifdef LOG_ENABLED
    68456880    PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
    6846     char     szInstr[256];
    6847     uint32_t cbInstr = 0;
    6848     DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0,
    6849                        DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
    6850                        szInstr, sizeof(szInstr), &cbInstr);
    6851 
    6852     Log2(("**** "
    6853           " eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\n"
    6854           " eip=%08x esp=%08x ebp=%08x iopl=%d\n"
    6855           " cs=%04x ss=%04x ds=%04x es=%04x fs=%04x gs=%04x efl=%08x\n"
    6856           " %s\n"
    6857           ,
    6858           pCtx->eax, pCtx->ebx, pCtx->ecx, pCtx->edx, pCtx->esi, pCtx->edi,
    6859           pCtx->eip, pCtx->esp, pCtx->ebp, pCtx->eflags.Bits.u2IOPL,
    6860           (RTSEL)pCtx->cs, (RTSEL)pCtx->ss, (RTSEL)pCtx->ds, (RTSEL)pCtx->es,
    6861           (RTSEL)pCtx->fs, (RTSEL)pCtx->gs, pCtx->eflags.u,
    6862           szInstr));
     6881    if (0)//LogIs2Enabled())
     6882    {
     6883        char     szInstr[256];
     6884        uint32_t cbInstr = 0;
     6885        DBGFR3DisasInstrEx(pVCpu->pVMR3, pVCpu->idCpu, 0, 0,
     6886                           DBGF_DISAS_FLAGS_CURRENT_GUEST | DBGF_DISAS_FLAGS_DEFAULT_MODE,
     6887                           szInstr, sizeof(szInstr), &cbInstr);
     6888
     6889        Log2(("**** "
     6890              " eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\n"
     6891              " eip=%08x esp=%08x ebp=%08x iopl=%d\n"
     6892              " cs=%04x ss=%04x ds=%04x es=%04x fs=%04x gs=%04x efl=%08x\n"
     6893              " %s\n"
     6894              ,
     6895              pCtx->eax, pCtx->ebx, pCtx->ecx, pCtx->edx, pCtx->esi, pCtx->edi,
     6896              pCtx->eip, pCtx->esp, pCtx->ebp, pCtx->eflags.Bits.u2IOPL,
     6897              (RTSEL)pCtx->cs, (RTSEL)pCtx->ss, (RTSEL)pCtx->ds, (RTSEL)pCtx->es,
     6898              (RTSEL)pCtx->fs, (RTSEL)pCtx->gs, pCtx->eflags.u,
     6899              szInstr));
     6900    }
    68636901#endif
    68646902
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h

    r36815 r36821  
    16781678/** Opcode 0x0f 0x9f. */
    16791679FNIEMOP_STUB(iemOp_setnle_Jv);
     1680
     1681
     1682/**
     1683 * Common 'push segment-register' helper.
     1684 */
     1685FNIEMOP_DEF_1(iemOpCommonPushSReg, uint8_t, iReg)
     1686{
     1687    IEMOP_HLP_NO_LOCK_PREFIX();
     1688    if (iReg < X86_SREG_FS)
     1689        IEMOP_HLP_NO_64BIT();
     1690    IEMOP_HLP_DEFAULT_64BIT_OP_SIZE();
     1691
     1692    switch (pIemCpu->enmEffOpSize)
     1693    {
     1694        case IEMMODE_16BIT:
     1695            IEM_MC_BEGIN(0, 1);
     1696            IEM_MC_LOCAL(uint16_t, u16Value);
     1697            IEM_MC_FETCH_SREG_U16(u16Value, iReg);
     1698            IEM_MC_PUSH_U16(u16Value);
     1699            IEM_MC_ADVANCE_RIP();
     1700            IEM_MC_END();
     1701            break;
     1702
     1703        case IEMMODE_32BIT:
     1704            IEM_MC_BEGIN(0, 1);
     1705            IEM_MC_LOCAL(uint32_t, u32Value);
     1706            IEM_MC_FETCH_SREG_ZX_U32(u32Value, iReg);
     1707            IEM_MC_PUSH_U32(u32Value);
     1708            IEM_MC_ADVANCE_RIP();
     1709            IEM_MC_END();
     1710            break;
     1711
     1712        case IEMMODE_64BIT:
     1713            IEM_MC_BEGIN(0, 1);
     1714            IEM_MC_LOCAL(uint64_t, u64Value);
     1715            IEM_MC_FETCH_SREG_ZX_U64(u64Value, iReg);
     1716            IEM_MC_PUSH_U64(u64Value);
     1717            IEM_MC_ADVANCE_RIP();
     1718            IEM_MC_END();
     1719            break;
     1720    }
     1721
     1722    return VINF_SUCCESS;
     1723}
     1724
     1725
    16801726/** Opcode 0x0f 0xa0. */
    1681 FNIEMOP_STUB(iemOp_push_fs);
     1727FNIEMOP_DEF(iemOp_push_fs)
     1728{
     1729    IEMOP_HLP_NO_LOCK_PREFIX();
     1730    return FNIEMOP_CALL_1(iemOpCommonPushSReg, X86_SREG_FS);
     1731}
     1732
     1733
    16821734/** Opcode 0x0f 0xa1. */
    1683 FNIEMOP_STUB(iemOp_pop_fs);
     1735FNIEMOP_DEF(iemOp_pop_fs)
     1736{
     1737    IEMOP_HLP_NO_LOCK_PREFIX();
     1738    return IEM_MC_DEFER_TO_CIMPL_2(iemOpCImpl_pop_Sreg, X86_SREG_FS, pIemCpu->enmEffOpSize);
     1739}
     1740
     1741
    16841742/** Opcode 0x0f 0xa2. */
    16851743FNIEMOP_STUB(iemOp_cpuid);
     
    16901748/** Opcode 0x0f 0xa7. */
    16911749FNIEMOP_STUB(iemOp_shld_Ev_Gv_CL);
     1750
     1751
    16921752/** Opcode 0x0f 0xa8. */
    1693 FNIEMOP_STUB(iemOp_push_gs);
     1753FNIEMOP_DEF(iemOp_push_gs)
     1754{
     1755    IEMOP_HLP_NO_LOCK_PREFIX();
     1756    return FNIEMOP_CALL_1(iemOpCommonPushSReg, X86_SREG_GS);
     1757}
     1758
     1759
    16941760/** Opcode 0x0f 0xa9. */
    1695 FNIEMOP_STUB(iemOp_pop_gs);
     1761FNIEMOP_DEF(iemOp_pop_gs)
     1762{
     1763    IEMOP_HLP_NO_LOCK_PREFIX();
     1764    return IEM_MC_DEFER_TO_CIMPL_2(iemOpCImpl_pop_Sreg, X86_SREG_GS, pIemCpu->enmEffOpSize);
     1765}
     1766
     1767
    16961768/** Opcode 0x0f 0xaa. */
    16971769FNIEMOP_STUB(iemOp_rsm);
     
    17041776/** Opcode 0x0f 0xae. */
    17051777FNIEMOP_STUB(iemOp_Grp15);
     1778
     1779
    17061780/** Opcode 0x0f 0xaf. */
    1707 FNIEMOP_STUB(iemOp_imul_Gv_Ev);
     1781FNIEMOP_DEF(iemOp_imul_Gv_Ev)
     1782{
     1783    IEMOP_MNEMONIC("imul Gv,Ev");
     1784#ifdef IEM_VERIFICATION_MODE
     1785    pIemCpu->fMulDivHack = true;
     1786#endif
     1787    return FNIEMOP_CALL_1(iemOpHlpBinaryOperator_rv_rm, &g_iemAImpl_imul_two);
     1788}
     1789
     1790
    17081791/** Opcode 0x0f 0xb0. */
    17091792FNIEMOP_STUB(iemOp_cmpxchg_Eb_Gb);
     
    22782361FNIEMOP_DEF(iemOp_add_Ev_Gv)
    22792362{
    2280     IEMOP_MNEMONIC("add Gv,Ev");
     2363    IEMOP_MNEMONIC("add Ev,Gv");
    22812364    return FNIEMOP_CALL_1(iemOpHlpBinaryOperator_rm_rv, &g_iemAImpl_add);
    22822365}
     
    23122395    IEMOP_MNEMONIC("add rAX,Iz");
    23132396    return FNIEMOP_CALL_1(iemOpHlpBinaryOperator_rAX_Iz, &g_iemAImpl_add);
    2314 }
    2315 
    2316 
    2317 /**
    2318  * Common 'push segment-register' helper.
    2319  */
    2320 FNIEMOP_DEF_1(iemOpCommonPushSReg, uint8_t, iReg)
    2321 {
    2322     IEMOP_HLP_NO_LOCK_PREFIX();
    2323     if (iReg < X86_SREG_FS)
    2324         IEMOP_HLP_NO_64BIT();
    2325     IEMOP_HLP_DEFAULT_64BIT_OP_SIZE();
    2326 
    2327     switch (pIemCpu->enmEffOpSize)
    2328     {
    2329         case IEMMODE_16BIT:
    2330             IEM_MC_BEGIN(0, 1);
    2331             IEM_MC_LOCAL(uint16_t, u16Value);
    2332             IEM_MC_FETCH_SREG_U16(u16Value, iReg);
    2333             IEM_MC_PUSH_U16(u16Value);
    2334             IEM_MC_ADVANCE_RIP();
    2335             IEM_MC_END();
    2336             break;
    2337 
    2338         case IEMMODE_32BIT:
    2339             IEM_MC_BEGIN(0, 1);
    2340             IEM_MC_LOCAL(uint32_t, u32Value);
    2341             IEM_MC_FETCH_SREG_ZX_U32(u32Value, iReg);
    2342             IEM_MC_PUSH_U32(u32Value);
    2343             IEM_MC_ADVANCE_RIP();
    2344             IEM_MC_END();
    2345             break;
    2346 
    2347         case IEMMODE_64BIT:
    2348             IEM_MC_BEGIN(0, 1);
    2349             IEM_MC_LOCAL(uint64_t, u64Value);
    2350             IEM_MC_FETCH_SREG_ZX_U64(u64Value, iReg);
    2351             IEM_MC_PUSH_U64(u64Value);
    2352             IEM_MC_ADVANCE_RIP();
    2353             IEM_MC_END();
    2354             break;
    2355     }
    2356 
    2357     return VINF_SUCCESS;
    23582397}
    23592398
     
    64126451        IEM_MC_REF_GREG_U8(pu8Dst, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB);
    64136452        IEM_MC_REF_EFLAGS(pEFlags);
     6453#ifdef IEM_VERIFICATION_MODE
     6454        if (cShift > 1) pIemCpu->fShiftOfHack = true;
     6455#endif
    64146456        IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU8, pu8Dst, cShiftArg, pEFlags);
    64156457        IEM_MC_ADVANCE_RIP();
     
    64316473        IEM_MC_MEM_MAP(pu8Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
    64326474        IEM_MC_FETCH_EFLAGS(EFlags);
     6475#ifdef IEM_VERIFICATION_MODE
     6476        if (cShift > 1) pIemCpu->fShiftOfHack = true;
     6477#endif
    64336478        IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU8, pu8Dst, cShiftArg, pEFlags);
    64346479
     
    64536498        case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC("rcl Ev,Ib"); break;
    64546499        case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC("rcr Ev,Ib"); break;
    6455         case 4:
    6456             pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC("shl Ev,Ib");
    6457 #ifdef IEM_VERIFICATION_MODE
    6458             pIemCpu->fShlHack = true;
    6459 #endif
    6460             break;
     6500        case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC("shl Ev,Ib"); break;
    64616501        case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC("shr Ev,Ib"); break;
    64626502        case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC("sar Ev,Ib"); break;
     
    64696509        /* register */
    64706510        uint8_t cShift; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &cShift);
     6511#ifdef IEM_VERIFICATION_MODE
     6512        if (cShift > 1) pIemCpu->fShiftOfHack = true;
     6513#endif
    64716514        IEMOP_HLP_NO_LOCK_PREFIX();
    64726515        switch (pIemCpu->enmEffOpSize)
     
    65266569                IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm);
    65276570                uint8_t cShift; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &cShift);
     6571#ifdef IEM_VERIFICATION_MODE
     6572                if (cShift > 1) pIemCpu->fShiftOfHack = true;
     6573#endif
    65286574                IEM_MC_ASSIGN(cShiftArg, cShift);
    65296575                IEM_MC_MEM_MAP(pu16Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
     
    65466592                IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm);
    65476593                uint8_t cShift; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &cShift);
     6594#ifdef IEM_VERIFICATION_MODE
     6595                if (cShift > 1) pIemCpu->fShiftOfHack = true;
     6596#endif
    65486597                IEM_MC_ASSIGN(cShiftArg, cShift);
    65496598                IEM_MC_MEM_MAP(pu32Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
     
    65666615                IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm);
    65676616                uint8_t cShift; IEM_OPCODE_GET_NEXT_BYTE(pIemCpu, &cShift);
     6617#ifdef IEM_VERIFICATION_MODE
     6618                if (cShift > 1) pIemCpu->fShiftOfHack = true;
     6619#endif
    65686620                IEM_MC_ASSIGN(cShiftArg, cShift);
    65696621                IEM_MC_MEM_MAP(pu64Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
     
    65766628                IEM_MC_END();
    65776629                return VINF_SUCCESS;
    6578 
    65796630
    65806631            IEM_NOT_REACHED_DEFAULT_CASE_RET();
     
    68696920        case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC("rcl Ev,1"); break;
    68706921        case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC("rcr Ev,1"); break;
    6871         case 4:
    6872             pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC("shl Ev,1");
    6873 #ifdef IEM_VERIFICATION_MODE
    6874             pIemCpu->fShlHack = true;
    6875 #endif
    6876             break;
     6922        case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC("shl Ev,1"); break;
    68776923        case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC("shr Ev,1"); break;
    68786924        case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC("sar Ev,1"); break;
     
    70217067        IEM_MC_FETCH_GREG_U8(cShiftArg, X86_GREG_xCX);
    70227068        IEM_MC_REF_EFLAGS(pEFlags);
     7069#ifdef IEM_VERIFICATION_MODE
     7070        if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7071#endif
    70237072        IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU8, pu8Dst, cShiftArg, pEFlags);
    70247073        IEM_MC_ADVANCE_RIP();
     
    70397088        IEM_MC_MEM_MAP(pu8Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
    70407089        IEM_MC_FETCH_EFLAGS(EFlags);
     7090#ifdef IEM_VERIFICATION_MODE
     7091        if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7092#endif
    70417093        IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU8, pu8Dst, cShiftArg, pEFlags);
    70427094
     
    70617113        case 2: pImpl = &g_iemAImpl_rcl; IEMOP_MNEMONIC("rcl Ev,CL"); break;
    70627114        case 3: pImpl = &g_iemAImpl_rcr; IEMOP_MNEMONIC("rcr Ev,CL"); break;
    7063         case 4:
    7064             pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC("shl Ev,CL");
    7065 #ifdef IEM_VERIFICATION_MODE
    7066             pIemCpu->fShlHack = true;
    7067 #endif
    7068             break;
     7115        case 4: pImpl = &g_iemAImpl_shl; IEMOP_MNEMONIC("shl Ev,CL"); break;
    70697116        case 5: pImpl = &g_iemAImpl_shr; IEMOP_MNEMONIC("shr Ev,CL"); break;
    70707117        case 7: pImpl = &g_iemAImpl_sar; IEMOP_MNEMONIC("sar Ev,CL"); break;
     
    70877134                IEM_MC_FETCH_GREG_U8(cShiftArg, X86_GREG_xCX);
    70887135                IEM_MC_REF_EFLAGS(pEFlags);
     7136#ifdef IEM_VERIFICATION_MODE
     7137                if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7138#endif
    70897139                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU16, pu16Dst, cShiftArg, pEFlags);
    70907140                IEM_MC_ADVANCE_RIP();
     
    71007150                IEM_MC_FETCH_GREG_U8(cShiftArg, X86_GREG_xCX);
    71017151                IEM_MC_REF_EFLAGS(pEFlags);
     7152#ifdef IEM_VERIFICATION_MODE
     7153                if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7154#endif
    71027155                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU32, pu32Dst, cShiftArg, pEFlags);
    71037156                IEM_MC_ADVANCE_RIP();
     
    71137166                IEM_MC_FETCH_GREG_U8(cShiftArg, X86_GREG_xCX);
    71147167                IEM_MC_REF_EFLAGS(pEFlags);
     7168#ifdef IEM_VERIFICATION_MODE
     7169                if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7170#endif
    71157171                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU64, pu64Dst, cShiftArg, pEFlags);
    71167172                IEM_MC_ADVANCE_RIP();
     
    71387194                IEM_MC_MEM_MAP(pu16Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
    71397195                IEM_MC_FETCH_EFLAGS(EFlags);
     7196#ifdef IEM_VERIFICATION_MODE
     7197                if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7198#endif
    71407199                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU16, pu16Dst, cShiftArg, pEFlags);
    71417200
     
    71577216                IEM_MC_MEM_MAP(pu32Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
    71587217                IEM_MC_FETCH_EFLAGS(EFlags);
     7218#ifdef IEM_VERIFICATION_MODE
     7219                if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7220#endif
    71597221                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU32, pu32Dst, cShiftArg, pEFlags);
    71607222
     
    71767238                IEM_MC_MEM_MAP(pu64Dst, IEM_ACCESS_DATA_RW, pIemCpu->iEffSeg, GCPtrEffDst, 0 /*arg*/);
    71777239                IEM_MC_FETCH_EFLAGS(EFlags);
     7240#ifdef IEM_VERIFICATION_MODE
     7241                if (cShiftArg > 1) pIemCpu->fShiftOfHack = true;
     7242#endif
    71787243                IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU64, pu64Dst, cShiftArg, pEFlags);
    71797244
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r36815 r36821  
    167167    /** Hack for ignoring differences in undefined EFLAGS after MUL and DIV. */
    168168    bool                    fMulDivHack;
    169     /** Hack for ignoring differences in OF after SHL.  At least two intel CPUs
    170      * this code is running on will not set it correctly (i.e. like AMD and QEMU
    171      * does). */
    172     bool                    fShlHack;
     169    /** Hack for ignoring differences in OF after shifts greater than 1 bit.
     170     * At least two intel CPUs this code is running on will set it different
     171     * than what AMD and REM does. */
     172    bool                    fShiftOfHack;
    173173    bool                    afAlignment1[6];
     174    /** The physical address corresponding to abOpcodes[0]. */
     175    RTGCPHYS                GCPhysOpcodes;
    174176#endif
    175177    /** @}  */
     
    199201    uint8_t                 iEffSeg;
    200202
    201     /** The current offset into abOpcode. */
     203    /** The current offset into abOpcodes. */
    202204    uint8_t                 offOpcode;
    203     /** The size of what has currently been fetched into abOpcode. */
     205    /** The size of what has currently been fetched into abOpcodes. */
    204206    uint8_t                 cbOpcode;
    205207    /** The opcode bytes. */
     
    453455/** @name Signed multiplication operations (thrown in with the binary ops).
    454456 * @{ */
    455 FNIEMAIMPLBINU8  iemAImpl_imul_two_u8;
    456457FNIEMAIMPLBINU16 iemAImpl_imul_two_u16;
    457458FNIEMAIMPLBINU32 iemAImpl_imul_two_u32;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette