VirtualBox

Changeset 105271 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Jul 11, 2024 10:30:56 AM (7 months ago)
Author:
vboxsync
Message:

VMM/IEM: Replaced IEMNATIVEEXITREASON with IEMNATIVELABELTYPE, since it's always been a super set of it. Some source code width adjustments. bugref:10677

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

Legend:

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

    r105261 r105271  
    254254                                   ~(VMCPU_FF_INTERRUPT_APIC | VMCPU_FF_INTERRUPT_PIC), true /*fSetFlags*/);
    255255    /* Return VINF_IEM_REEXEC_BREAK if other FFs are set. */
    256     off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_ReturnBreakFF);
     256    off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_ReturnBreakFF);
    257257
    258258    /* So, it's only interrupt releated FFs and we need to see if IRQs are being
     
    260260    off = iemNativeEmitTestBitInGprAndJmpToLabelIfNotSet(pReNative, off, idxEflReg, X86_EFL_IF_BIT, idxLabelVmCheck);
    261261    off = iemNativeEmitTestAnyBitsInGprAndTbExitIfNoneSet(pReNative, off, idxEflReg, CPUMCTX_INHIBIT_SHADOW,
    262                                                           kIemNativeExitReason_ReturnBreakFF);
     262                                                          kIemNativeLabelType_ReturnBreakFF);
    263263
    264264    /* We've got shadow flags set, so we must check that the PC they are valid
     
    268268    off = iemNativeEmitLoadGprFromVCpuU64(pReNative, off, idxTmpReg, RT_UOFFSETOF(VMCPUCC, cpum.GstCtx.uRipInhibitInt));
    269269    off = iemNativeEmitTestIfGprNotEqualGprAndTbExit(pReNative, off, idxTmpReg, idxPcReg,
    270                                                      kIemNativeExitReason_ReturnBreakFF);
     270                                                     kIemNativeLabelType_ReturnBreakFF);
    271271
    272272    /*
     
    278278    off = iemNativeEmitLoadGprByGprU32(pReNative, off, idxTmpReg, idxTmpReg, RT_UOFFSETOF(VMCC, fGlobalForcedActions));
    279279    off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxTmpReg, VM_FF_ALL_MASK, true /*fSetFlags*/);
    280     off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_ReturnBreakFF);
     280    off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_ReturnBreakFF);
    281281
    282282    /** @todo STAM_REL_COUNTER_INC(&pVCpu->iem.s.StatCheckIrqBreaks); */
     
    321321    off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxTmpReg, IEMTB_F_KEY_MASK);
    322322    off = iemNativeEmitTestIfGpr32NotEqualImmAndTbExit(pReNative, off, idxTmpReg, fExpectedExec & IEMTB_F_KEY_MASK,
    323                                                        kIemNativeExitReason_ReturnBreak);
     323                                                       kIemNativeLabelType_ReturnBreak);
    324324    iemNativeRegFreeTmp(pReNative, idxTmpReg);
    325325
     
    450450
    451451    /* 3. Jump if greater. */
    452     off = iemNativeEmitJaTbExit(pReNative, off, kIemNativeExitReason_RaiseGp0);
     452    off = iemNativeEmitJaTbExit(pReNative, off, kIemNativeLabelType_RaiseGp0);
    453453
    454454    iemNativeRegFreeTmp(pReNative, idxRegCsLim);
     
    538538    /* Compare the two and jump out if we're too close to the limit. */
    539539    off = iemNativeEmitCmpGprWithGpr(pReNative, off, idxRegLeft, idxRegRight);
    540     off = iemNativeEmitJlTbExit(pReNative, off, kIemNativeExitReason_NeedCsLimChecking);
     540    off = iemNativeEmitJlTbExit(pReNative, off, kIemNativeLabelType_NeedCsLimChecking);
    541541
    542542    iemNativeRegFreeTmp(pReNative, idxRegRight);
     
    618618                offConsolidatedJump = off; \
    619619                if (BP_ON_OBSOLETION) pbCodeBuf[off++] = 0xcc; \
    620                 off = iemNativeEmitTbExitEx(pReNative, pbCodeBuf, off, kIemNativeExitReason_ObsoleteTb); \
     620                off = iemNativeEmitTbExitEx(pReNative, pbCodeBuf, off, kIemNativeLabelType_ObsoleteTb); \
    621621            } \
    622622        } while (0)
     
    862862                if (fPendingJmp)
    863863                {
    864                     off = iemNativeEmitJccTbExitEx(pReNative, pu32CodeBuf, off, kIemNativeExitReason_ObsoleteTb,
     864                    off = iemNativeEmitJccTbExitEx(pReNative, pu32CodeBuf, off, kIemNativeLabelType_ObsoleteTb,
    865865                                                   kArmv8InstrCond_Ne);
    866866                    fPendingJmp = false;
     
    899899                                                            ARMA64_NZCV_F_N0_Z0_C0_V0, kArmv8InstrCond_Eq);
    900900
    901                 off = iemNativeEmitJccTbExitEx(pReNative, pu32CodeBuf, off, kIemNativeExitReason_ObsoleteTb,
     901                off = iemNativeEmitJccTbExitEx(pReNative, pu32CodeBuf, off, kIemNativeLabelType_ObsoleteTb,
    902902                                               kArmv8InstrCond_Ne);
    903903
     
    10331033     */
    10341034    if (fPendingJmp)
    1035         off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_ObsoleteTb);
     1035        off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_ObsoleteTb);
    10361036
    10371037    RT_NOREF(pu32CodeBuf, cbLeft, offPage, pbOpcodes, offConsolidatedJump);
     
    11941194    /* 3. Check that off is less than X86_PAGE_SIZE/cbInstrBufTotal. */
    11951195    off = iemNativeEmitCmpGprWithImm(pReNative, off, idxRegTmp, X86_PAGE_SIZE - 1);
    1196     off = iemNativeEmitJaTbExit(pReNative, off, kIemNativeExitReason_CheckBranchMiss);
     1196    off = iemNativeEmitJaTbExit(pReNative, off, kIemNativeLabelType_CheckBranchMiss);
    11971197
    11981198    /* 4. Add iem.s.GCPhysInstrBuf and compare with GCPhysRangePageWithOffset. */
     
    12261226                                             + offRange;
    12271227    off = iemNativeEmitTestIfGprNotEqualImmAndTbExit(pReNative, off, idxRegTmp, GCPhysRangePageWithOffset,
    1228                                                      kIemNativeExitReason_CheckBranchMiss);
     1228                                                     kIemNativeLabelType_CheckBranchMiss);
    12291229
    12301230    iemNativeRegFreeTmp(pReNative, idxRegTmp);
     
    13361336    RTGCPHYS const GCPhysNewPage = iemTbGetRangePhysPageAddr(pTb, idxRange);
    13371337    off = iemNativeEmitTestIfGprNotEqualImmAndTbExit(pReNative, off, idxRegGCPhys, GCPhysNewPage,
    1338                                                      kIemNativeExitReason_ObsoleteTb);
     1338                                                     kIemNativeLabelType_ObsoleteTb);
    13391339
    13401340    iemNativeRegFreeTmp(pReNative, idxRegGCPhys);
     
    15471547    off = iemNativeEmitLoadGprImm64(pReNative, off, idxRegTmp2, GCPhysRangePageWithOffset);
    15481548    off = iemNativeEmitCmpGprWithGpr(pReNative, off, idxRegTmp, idxRegTmp2);
    1549     off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_CheckBranchMiss);
     1549    off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_CheckBranchMiss);
    15501550    uint32_t const offFixedJumpToEnd = off;
    15511551    off = iemNativeEmitJmpToFixed(pReNative, off, off + 512 /* force rel32 */);
     
    15601560    /* Check that we haven't been here before. */
    15611561    off = iemNativeEmitTestIfGprIsNotZeroAndTbExit(pReNative, off, idxRegTmp2,  false /*f64Bit*/,
    1562                                                    kIemNativeExitReason_CheckBranchMiss);
     1562                                                   kIemNativeLabelType_CheckBranchMiss);
    15631563
    15641564    /* Jump to the TLB lookup code. */
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h

    r105251 r105271  
    247247    pReNative->fMc    = 0; \
    248248    pReNative->fCImpl = (a_fFlags); \
    249     return iemNativeEmitCImplCall0(pReNative, off, pCallEntry->idxInstr, a_fGstShwFlush, (uintptr_t)a_pfnCImpl, a_cbInstr) /** @todo not used ... */
     249    return iemNativeEmitCImplCall0(pReNative, off, pCallEntry->idxInstr, a_fGstShwFlush, (uintptr_t)a_pfnCImpl, \
     250                                   a_cbInstr) /** @todo not used ... */
    250251
    251252
     
    319320#ifdef IEMNATIVE_WITH_LIVENESS_ANALYSIS
    320321    AssertMsg(   pReNative->idxCurCall == 0
    321               || IEMLIVENESS_STATE_IS_INPUT_EXPECTED(iemNativeLivenessGetStateByGstRegEx(&pReNative->paLivenessEntries[pReNative->idxCurCall - 1], IEMLIVENESSBIT_IDX_EFL_OTHER)),
    322               ("Efl_Other - %u\n", iemNativeLivenessGetStateByGstRegEx(&pReNative->paLivenessEntries[pReNative->idxCurCall - 1], IEMLIVENESSBIT_IDX_EFL_OTHER)));
     322              || IEMLIVENESS_STATE_IS_INPUT_EXPECTED(iemNativeLivenessGetStateByGstRegEx(&pReNative->paLivenessEntries[pReNative->idxCurCall - 1],
     323                                                                                         IEMLIVENESSBIT_IDX_EFL_OTHER)),
     324              ("Efl_Other - %u\n", iemNativeLivenessGetStateByGstRegEx(&pReNative->paLivenessEntries[pReNative->idxCurCall - 1],
     325                                                                       IEMLIVENESSBIT_IDX_EFL_OTHER)));
    323326#endif
    324327
     
    334337    off = iemNativeEmitTestAnyBitsInGprAndTbExitIfAnySet(pReNative, off, idxEflReg,
    335338                                                         X86_EFL_TF | CPUMCTX_DBG_HIT_DRX_MASK | CPUMCTX_DBG_DBGF_MASK,
    336                                                          kIemNativeExitReason_ReturnWithFlags);
     339                                                         kIemNativeLabelType_ReturnWithFlags);
    337340    off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxEflReg, ~(uint32_t)(X86_EFL_RF | CPUMCTX_INHIBIT_SHADOW));
    338341    off = iemNativeEmitStoreGprToVCpuU32(pReNative, off, idxEflReg, RT_UOFFSETOF(VMCPU, cpum.GstCtx.eflags));
     
    394397                                             RT_UOFFSETOF(VMCPU, iem.s.ppTbLookupEntryR3));
    395398
    396         return iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_ReturnBreak);
     399        return iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnBreak);
    397400
    398401#else
     
    440443
    441444                if (pReNative->idxLastCheckIrqCallNo != UINT32_MAX)
    442                     return iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_ReturnBreakViaLookup);
    443                 return iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_ReturnBreakViaLookupWithIrq);
     445                    return iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnBreakViaLookup);
     446                return iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnBreakViaLookupWithIrq);
    444447            }
    445448        }
    446449        if (pReNative->idxLastCheckIrqCallNo != UINT32_MAX)
    447             return iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_ReturnBreakViaLookupWithTlb);
    448         return iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_ReturnBreakViaLookupWithTlbAndIrq);
     450            return iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnBreakViaLookupWithTlb);
     451        return iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnBreakViaLookupWithTlbAndIrq);
    449452#endif
    450453    }
     
    15941597
    15951598/*********************************************************************************************************************************
    1596 *   Emitters for changing PC/RIP/EIP/IP with a RETN (Iw) instruction (IEM_MC_RETN_AND_FINISH) (requires stack emmiters).    *
     1599*   Emitters for changing PC/RIP/EIP/IP with a RETN (Iw) instruction (IEM_MC_RETN_AND_FINISH) (requires stack emmiters).         *
    15971600*********************************************************************************************************************************/
    15981601
     
    17191722                                        : (uintptr_t)iemNativeHlpStackFetchU16;
    17201723    uint8_t   const idxRegRsp       = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(X86_GREG_xSP),
    1721                                                                       fFlat ? kIemNativeGstRegUse_ForUpdate : kIemNativeGstRegUse_Calculation,
     1724                                                                      fFlat ? kIemNativeGstRegUse_ForUpdate
     1725                                                                            : kIemNativeGstRegUse_Calculation,
    17221726                                                                      true /*fNoVolatileRegs*/);
    17231727    uint8_t   const idxRegEffSp     = fFlat ? idxRegRsp : iemNativeRegAllocTmp(pReNative, &off);
    17241728    /** @todo can do a better job picking the register here. For cbMem >= 4 this
    17251729     *        will be the resulting register value. */
    1726     uint8_t   const idxRegMemResult = iemNativeRegAllocTmp(pReNative, &off); /* pointer then value; arm64 SP += 2/4 helper too.  */
     1730    uint8_t   const idxRegMemResult = iemNativeRegAllocTmp(pReNative, &off); /* pointer then value; arm64 SP += 2/4 helper too. */
    17271731
    17281732    uint32_t        offFixupJumpToUseOtherBitSp = UINT32_MAX;
     
    19561960
    19571961        /* Allocate a temporary CR0 register. */
    1958         uint8_t const idxCr0Reg       = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Cr0, kIemNativeGstRegUse_ReadOnly);
     1962        uint8_t const idxCr0Reg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Cr0,
     1963                                                                  kIemNativeGstRegUse_ReadOnly);
    19591964
    19601965        /*
     
    19631968         */
    19641969        /* Test and jump. */
    1965         off = iemNativeEmitTestAnyBitsInGprAndTbExitIfAnySet(pReNative, off, idxCr0Reg, X86_CR0_EM | X86_CR0_TS, kIemNativeExitReason_RaiseNm);
     1970        off = iemNativeEmitTestAnyBitsInGprAndTbExitIfAnySet(pReNative, off, idxCr0Reg, X86_CR0_EM | X86_CR0_TS,
     1971                                                             kIemNativeLabelType_RaiseNm);
    19661972
    19671973        /* Free but don't flush the CR0 register. */
     
    20132019
    20142020        /* Allocate a temporary CR0 register. */
    2015         uint8_t const idxCr0Reg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Cr0, kIemNativeGstRegUse_Calculation);
     2021        uint8_t const idxCr0Reg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Cr0,
     2022                                                                  kIemNativeGstRegUse_Calculation);
    20162023
    20172024        /*
     
    20212028        off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxCr0Reg, X86_CR0_MP | X86_CR0_TS);
    20222029        /* Test and jump. */
    2023         off = iemNativeEmitTestIfGpr32EqualsImmAndTbExit(pReNative, off, idxCr0Reg, X86_CR0_MP | X86_CR0_TS, kIemNativeExitReason_RaiseNm);
     2030        off = iemNativeEmitTestIfGpr32EqualsImmAndTbExit(pReNative, off, idxCr0Reg, X86_CR0_MP | X86_CR0_TS,
     2031                                                         kIemNativeLabelType_RaiseNm);
    20242032
    20252033        /* Free the CR0 register. */
     
    20652073
    20662074    /* Allocate a temporary FSW register. */
    2067     uint8_t const idxFpuFswReg    = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_FpuFsw, kIemNativeGstRegUse_ReadOnly);
     2075    uint8_t const idxFpuFswReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_FpuFsw,
     2076                                                                 kIemNativeGstRegUse_ReadOnly);
    20682077
    20692078    /*
     
    20722081     */
    20732082    /* Test and jump. */
    2074     off = iemNativeEmitTestBitInGprAndTbExitIfSet(pReNative, off, idxFpuFswReg, X86_FSW_ES_BIT, kIemNativeExitReason_RaiseMf);
     2083    off = iemNativeEmitTestBitInGprAndTbExitIfSet(pReNative, off, idxFpuFswReg, X86_FSW_ES_BIT, kIemNativeLabelType_RaiseMf);
    20752084
    20762085    /* Free but don't flush the FSW register. */
     
    21362145        off = iemNativeEmitAndGpr32ByImmEx(pCodeBuf, off,   idxTmpReg, X86_CR0_EM | X86_CR0_TS | X86_CR4_OSFXSR);
    21372146        off = iemNativeEmitXorGpr32ByImmEx(pCodeBuf, off,   idxTmpReg, X86_CR4_OSFXSR);
    2138         off = iemNativeEmitJccTbExitEx(pReNative, pCodeBuf, off, kIemNativeExitReason_RaiseSseRelated, kIemNativeInstrCond_ne);
     2147        off = iemNativeEmitJccTbExitEx(pReNative, pCodeBuf, off, kIemNativeLabelType_RaiseSseRelated, kIemNativeInstrCond_ne);
    21392148
    21402149#elif defined(RT_ARCH_ARM64)
     
    21542163        /* -> idxTmpReg[0]=~OSFXSR; idxTmpReg[2]=EM; idxTmpReg[3]=TS; (the rest is zero) */
    21552164        off = iemNativeEmitTestIfGprIsNotZeroAndTbExitEx(pReNative, pCodeBuf, off, idxTmpReg, false /*f64Bit*/,
    2156                                                          kIemNativeExitReason_RaiseSseRelated);
     2165                                                         kIemNativeLabelType_RaiseSseRelated);
    21572166
    21582167#else
     
    22422251        off = iemNativeEmitXorGpr32ByImmEx(pCodeBuf, off,                idxTmpReg, ((XSAVE_C_YMM | XSAVE_C_SSE) << 2) | 2);
    22432252        /* -> idxTmpReg[0]=CR0.TS idxTmpReg[1]=~CR4.OSXSAVE; idxTmpReg[2]=0; idxTmpReg[3]=~SSE; idxTmpReg[4]=~YMM; */
    2244         off = iemNativeEmitJccTbExitEx(pReNative, pCodeBuf, off, kIemNativeExitReason_RaiseAvxRelated, kIemNativeInstrCond_ne);
     2253        off = iemNativeEmitJccTbExitEx(pReNative, pCodeBuf, off, kIemNativeLabelType_RaiseAvxRelated, kIemNativeInstrCond_ne);
    22452254
    22462255#elif defined(RT_ARCH_ARM64)
     
    22612270        /* -> idxTmpReg[0]=CR0.TS; idxTmpReg[1]=~CR4.OSXSAVE; idxTmpReg[2]=~SSE; idxTmpReg[3]=~YMM; (the rest is zero) */
    22622271        off = iemNativeEmitTestIfGprIsNotZeroAndTbExitEx(pReNative, pCodeBuf, off, idxTmpReg, false /*f64Bit*/,
    2263                                                          kIemNativeExitReason_RaiseAvxRelated);
     2272                                                         kIemNativeLabelType_RaiseAvxRelated);
    22642273
    22652274#else
     
    23022311#endif
    23032312
    2304     uint8_t const idxRegMxCsr = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_MxCsr, kIemNativeGstRegUse_ReadOnly);
     2313    uint8_t const idxRegMxCsr = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_MxCsr,
     2314                                                                kIemNativeGstRegUse_ReadOnly);
    23052315    uint8_t const idxRegTmp   = iemNativeRegAllocTmp(pReNative, &off);
    23062316
     
    23162326    off = iemNativeEmitAndGpr32ByGpr32(pReNative, off, idxRegTmp, idxRegMxCsr);
    23172327    off = iemNativeEmitTestAnyBitsInGprAndTbExitIfAnySet(pReNative, off, idxRegTmp, X86_MXCSR_XCPT_FLAGS,
    2318                                                          kIemNativeExitReason_RaiseSseAvxFpRelated);
     2328                                                         kIemNativeLabelType_RaiseSseAvxFpRelated);
    23192329
    23202330    /* Free but don't flush the MXCSR register. */
     
    23532363
    23542364    /* raise \#DE exception unconditionally. */
    2355     return iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_RaiseDe);
     2365    return iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_RaiseDe);
    23562366}
    23572367
     
    23712381 */
    23722382DECL_INLINE_THROW(uint32_t)
    2373 iemNativeEmitRaiseGp0IfEffAddrUnaligned(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr, uint8_t idxVarEffAddr, uint8_t cbAlign)
     2383iemNativeEmitRaiseGp0IfEffAddrUnaligned(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr,
     2384                                        uint8_t idxVarEffAddr, uint8_t cbAlign)
    23742385{
    23752386    IEMNATIVE_ASSERT_VAR_IDX(pReNative, idxVarEffAddr);
     
    23902401
    23912402    off = iemNativeEmitTestAnyBitsInGprAndTbExitIfAnySet(pReNative, off, idxVarReg, cbAlign - 1,
    2392                                                          kIemNativeExitReason_RaiseGp0);
     2403                                                         kIemNativeLabelType_RaiseGp0);
    23932404
    23942405    iemNativeVarRegisterRelease(pReNative, idxVarEffAddr);
     
    34303441#endif
    34313442    fGstShwFlush = iemNativeCImplFlagsToGuestShadowFlushMask(pReNative->fCImpl, fGstShwFlush | RT_BIT_64(kIemNativeGstReg_Pc));
    3432     if (!(pReNative->fMc & IEM_MC_F_WITHOUT_FLAGS)) /** @todo We don't emit with-flags/without-flags variations for CIMPL calls.  */
     3443    if (!(pReNative->fMc & IEM_MC_F_WITHOUT_FLAGS)) /** @todo We don't emit with-flags/without-flags variations for CIMPL calls. */
    34333444        fGstShwFlush |= RT_BIT_64(kIemNativeGstReg_EFlags);
    34343445    iemNativeRegFlushGuestShadows(pReNative, fGstShwFlush);
     
    52105221
    52115222/** Handles IEM_MC_SET_EFL_BIT/IEM_MC_CLEAR_EFL_BIT/IEM_MC_FLIP_EFL_BIT. */
    5212 DECL_INLINE_THROW(uint32_t) iemNativeEmitModifyEFlagsBit(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint32_t fEflBit, IEMNATIVEMITEFLOP enmOp)
     5223DECL_INLINE_THROW(uint32_t)
     5224iemNativeEmitModifyEFlagsBit(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint32_t fEflBit, IEMNATIVEMITEFLOP enmOp)
    52135225{
    52145226    uint8_t const idxEflReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_EFlags,
     
    66796691         */
    66806692        /* Allocate a temporary PC register. */
    6681         uint8_t const idxPcReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Pc, kIemNativeGstRegUse_ForUpdate);
     6693        uint8_t const idxPcReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_Pc,
     6694                                                                 kIemNativeGstRegUse_ForUpdate);
    66826695
    66836696        /* Restore the original value. */
     
    80108023            AssertMsg(   pReNative->idxCurCall == 0
    80118024                      || IEMLIVENESS_STATE_IS_CLOBBER_EXPECTED(iemNativeLivenessGetPrevStateByGstReg(pReNative, IEMNATIVEGSTREG_GPR(idxGReg))),
    8012                       ("%s - %u\n", g_aGstShadowInfo[idxGReg].pszName, iemNativeLivenessGetPrevStateByGstReg(pReNative, IEMNATIVEGSTREG_GPR(idxGReg))));
     8025                      ("%s - %u\n", g_aGstShadowInfo[idxGReg].pszName,
     8026                       iemNativeLivenessGetPrevStateByGstReg(pReNative, IEMNATIVEGSTREG_GPR(idxGReg))));
    80138027#endif
    80148028            iemNativeRegClearAndMarkAsGstRegShadow(pReNative, idxRegMemResult,  IEMNATIVEGSTREG_GPR(idxGReg), off);
     
    88668880        /* Allocate destination and source register. */
    88678881        uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXRegDst),
    8868                                                                               kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForFullWrite);
     8882                                                                              kIemNativeGstSimdRegLdStSz_Low128,
     8883                                                                              kIemNativeGstRegUse_ForFullWrite);
    88698884        uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXRegSrc),
    8870                                                                               kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     8885                                                                              kIemNativeGstSimdRegLdStSz_Low128,
     8886                                                                              kIemNativeGstRegUse_ReadOnly);
    88718887
    88728888        off = iemNativeEmitSimdLoadVecRegFromVecRegU128(pReNative, off, idxSimdRegDst, idxSimdRegSrc);
     
    89208936
    89218937    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    8922                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     8938                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     8939                                                                          kIemNativeGstRegUse_ReadOnly);
    89238940
    89248941    iemNativeVarSetKindToStack(pReNative, idxDstVar);
     
    89498966
    89508967    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    8951                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     8968                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     8969                                                                          kIemNativeGstRegUse_ReadOnly);
    89528970
    89538971    iemNativeVarSetKindToStack(pReNative, idxDstVar);
     
    89758993
    89768994    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    8977                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     8995                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     8996                                                                          kIemNativeGstRegUse_ReadOnly);
    89788997
    89798998    iemNativeVarSetKindToStack(pReNative, idxDstVar);
     
    90019020
    90029021    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9003                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     9022                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9023                                                                          kIemNativeGstRegUse_ReadOnly);
    90049024
    90059025    iemNativeVarSetKindToStack(pReNative, idxDstVar);
     
    90329052
    90339053    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9034                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForFullWrite);
     9054                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9055                                                                          kIemNativeGstRegUse_ForFullWrite);
    90359056    uint8_t const idxVarReg     = iemNativeVarSimdRegisterAcquire(pReNative, idxSrcVar, &off, true /*fInitialized*/);
    90369057
     
    90839104
    90849105    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9085                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate);
     9106                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9107                                                                          kIemNativeGstRegUse_ForUpdate);
    90869108    uint8_t const idxVarReg     = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, true /*fInitialized*/);
    90879109
     
    91149136
    91159137    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9116                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate);
     9138                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9139                                                                          kIemNativeGstRegUse_ForUpdate);
    91179140    uint8_t const idxVarReg     = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, true /*fInitialized*/);
    91189141
     
    91409163
    91419164    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9142                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate);
     9165                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9166                                                                          kIemNativeGstRegUse_ForUpdate);
    91439167    uint8_t const idxVarReg     = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, true /*fInitialized*/);
    91449168
     
    91679191
    91689192    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9169                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate);
     9193                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9194                                                                          kIemNativeGstRegUse_ForUpdate);
    91709195    uint8_t const idxVarReg     = iemNativeVarSimdRegisterAcquire(pReNative, idxSrcVar, &off, true /*fInitialized*/);
    91719196
     
    91899214{
    91909215    /*
    9191      * The iYRegSrc == iYRegDst case needs to be treated differently here, because if iYRegDst gets allocated first for the full write
    9192      * it won't load the actual value from CPUMCTX. When allocating iYRegSrc afterwards it will get duplicated from the already
    9193      * allocated host register for iYRegDst containing garbage. This will be catched by the guest register value checking in debug builds.
     9216     * The iYRegSrc == iYRegDst case needs to be treated differently here, because
     9217     * if iYRegDst gets allocated first for the full write  it won't load the
     9218     * actual value from CPUMCTX.  When allocating iYRegSrc afterwards it will get
     9219     * duplicated from the already allocated host register for iYRegDst containing
     9220     * garbage.  This will be catched by the guest register value checking in debug
     9221     * builds.
    91949222     */
    91959223    if (iYRegDst != iYRegSrc)
     
    92149242        /* This effectively only clears the upper 128-bits of the register. */
    92159243        uint8_t const idxSimdReg = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegDst),
    9216                                                                            kIemNativeGstSimdRegLdStSz_High128, kIemNativeGstRegUse_ForFullWrite);
     9244                                                                           kIemNativeGstSimdRegLdStSz_High128,
     9245                                                                           kIemNativeGstRegUse_ForFullWrite);
    92179246
    92189247        off = iemNativeEmitSimdZeroVecRegHighU128(pReNative, off, idxSimdReg);
     
    92349263{
    92359264    /*
    9236      * The iYRegSrc == iYRegDst case needs to be treated differently here, because if iYRegDst gets allocated first for the full write
    9237      * it won't load the actual value from CPUMCTX. When allocating iYRegSrc afterwards it will get duplicated from the already
    9238      * allocated host register for iYRegDst containing garbage. This will be catched by the guest register value checking in debug builds.
    9239      * iYRegSrc == iYRegDst would effectively only clear any upper 256-bits for a zmm register we don't support yet, so this is just a nop.
     9265     * The iYRegSrc == iYRegDst case needs to be treated differently here, because
     9266     * if iYRegDst gets allocated first for the full write it won't load the
     9267     * actual value from CPUMCTX.  When allocating iYRegSrc afterwards it will get
     9268     * duplicated from the already allocated host register for iYRegDst containing
     9269     * garbage. This will be catched by the guest register value checking in debug
     9270     * builds. iYRegSrc == iYRegDst would effectively only clear any upper 256-bits
     9271     * for a zmm register we don't support yet, so this is just a nop.
    92409272     */
    92419273    if (iYRegDst != iYRegSrc)
     
    92439275        /* Allocate destination and source register. */
    92449276        uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegSrc),
    9245                                                                               kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ReadOnly);
     9277                                                                              kIemNativeGstSimdRegLdStSz_256,
     9278                                                                              kIemNativeGstRegUse_ReadOnly);
    92469279        uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegDst),
    9247                                                                               kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9280                                                                              kIemNativeGstSimdRegLdStSz_256,
     9281                                                                              kIemNativeGstRegUse_ForFullWrite);
    92489282
    92499283        off = iemNativeEmitSimdLoadVecRegFromVecRegU256(pReNative, off, idxSimdRegDst, idxSimdRegSrc);
     
    93579391{
    93589392    uint8_t const idxSimdReg = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9359                                                                        kIemNativeGstSimdRegLdStSz_High128, kIemNativeGstRegUse_ForFullWrite);
     9393                                                                       kIemNativeGstSimdRegLdStSz_High128,
     9394                                                                       kIemNativeGstRegUse_ForFullWrite);
    93609395
    93619396    off = iemNativeEmitSimdZeroVecRegHighU128(pReNative, off, idxSimdReg);
     
    94119446
    94129447    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9413                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9448                                                                          kIemNativeGstSimdRegLdStSz_256,
     9449                                                                          kIemNativeGstRegUse_ForFullWrite);
    94149450
    94159451    uint8_t const idxVarReg = iemNativeVarSimdRegisterAcquire(pReNative, idxSrcVar, &off);
     
    94379473
    94389474    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9439                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9475                                                                          kIemNativeGstSimdRegLdStSz_256,
     9476                                                                          kIemNativeGstRegUse_ForFullWrite);
    94409477
    94419478    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    94629499
    94639500    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9464                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9501                                                                          kIemNativeGstSimdRegLdStSz_256,
     9502                                                                          kIemNativeGstRegUse_ForFullWrite);
    94659503
    94669504    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    94889526
    94899527    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9490                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9528                                                                          kIemNativeGstSimdRegLdStSz_256,
     9529                                                                          kIemNativeGstRegUse_ForFullWrite);
    94919530
    94929531    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    95149553
    95159554    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9516                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9555                                                                          kIemNativeGstSimdRegLdStSz_256,
     9556                                                                          kIemNativeGstRegUse_ForFullWrite);
    95179557
    95189558    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    95409580
    95419581    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9542                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9582                                                                          kIemNativeGstSimdRegLdStSz_256,
     9583                                                                          kIemNativeGstRegUse_ForFullWrite);
    95439584
    95449585    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    95649605
    95659606    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9566                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9607                                                                          kIemNativeGstSimdRegLdStSz_256,
     9608                                                                          kIemNativeGstRegUse_ForFullWrite);
    95679609
    95689610    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    95889630
    95899631    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9590                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9632                                                                          kIemNativeGstSimdRegLdStSz_256,
     9633                                                                          kIemNativeGstRegUse_ForFullWrite);
    95919634
    95929635    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    96139656
    96149657    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9615                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9658                                                                          kIemNativeGstSimdRegLdStSz_256,
     9659                                                                          kIemNativeGstRegUse_ForFullWrite);
    96169660
    96179661    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    96389682
    96399683    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9640                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9684                                                                          kIemNativeGstSimdRegLdStSz_256,
     9685                                                                          kIemNativeGstRegUse_ForFullWrite);
    96419686
    96429687    uint8_t const idxVarReg = iemNativeVarSimdRegisterAcquire(pReNative, idxSrcVar, &off);
     
    96639708
    96649709    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9665                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9710                                                                          kIemNativeGstSimdRegLdStSz_256,
     9711                                                                          kIemNativeGstRegUse_ForFullWrite);
    96669712
    96679713    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    96899735
    96909736    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
    9691                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9737                                                                          kIemNativeGstSimdRegLdStSz_256,
     9738                                                                          kIemNativeGstRegUse_ForFullWrite);
    96929739
    96939740    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
     
    97159762
    97169763    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegDst),
    9717                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9764                                                                          kIemNativeGstSimdRegLdStSz_256,
     9765                                                                          kIemNativeGstRegUse_ForFullWrite);
    97189766    uint8_t const idxSimdRegSrcHx = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegSrcHx),
    9719                                                                             kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     9767                                                                            kIemNativeGstSimdRegLdStSz_Low128,
     9768                                                                            kIemNativeGstRegUse_ReadOnly);
    97209769    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
    97219770
     
    97449793
    97459794    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegDst),
    9746                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9795                                                                          kIemNativeGstSimdRegLdStSz_256,
     9796                                                                          kIemNativeGstRegUse_ForFullWrite);
    97479797    uint8_t const idxSimdRegSrcHx = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegSrcHx),
    9748                                                                             kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     9798                                                                            kIemNativeGstSimdRegLdStSz_Low128,
     9799                                                                            kIemNativeGstRegUse_ReadOnly);
    97499800    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxSrcVar, &off);
    97509801
     
    97719822{
    97729823    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
    9773                                                                           kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForUpdate);
     9824                                                                          kIemNativeGstSimdRegLdStSz_Low128,
     9825                                                                          kIemNativeGstRegUse_ForUpdate);
    97749826
    97759827    /** @todo r=aeichner For certain bit combinations we could reduce the number of emitted instructions. */
     
    98049856
    98059857    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegSrc),
    9806                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ReadOnly);
     9858                                                                          kIemNativeGstSimdRegLdStSz_256,
     9859                                                                          kIemNativeGstRegUse_ReadOnly);
    98079860    uint8_t const idxVarReg = iemNativeVarSimdRegisterAcquire(pReNative, idxDstVar, &off);
    98089861
     
    98319884
    98329885    uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYRegDst),
    9833                                                                           kIemNativeGstSimdRegLdStSz_256, kIemNativeGstRegUse_ForFullWrite);
     9886                                                                          kIemNativeGstSimdRegLdStSz_256,
     9887                                                                          kIemNativeGstRegUse_ForFullWrite);
    98349888    uint8_t const idxVarRegSrc  = iemNativeVarSimdRegisterAcquire(pReNative, idxSrcVar, &off, true /*fInitalized*/);
    98359889
     
    997410028     * Do all the call setup and cleanup.
    997510029     */
    9976     off = iemNativeEmitCallCommon(pReNative, off, cArgs + IEM_SSE_AIMPL_HIDDEN_ARGS, IEM_SSE_AIMPL_HIDDEN_ARGS, false /*fFlushPendingWrites*/);
     10030    off = iemNativeEmitCallCommon(pReNative, off, cArgs + IEM_SSE_AIMPL_HIDDEN_ARGS, IEM_SSE_AIMPL_HIDDEN_ARGS,
     10031                                  false /*fFlushPendingWrites*/);
    997710032
    997810033    /*
     
    1002010075/** Emits code for IEM_MC_CALL_SSE_AIMPL_3. */
    1002110076DECL_INLINE_THROW(uint32_t)
    10022 iemNativeEmitCallSseAImpl3(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl, uint8_t idxArg0, uint8_t idxArg1, uint8_t idxArg2)
     10077iemNativeEmitCallSseAImpl3(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl,
     10078                           uint8_t idxArg0, uint8_t idxArg1, uint8_t idxArg2)
    1002310079{
    1002410080    IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg0, 0 + IEM_SSE_AIMPL_HIDDEN_ARGS);
     
    1005110107/** Emits code for IEM_MC_CALL_AVX_AIMPL_3. */
    1005210108DECL_INLINE_THROW(uint32_t)
    10053 iemNativeEmitCallAvxAImpl3(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl, uint8_t idxArg0, uint8_t idxArg1, uint8_t idxArg2)
     10109iemNativeEmitCallAvxAImpl3(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl,
     10110                           uint8_t idxArg0, uint8_t idxArg1, uint8_t idxArg2)
    1005410111{
    1005510112    IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg0, 0 + IEM_AVX_AIMPL_HIDDEN_ARGS);
     
    1005810115    return iemNativeEmitCallSseAvxAImplCommon(pReNative, off, pfnAImpl, 3);
    1005910116}
     10117
     10118
    1006010119#endif /* IEMNATIVE_WITH_SIMD_REG_ALLOCATOR */
    1006110120
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r105261 r105271  
    25142514 */
    25152515DECL_HIDDEN_THROW(void)
    2516 iemNativeAddTbExitFixup(PIEMRECOMPILERSTATE pReNative, uint32_t offWhere, IEMNATIVEEXITREASON enmExitReason)
    2517 {
     2516iemNativeAddTbExitFixup(PIEMRECOMPILERSTATE pReNative, uint32_t offWhere, IEMNATIVELABELTYPE enmExitReason)
     2517{
     2518    Assert(IEMNATIVELABELTYPE_IS_EXIT_REASON(enmExitReason));
     2519
    25182520    /*
    25192521     * Make sure we've room.
     
    25402542     */
    25412543    paTbExitFixups[cTbExitFixups].off            = offWhere;
    2542     paTbExitFixups[cTbExitFixups].enmExitReason  = (uint32_t)enmExitReason;
     2544    paTbExitFixups[cTbExitFixups].enmExitReason  = enmExitReason;
    25432545    pReNative->cTbExitFixups = cTbExitFixups + 1;
    25442546}
     
    62366238
    62376239    /* Jump to non-zero status return path. */
    6238     off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_NonZeroRetOrPassUp);
     6240    off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_NonZeroRetOrPassUp);
    62396241
    62406242    /* done. */
     
    62546256
    62556257    off = iemNativeEmitTestIfGprIsNotZeroAndTbExitEx(pReNative, pu32CodeBuf, off, ARMV8_A64_REG_X4, true /*f64Bit*/,
    6256                                                      kIemNativeExitReason_NonZeroRetOrPassUp);
     6258                                                     kIemNativeLabelType_NonZeroRetOrPassUp);
    62576259
    62586260#else
     
    63026304    off = iemNativeEmitAddGpr32Imm(pReNative, off, iTmpReg, (int32_t)0x8000);
    63036305    off = iemNativeEmitShiftGprRight(pReNative, off, iTmpReg, 16);
    6304     off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_RaiseGp0);
     6306    off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_RaiseGp0);
    63056307
    63066308    iemNativeRegFreeTmp(pReNative, iTmpReg);
     
    63216323    off = iemNativeEmitAddTwoGprs(pReNative, off, iTmpReg, idxAddrReg);
    63226324    off = iemNativeEmitCmpArm64(pReNative, off, ARMV8_A64_REG_XZR, iTmpReg, true /*f64Bit*/, 48 /*cShift*/, kArmv8A64InstrShift_Lsr);
    6323     off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeExitReason_RaiseGp0);
     6325    off = iemNativeEmitJnzTbExit(pReNative, off, kIemNativeLabelType_RaiseGp0);
    63246326
    63256327    iemNativeRegFreeTmp(pReNative, iTmpReg);
     
    63646366
    63656367    off = iemNativeEmitCmpGpr32WithGpr(pReNative, off, idxAddrReg, idxRegCsLim);
    6366     off = iemNativeEmitJaTbExit(pReNative, off, kIemNativeExitReason_RaiseGp0);
     6368    off = iemNativeEmitJaTbExit(pReNative, off, kIemNativeLabelType_RaiseGp0);
    63676369
    63686370    iemNativeRegFreeTmp(pReNative, idxRegCsLim);
     
    96609662#  error "port me"
    96619663# endif
    9662     uint32_t aoffLabels[kIemNativeExitReason_Max] = {0};
     9664    uint32_t aoffLabels[kIemNativeLabelType_LastTbExit + 1] = {0};
    96639665    int      rc  = VINF_SUCCESS;
    96649666    uint32_t off = 0;
     
    96699671         * Emit the epilog code.
    96709672         */
    9671         aoffLabels[kIemNativeExitReason_Return] = off;
     9673        aoffLabels[kIemNativeLabelType_Return] = off;
    96729674        off = iemNativeEmitCoreEpilog(pReNative, off);
    96739675
     
    96779679        static struct
    96789680        {
    9679             IEMNATIVEEXITREASON enmExitReason;
    9680             uint32_t (*pfnEmitCore)(PIEMRECOMPILERSTATE pReNative, uint32_t off);
     9681            IEMNATIVELABELTYPE enmExitReason;
     9682            uint32_t         (*pfnEmitCore)(PIEMRECOMPILERSTATE pReNative, uint32_t off);
    96819683        } const s_aSpecialWithEpilogs[] =
    96829684        {
    9683             { kIemNativeExitReason_NonZeroRetOrPassUp,    iemNativeEmitCoreRcFiddling           },
    9684             { kIemNativeExitReason_ReturnBreak,           iemNativeEmitCoreReturnBreak          },
    9685             { kIemNativeExitReason_ReturnBreakFF,         iemNativeEmitCoreReturnBreakFF        },
    9686             { kIemNativeExitReason_ReturnWithFlags,       iemNativeEmitCoreReturnWithFlags      },
     9685            { kIemNativeLabelType_NonZeroRetOrPassUp,   iemNativeEmitCoreRcFiddling           },
     9686            { kIemNativeLabelType_ReturnBreak,          iemNativeEmitCoreReturnBreak          },
     9687            { kIemNativeLabelType_ReturnBreakFF,        iemNativeEmitCoreReturnBreakFF        },
     9688            { kIemNativeLabelType_ReturnWithFlags,      iemNativeEmitCoreReturnWithFlags      },
    96879689        };
    96889690        for (uint32_t i = 0; i < RT_ELEMENTS(s_aSpecialWithEpilogs); i++)
     
    97009702        static struct
    97019703        {
    9702             IEMNATIVEEXITREASON  enmExitReason;
     9704            IEMNATIVELABELTYPE   enmExitReason;
    97039705            uintptr_t            pfnHelper;
    97049706        } const s_aViaLookup[] =
    97059707        {
    9706             {   kIemNativeExitReason_ReturnBreakViaLookup,
     9708            {   kIemNativeLabelType_ReturnBreakViaLookup,
    97079709                (uintptr_t)iemNativeHlpReturnBreakViaLookup<false /*a_fWithIrqCheck*/>          },
    9708             {   kIemNativeExitReason_ReturnBreakViaLookupWithIrq,
     9710            {   kIemNativeLabelType_ReturnBreakViaLookupWithIrq,
    97099711                (uintptr_t)iemNativeHlpReturnBreakViaLookup<true /*a_fWithIrqCheck*/>           },
    9710             {   kIemNativeExitReason_ReturnBreakViaLookupWithTlb,
     9712            {   kIemNativeLabelType_ReturnBreakViaLookupWithTlb,
    97119713                (uintptr_t)iemNativeHlpReturnBreakViaLookupWithTlb<false /*a_fWithIrqCheck*/>   },
    9712             {   kIemNativeExitReason_ReturnBreakViaLookupWithTlbAndIrq,
     9714            {   kIemNativeLabelType_ReturnBreakViaLookupWithTlbAndIrq,
    97139715                (uintptr_t)iemNativeHlpReturnBreakViaLookupWithTlb<true /*a_fWithIrqCheck*/>    },
    97149716        };
    9715         uint32_t const offReturnBreak = aoffLabels[kIemNativeExitReason_ReturnBreak]; Assert(offReturnBreak != 0);
     9717        uint32_t const offReturnBreak = aoffLabels[kIemNativeLabelType_ReturnBreak]; Assert(offReturnBreak != 0);
    97169718        for (uint32_t i = 0; i < RT_ELEMENTS(s_aViaLookup); i++)
    97179719        {
     
    97299731        static struct
    97309732        {
    9731             IEMNATIVEEXITREASON             enmExitReason;
     9733            IEMNATIVELABELTYPE              enmExitReason;
    97329734            bool                            fWithEpilog;
    97339735            PFNIEMNATIVESIMPLETAILLABELCALL pfnCallback;
    97349736        } const s_aSimpleTailLabels[] =
    97359737        {
    9736             {   kIemNativeExitReason_RaiseDe,               false, iemNativeHlpExecRaiseDe },
    9737             {   kIemNativeExitReason_RaiseUd,               false, iemNativeHlpExecRaiseUd },
    9738             {   kIemNativeExitReason_RaiseSseRelated,       false, iemNativeHlpExecRaiseSseRelated },
    9739             {   kIemNativeExitReason_RaiseAvxRelated,       false, iemNativeHlpExecRaiseAvxRelated },
    9740             {   kIemNativeExitReason_RaiseSseAvxFpRelated,  false, iemNativeHlpExecRaiseSseAvxFpRelated },
    9741             {   kIemNativeExitReason_RaiseNm,               false, iemNativeHlpExecRaiseNm },
    9742             {   kIemNativeExitReason_RaiseGp0,              false, iemNativeHlpExecRaiseGp0 },
    9743             {   kIemNativeExitReason_RaiseMf,               false, iemNativeHlpExecRaiseMf },
    9744             {   kIemNativeExitReason_RaiseXf,               false, iemNativeHlpExecRaiseXf },
    9745             {   kIemNativeExitReason_ObsoleteTb,            true,  iemNativeHlpObsoleteTb },
    9746             {   kIemNativeExitReason_NeedCsLimChecking,     true,  iemNativeHlpNeedCsLimChecking },
    9747             {   kIemNativeExitReason_CheckBranchMiss,       true,  iemNativeHlpCheckBranchMiss },
     9738            {   kIemNativeLabelType_RaiseDe,                false, iemNativeHlpExecRaiseDe },
     9739            {   kIemNativeLabelType_RaiseUd,                false, iemNativeHlpExecRaiseUd },
     9740            {   kIemNativeLabelType_RaiseSseRelated,        false, iemNativeHlpExecRaiseSseRelated },
     9741            {   kIemNativeLabelType_RaiseAvxRelated,        false, iemNativeHlpExecRaiseAvxRelated },
     9742            {   kIemNativeLabelType_RaiseSseAvxFpRelated,   false, iemNativeHlpExecRaiseSseAvxFpRelated },
     9743            {   kIemNativeLabelType_RaiseNm,                false, iemNativeHlpExecRaiseNm },
     9744            {   kIemNativeLabelType_RaiseGp0,               false, iemNativeHlpExecRaiseGp0 },
     9745            {   kIemNativeLabelType_RaiseMf,                false, iemNativeHlpExecRaiseMf },
     9746            {   kIemNativeLabelType_RaiseXf,                false, iemNativeHlpExecRaiseXf },
     9747            {   kIemNativeLabelType_ObsoleteTb,             true,  iemNativeHlpObsoleteTb },
     9748            {   kIemNativeLabelType_NeedCsLimChecking,      true,  iemNativeHlpNeedCsLimChecking },
     9749            {   kIemNativeLabelType_CheckBranchMiss,        true,  iemNativeHlpCheckBranchMiss },
    97489750        };
    97499751        for (uint32_t i = 0; i < RT_ELEMENTS(s_aSimpleTailLabels); i++)
     
    97599761            /* jump back to the return sequence / generate a return sequence. */
    97609762            if (!s_aSimpleTailLabels[i].fWithEpilog)
    9761                 off = iemNativeEmitJmpToFixed(pReNative, off, aoffLabels[kIemNativeExitReason_Return]);
     9763                off = iemNativeEmitJmpToFixed(pReNative, off, aoffLabels[kIemNativeLabelType_Return]);
    97629764            else
    97639765                off = iemNativeEmitCoreEpilog(pReNative, off);
     
    97679769# ifdef VBOX_STRICT
    97689770        /* Make sure we've generate code for all labels. */
    9769         for (uint32_t i = kIemNativeExitReason_Invalid + 1; i < RT_ELEMENTS(aoffLabels); i++)
    9770             Assert(aoffLabels[i] != 0 || i == kIemNativeExitReason_Return);
     9771        for (uint32_t i = kIemNativeLabelType_Invalid + 1; i < RT_ELEMENTS(aoffLabels); i++)
     9772            Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_Return);
    97719773#endif
    97729774    }
     
    98029804     * Initialize the context.
    98039805     */
    9804     AssertCompile(kIemNativeExitReason_Invalid == 0);
     9806    AssertCompile(kIemNativeLabelType_Invalid == 0);
    98059807    AssertCompile(RT_ELEMENTS(pCtx->apExitLabels) == RT_ELEMENTS(aoffLabels));
    9806     pCtx->apExitLabels[kIemNativeExitReason_Invalid] = 0;
    9807     for (uint32_t i = kIemNativeExitReason_Invalid + 1; i < RT_ELEMENTS(pCtx->apExitLabels); i++)
    9808     {
    9809         Assert(aoffLabels[i] != 0 || i == kIemNativeExitReason_Return);
     9808    pCtx->apExitLabels[kIemNativeLabelType_Invalid] = 0;
     9809    for (uint32_t i = kIemNativeLabelType_Invalid + 1; i < RT_ELEMENTS(pCtx->apExitLabels); i++)
     9810    {
     9811        Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_Return);
    98109812        pCtx->apExitLabels[i] = &paFinalCommonCodeRx[aoffLabels[i]];
    98119813        Log10(("    apExitLabels[%u]=%p %s\n", i, pCtx->apExitLabels[i], iemNativeGetLabelName((IEMNATIVELABELTYPE)i, true)));
     
    1006810070         */
    1006910071        //off = iemNativeEmitBrk(pReNative, off, 0x1227);
    10070         off = iemNativeEmitTbExit(pReNative, off, kIemNativeExitReason_Return);
     10072        off = iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_Return);
    1007110073#endif
    1007210074
     
    1017210174                AssertContinue(idxLabel != UINT32_MAX);
    1017310175                iemNativeLabelDefine(pReNative, idxLabel, off);
    10174                 off = iemNativeEmitTbExit(pReNative, off, (IEMNATIVEEXITREASON)enmLabel);
     10176                off = iemNativeEmitTbExit(pReNative, off, enmLabel);
    1017510177            } while (fTailLabels);
    1017610178        }
     
    1029210294    {
    1029310295        Assert(paTbExitFixups[i].off < off);
    10294         Assert(   paTbExitFixups[i].enmExitReason < kIemNativeExitReason_Max
    10295                && paTbExitFixups[i].enmExitReason > kIemNativeExitReason_Invalid);
     10296        Assert(IEMNATIVELABELTYPE_IS_EXIT_REASON(paTbExitFixups[i].enmExitReason));
    1029610297        RTPTRUNION const Ptr = { &paFinalInstrBuf[paTbExitFixups[i].off] };
    1029710298
Note: See TracChangeset for help on using the changeset viewer.

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