VirtualBox

Changeset 106407 in vbox for trunk


Ignore:
Timestamp:
Oct 16, 2024 10:30:34 PM (6 weeks ago)
Author:
vboxsync
Message:

VMM/IEM: Reduced the number of parameters for most iemNativeVarRegisterAcquire calls. bugref:10720

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h

    r106319 r106407  
    49014901    uint8_t const idxGstTmpReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(iGRegEx & 15),
    49024902                                                                 kIemNativeGstRegUse_ForUpdate);
    4903     uint8_t const    idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxValueVar, &off, true /*fInitialized*/);
     4903    uint8_t const    idxVarReg = iemNativeVarRegisterAcquireInited(pReNative, idxValueVar, &off);
    49044904
    49054905#ifdef RT_ARCH_AMD64
     
    50635063#elif defined(RT_ARCH_ARM64)
    50645064    /* bfi w1, w2, 0, 16 - moves bits 15:0 from idxVarReg to idxGstTmpReg bits 15:0. */
    5065     uint8_t const    idxVarReg   = iemNativeVarRegisterAcquire(pReNative, idxValueVar, &off, true /*fInitialized*/);
     5065    uint8_t const    idxVarReg   = iemNativeVarRegisterAcquireInited(pReNative, idxValueVar, &off);
    50665066    uint32_t * const pu32CodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1);
    50675067    pu32CodeBuf[off++] = Armv8A64MkInstrBfi(idxGstTmpReg, idxVarReg, 0, 16);
     
    56345634#endif
    56355635
    5636     uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVar, &off, true /*fInitialized*/);
     5636    uint8_t const idxVarReg = iemNativeVarRegisterAcquireInited(pReNative, idxVar, &off);
    56375637    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVar, cbMask);
    56385638
     
    56745674#endif
    56755675
    5676     uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVar, &off, true /*fInitialized*/);
     5676    uint8_t const idxVarReg = iemNativeVarRegisterAcquireInited(pReNative, idxVar, &off);
    56775677    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVar, cbMask);
    56785678
     
    57005700iemNativeEmitBswapLocal(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVar, uint8_t cbLocal)
    57015701{
    5702     uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVar, &off, true /*fInitialized*/);
     5702    uint8_t const idxVarReg = iemNativeVarRegisterAcquireInited(pReNative, idxVar, &off);
    57035703    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVar, cbLocal);
    57045704
     
    57405740#endif
    57415741
    5742     uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVar, &off, true /*fInitialized*/);
     5742    uint8_t const idxVarReg = iemNativeVarRegisterAcquireInited(pReNative, idxVar, &off);
    57435743    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVar, cbLocal);
    57445744
     
    57845784#endif
    57855785
    5786     uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVar, &off, true /*fInitialized*/);
     5786    uint8_t const idxVarReg = iemNativeVarRegisterAcquireInited(pReNative, idxVar, &off);
    57875787    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVar, cbLocal);
    57885788
     
    58215821    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVar, cbLocal);
    58225822
    5823     uint8_t const idxVarReg        = iemNativeVarRegisterAcquire(pReNative, idxVar, &off, true /*fInitialized*/);
    5824     uint8_t const idxVarRegEffAddr = iemNativeVarRegisterAcquire(pReNative, idxVarEffAddr, &off, true /*fInitialized*/);
     5823    uint8_t const idxVarReg        = iemNativeVarRegisterAcquireInited(pReNative, idxVar, &off);
     5824    uint8_t const idxVarRegEffAddr = iemNativeVarRegisterAcquireInited(pReNative, idxVarEffAddr, &off);
    58255825
    58265826    /* Need to sign extend the value. */
     
    59695969    {
    59705970        /* Register argument variable: Avoid assertions in generic call code and load it the traditional way. */
    5971         uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVarEFlags, &off, false /*fInitialized*/);
     5971        uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVarEFlags, &off);
    59725972        uint8_t const idxGstReg = iemNativeRegAllocTmpForGuestEFlagsIfAlreadyPresent(pReNative, &off,
    59735973                                                                                     a_fLivenessEflInput, a_fLivenessEflOutput);
     
    60096009iemNativeEmitCommitEFlags(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarEFlags, uint32_t fElfInput)
    60106010{
    6011     uint8_t const idxReg = iemNativeVarRegisterAcquire(pReNative, idxVarEFlags, &off, true /*fInitialized*/);
     6011    uint8_t const idxReg = iemNativeVarRegisterAcquireInited(pReNative, idxVarEFlags, &off);
    60126012    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxVarEFlags, sizeof(uint32_t));
    60136013
     
    74377437                            && enmOp == kIemNativeEmitMemOp_Store
    74387438                            && pVarValue->enmKind != kIemNativeVarKind_Immediate
    7439                           ? iemNativeVarRegisterAcquire(pReNative, idxVarValue, &off, true /*fInitialized*/)
     7439                          ? iemNativeVarRegisterAcquireInited(pReNative, idxVarValue, &off)
    74407440                          : UINT8_MAX;
    74417441
     
    74447444                                       && enmOp == kIemNativeEmitMemOp_Store
    74457445                                       && pVarValue->enmKind != kIemNativeVarKind_Immediate
    7446                                      ? iemNativeVarRegisterAcquire(pReNative, idxVarValue, &off, true /*fInitialized*/)
     7446                                     ? iemNativeVarRegisterAcquireInited(pReNative, idxVarValue, &off)
    74477447                                     : UINT8_MAX;
    74487448#endif
     
    84818481    uint8_t const  idxRegValue       =    !TlbState.fSkip
    84828482                                       && pVarValue->enmKind != kIemNativeVarKind_Immediate
    8483                                      ? iemNativeVarRegisterAcquire(pReNative, idxVarValue, &off, true /*fInitialized*/,
    8484                                                                    IEMNATIVE_CALL_ARG2_GREG /*idxRegPref*/)
     8483                                     ? iemNativeVarRegisterAcquireInitedWithPref(pReNative, idxVarValue, &off,
     8484                                                                                 IEMNATIVE_CALL_ARG2_GREG)
    84858485                                     : UINT8_MAX;
    84868486    uint8_t const  idxRegMemResult   = !TlbState.fSkip ? iemNativeRegAllocTmp(pReNative, &off) : UINT8_MAX;
     
    97099709#endif
    97109710    {
    9711         uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVarUnmapInfo, &off,
    9712                                                               true /*fInitialized*/, IEMNATIVE_CALL_ARG1_GREG /*idxRegPref*/);
     9711        uint8_t const idxVarReg = iemNativeVarRegisterAcquireInitedWithPref(pReNative, idxVarUnmapInfo, &off,
     9712                                                                            IEMNATIVE_CALL_ARG1_GREG);
    97139713        off = iemNativeEmitTestAnyBitsInGpr8(pReNative, off, idxVarReg, 0xff);
    97149714        iemNativeVarRegisterRelease(pReNative, idxVarUnmapInfo);
     
    99399939    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxDstVar, sizeof(uint16_t));
    99409940
    9941     uint8_t const idxReg = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, false /*fInitialized*/);
     9941    uint8_t const idxReg = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off);
    99429942    /* Allocate a temporary FSW register. */
    99439943    /** @todo eliminate extra register   */
     
    1020110201                                                                          kIemNativeGstSimdRegLdStSz_Low128,
    1020210202                                                                          kIemNativeGstRegUse_ForUpdate);
    10203     uint8_t const idxVarReg     = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, true /*fInitialized*/);
     10203    uint8_t const idxVarReg     = iemNativeVarRegisterAcquireInited(pReNative, idxDstVar, &off);
    1020410204
    1020510205    switch (cbLocal)
     
    1023310233                                                                          kIemNativeGstSimdRegLdStSz_Low128,
    1023410234                                                                          kIemNativeGstRegUse_ForUpdate);
    10235     uint8_t const idxVarReg     = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, true /*fInitialized*/);
     10235    uint8_t const idxVarReg     = iemNativeVarRegisterAcquireInited(pReNative, idxDstVar, &off);
    1023610236
    1023710237    /* Zero the vector register first, then store the 64-bit value to the lower 64-bit. */
     
    1026010260                                                                          kIemNativeGstSimdRegLdStSz_Low128,
    1026110261                                                                          kIemNativeGstRegUse_ForUpdate);
    10262     uint8_t const idxVarReg     = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off, true /*fInitialized*/);
     10262    uint8_t const idxVarReg     = iemNativeVarRegisterAcquireInited(pReNative, idxDstVar, &off);
    1026310263
    1026410264    /* Zero the vector register first, then store the 32-bit value to the lowest 32-bit element. */
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r106401 r106407  
    74537453    iemNativeVarSetKindToStack(pReNative, IEMNATIVE_VAR_IDX_PACK(idxVar));
    74547454
    7455     uint8_t const idxVarOtherReg = iemNativeVarRegisterAcquire(pReNative, idxVarOther, poff, true /*fInitialized*/);
    7456     uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxVar, poff);
     7455    uint8_t const idxVarOtherReg = iemNativeVarRegisterAcquireInited(pReNative, idxVarOther, poff);
     7456    uint8_t const idxVarReg      = iemNativeVarRegisterAcquire(pReNative, idxVar, poff);
    74577457
    74587458/** @todo combine MOV and AND using MOVZX/similar. */
     
    74837483 *                          In case a register needs to be freed up or the value
    74847484 *                          loaded off the stack.
    7485  * @param   fInitialized    Set if the variable must already have been
     7485 * @param   idxRegPref      Preferred register number or UINT8_MAX.
     7486 *
     7487 * @tparam  a_fInitialized  Set if the variable must already have been
    74867488 *                          initialized. Will throw VERR_IEM_VAR_NOT_INITIALIZED
    74877489 *                          if this is not the case.
    7488  * @param   idxRegPref      Preferred register number or UINT8_MAX.
     7490 * @tparam  a_fWithRegPref  If idxRegPref is valid.
    74897491 *
    74907492 * @note    Must not modify the host status flags!
    74917493 */
    7492 DECL_HIDDEN_THROW(uint8_t) iemNativeVarRegisterAcquire(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff,
    7493                                                        bool fInitialized /*= false*/, uint8_t idxRegPref /*= UINT8_MAX*/)
     7494template<bool const a_fInitialized, bool const a_fWithRegPref>
     7495DECL_FORCE_INLINE_THROW(uint8_t)
     7496iemNativeVarRegisterAcquireInt(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff, uint8_t idxRegPref)
    74947497{
    74957498    IEMNATIVE_ASSERT_VAR_IDX(pReNative, idxVar);
     
    74977500    Assert(pVar->cbVar <= 8);
    74987501    Assert(!pVar->fRegAcquired);
    7499 
     7502    Assert(!a_fWithRegPref || idxRegPref < RT_ELEMENTS(pReNative->Core.aHstRegs));
     7503
     7504    /** @todo inline this bit? */
    75007505    uint8_t idxReg = pVar->idxReg;
    75017506    if (idxReg < RT_ELEMENTS(pReNative->Core.aHstRegs))
     
    75477552        Log11(("iemNativeVarRegisterAcquire: idxVar=%#x idxReg=%u (matching arg %u)\n", idxVar, idxReg, uArgNo));
    75487553    }
    7549     else if (   idxRegPref >= RT_ELEMENTS(pReNative->Core.aHstRegs)
     7554    else if (   !a_fWithRegPref
    75507555             || (pReNative->Core.bmHstRegs & RT_BIT_32(idxRegPref)))
    75517556    {
     
    75927597    if (idxStackSlot < IEMNATIVE_FRAME_VAR_SLOTS)
    75937598    {
    7594         Assert(fInitialized);
     7599        Assert(a_fInitialized);
    75957600        int32_t const offDispBp = iemNativeStackCalcBpDisp(idxStackSlot);
    75967601        switch (pVar->cbVar)
     
    76087613        Assert(idxStackSlot == UINT8_MAX);
    76097614        if (pVar->enmKind != kIemNativeVarKind_Immediate)
    7610             AssertStmt(!fInitialized, IEMNATIVE_DO_LONGJMP(pReNative, VERR_IEM_VAR_NOT_INITIALIZED));
     7615            AssertStmt(!a_fInitialized, IEMNATIVE_DO_LONGJMP(pReNative, VERR_IEM_VAR_NOT_INITIALIZED));
    76117616        else
    76127617        {
     
    76167621             * and IEM_MC_ADD_LOCAL_S64_TO_EFF_ADDR in connection with BT, BTS, BTR, and BTC.
    76177622             */
    7618             AssertStmt(fInitialized, IEMNATIVE_DO_LONGJMP(pReNative, VERR_IEM_VAR_NOT_INITIALIZED));
     7623            AssertStmt(a_fInitialized, IEMNATIVE_DO_LONGJMP(pReNative, VERR_IEM_VAR_NOT_INITIALIZED));
    76197624            Log11(("iemNativeVarRegisterAcquire: idxVar=%#x idxReg=%u uValue=%RX64 converting from immediate to stack\n",
    76207625                   idxVar, idxReg, pVar->u.uValue));
     
    76267631    pVar->fRegAcquired = true;
    76277632    return idxReg;
     7633}
     7634
     7635
     7636/** See iemNativeVarRegisterAcquireInt for details. */
     7637DECL_HIDDEN_THROW(uint8_t) iemNativeVarRegisterAcquire(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff)
     7638{
     7639    /* very likely */
     7640    //STAM_REL_COUNTER_INC(&pReNative->pVCpu->iem.s.aStatAdHoc[(pReNative->Core.aVars[IEMNATIVE_VAR_IDX_UNPACK(idxVar)].idxReg < RT_ELEMENTS(pReNative->Core.aHstRegs)) + 0]);
     7641    return iemNativeVarRegisterAcquireInt<false, false>(pReNative, idxVar, poff, UINT8_MAX);
     7642}
     7643
     7644
     7645/** See iemNativeVarRegisterAcquireInt for details. */
     7646DECL_HIDDEN_THROW(uint8_t) iemNativeVarRegisterAcquireInited(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff)
     7647{
     7648    /* even more likely */
     7649    //STAM_REL_COUNTER_INC(&pReNative->pVCpu->iem.s.aStatAdHoc[(pReNative->Core.aVars[IEMNATIVE_VAR_IDX_UNPACK(idxVar)].idxReg < RT_ELEMENTS(pReNative->Core.aHstRegs)) + 2]);
     7650    return iemNativeVarRegisterAcquireInt<true, false>(pReNative, idxVar, poff, UINT8_MAX);
     7651}
     7652
     7653
     7654/** See iemNativeVarRegisterAcquireInt for details. */
     7655DECL_HIDDEN_THROW(uint8_t)
     7656iemNativeVarRegisterAcquireWithPref(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff, uint8_t idxRegPref)
     7657{
     7658    /* unused */
     7659    //STAM_REL_COUNTER_INC(&pReNative->pVCpu->iem.s.aStatAdHoc[(pReNative->Core.aVars[IEMNATIVE_VAR_IDX_UNPACK(idxVar)].idxReg < RT_ELEMENTS(pReNative->Core.aHstRegs)) + 4]);
     7660    return iemNativeVarRegisterAcquireInt<false, true>(pReNative, idxVar, poff, idxRegPref);
     7661}
     7662
     7663
     7664/** See iemNativeVarRegisterAcquireInt for details. */
     7665DECL_HIDDEN_THROW(uint8_t)
     7666iemNativeVarRegisterAcquireInitedWithPref(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff, uint8_t idxRegPref)
     7667{
     7668    /* very very likely */
     7669    //STAM_REL_COUNTER_INC(&pReNative->pVCpu->iem.s.aStatAdHoc[(pReNative->Core.aVars[IEMNATIVE_VAR_IDX_UNPACK(idxVar)].idxReg < RT_ELEMENTS(pReNative->Core.aHstRegs)) + 6]);
     7670    return iemNativeVarRegisterAcquireInt<true, true>(pReNative, idxVar, poff, idxRegPref);
    76287671}
    76297672
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h

    r106319 r106407  
    611611#endif
    612612    {
    613         uint8_t const         idxRegEfl = iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     613        uint8_t const         idxRegEfl = iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    614614        uint8_t const         idxRegTmp = iemNativeRegAllocTmp(pReNative, &off);
    615615#ifdef RT_ARCH_AMD64
     
    683683
    684684        uint8_t const idxRegEfl = idxRegEflIn != UINT8_MAX ? idxRegEflIn
    685                                 : iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     685                                : iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    686686        uint8_t const idxTmpReg = iemNativeRegAllocTmp(pReNative, &off);
    687687        pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 2 + 7 + 7 + 3);
     
    705705         */
    706706        uint8_t const         idxRegEfl  = idxRegEflIn != UINT8_MAX ? idxRegEflIn
    707                                          : iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     707                                         : iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    708708        uint8_t const         idxTmpReg  = iemNativeRegAllocTmp(pReNative, &off);
    709709        uint8_t const         idxTmpReg2 = cOpBits >= 32 ? UINT8_MAX : iemNativeRegAllocTmp(pReNative, &off);
     
    855855iemNativeEmit_and_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    856856{
    857     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    858     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     857    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     858    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    859859#ifdef RT_ARCH_AMD64
    860860    /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */
     
    889889iemNativeEmit_and_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    890890{
    891     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     891    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    892892#ifdef RT_ARCH_AMD64
    893893    /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */
     
    942942iemNativeEmit_test_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    943943{
    944     uint8_t const         idxRegDst    = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     944    uint8_t const         idxRegDst    = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    945945    uint8_t const         idxRegSrc    = idxVarSrc == idxVarDst ? idxRegDst /* special case of 'test samereg,samereg' */
    946                                        : iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     946                                       : iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    947947#ifdef RT_ARCH_AMD64
    948948    /* On AMD64 we just use the correctly sized TEST instruction harvest the EFLAGS. */
     
    989989iemNativeEmit_test_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    990990{
    991     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     991    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    992992#ifdef RT_ARCH_AMD64
    993993    /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */
     
    10471047iemNativeEmit_or_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    10481048{
    1049     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1050     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     1049    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1050    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    10511051#ifdef RT_ARCH_AMD64
    10521052    /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */
     
    10821082iemNativeEmit_or_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    10831083{
    1084     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     1084    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    10851085#ifdef RT_ARCH_AMD64
    10861086    /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */
     
    11291129iemNativeEmit_xor_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    11301130{
    1131     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1132     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     1131    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1132    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    11331133#ifdef RT_ARCH_AMD64
    11341134    /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */
     
    11641164iemNativeEmit_xor_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    11651165{
    1166     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     1166    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    11671167#ifdef RT_ARCH_AMD64
    11681168    /* On AMD64 we just use the correctly sized XOR instruction harvest the EFLAGS. */
     
    12151215iemNativeEmit_add_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    12161216{
    1217     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1218     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     1217    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1218    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    12191219
    12201220#ifdef RT_ARCH_AMD64
     
    12731273iemNativeEmit_add_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    12741274{
    1275     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     1275    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    12761276
    12771277#ifdef RT_ARCH_AMD64
     
    13411341iemNativeEmit_adc_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    13421342{
    1343     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1344     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
    1345     uint8_t const idxRegEfl = iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     1343    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1344    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
     1345    uint8_t const idxRegEfl = iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    13461346
    13471347#ifdef RT_ARCH_AMD64
     
    14061406iemNativeEmit_adc_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    14071407{
    1408     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1409     uint8_t const idxRegEfl = iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     1408    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1409    uint8_t const idxRegEfl = iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    14101410
    14111411#ifdef RT_ARCH_AMD64
     
    14701470iemNativeEmit_sub_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    14711471{
    1472     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1473     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     1472    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1473    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    14741474
    14751475#ifdef RT_ARCH_AMD64
     
    15281528iemNativeEmit_sub_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    15291529{
    1530     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     1530    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    15311531
    15321532#ifdef RT_ARCH_AMD64
     
    15981598iemNativeEmit_cmp_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    15991599{
    1600     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1601     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
     1600    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1601    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
    16021602
    16031603#ifdef RT_ARCH_AMD64
     
    16521652iemNativeEmit_cmp_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    16531653{
    1654     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     1654    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
    16551655
    16561656#ifdef RT_ARCH_AMD64
     
    17201720iemNativeEmit_sbb_r_r_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint8_t idxVarSrc, uint8_t idxVarEfl)
    17211721{
    1722     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1723     uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
    1724     uint8_t const idxRegEfl = iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     1722    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1723    uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off);
     1724    uint8_t const idxRegEfl = iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    17251725
    17261726#ifdef RT_ARCH_AMD64
     
    17861786iemNativeEmit_sbb_r_i_efl(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl)
    17871787{
    1788     uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    1789     uint8_t const idxRegEfl = iemNativeVarRegisterAcquire(pReNative, idxVarEfl, &off, true /*fInitialized*/);
     1788    uint8_t const idxRegDst = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     1789    uint8_t const idxRegEfl = iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    17901790
    17911791#ifdef RT_ARCH_AMD64
     
    21062106             register state if the branch is taken. */
    21072107    uint8_t const idxRegTmp   = iemNativeRegAllocTmp(pReNative, &off); /* Do this first in hope we'll get EAX. */
    2108     uint8_t const idxRegCount = iemNativeVarRegisterAcquire(pReNative, idxVarCount, &off, true /*fInitialized*/); /* modified on arm64 */
    2109     uint8_t const idxRegDst   = iemNativeVarRegisterAcquire(pReNative, idxVarDst,   &off, true /*fInitialized*/);
    2110     uint8_t const idxRegEfl   = iemNativeVarRegisterAcquire(pReNative, idxVarEfl,   &off, true /*fInitialized*/);
     2108    uint8_t const idxRegCount = iemNativeVarRegisterAcquireInited(pReNative, idxVarCount, &off); /* modified on arm64 */
     2109    uint8_t const idxRegDst   = iemNativeVarRegisterAcquireInited(pReNative, idxVarDst, &off);
     2110    uint8_t const idxRegEfl   = iemNativeVarRegisterAcquireInited(pReNative, idxVarEfl, &off);
    21112111
    21122112#ifdef RT_ARCH_AMD64
     
    28612861        uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegDst), \
    28622862                                                                              kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForFullWrite); \
    2863         uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/); \
     2863        uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off); \
    28642864        PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 7 + 6); \
    28652865        pCodeBuf[off++] = X86_OP_PRF_SIZE_OP; /* Transfer value from GPR to temporary vector register using pinsrq. */ \
     
    29202920        uint8_t const idxSimdRegDst = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(idxSimdGstRegDst), \
    29212921                                                                              kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ForFullWrite); \
    2922         uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/); \
     2922        uint8_t const idxRegSrc = iemNativeVarRegisterAcquireInited(pReNative, idxVarSrc, &off); \
    29232923        PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 2); \
    29242924        pCodeBuf[off++] = Armv8A64MkVecInstrIns(IEMNATIVE_SIMD_REG_FIXED_TMP0, idxRegSrc, 0 /*idxElem*/); /* Transfer value from GPR to temporary vector register. */ \
  • trunk/src/VBox/VMM/VMMR3/IEMR3.cpp

    r106297 r106407  
    10621062                            STAMUNIT_COUNT, NULL, "/IEM/CPU%u/ThrdFuncs/%s", idCpu, g_apszIemThreadedFunctionStats[i]);
    10631063# endif
     1064
     1065
     1066        for (unsigned i = 1; i < RT_ELEMENTS(pVCpu->iem.s.aStatAdHoc); i++)
     1067            STAMR3RegisterF(pVM, &pVCpu->iem.s.aStatAdHoc[i], STAMTYPE_COUNTER, STAMVISIBILITY_USED,
     1068                            STAMUNIT_COUNT, NULL, "/IEM/CPU%u/AdHoc/%02u", idCpu, i);
    10641069
    10651070#endif /* !defined(VBOX_VMM_TARGET_ARMV8) && defined(VBOX_WITH_NESTED_HWVIRT_VMX) - quick fix for stupid structure duplication non-sense */
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r106401 r106407  
    23432343                                                           IEMNATIVEGSTREGREF enmRegClass, uint8_t idxReg);
    23442344DECL_HIDDEN_THROW(uint8_t)  iemNativeVarGetStackSlot(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar);
    2345 DECL_HIDDEN_THROW(uint8_t)  iemNativeVarRegisterAcquire(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff,
    2346                                                         bool fInitialized = false, uint8_t idxRegPref = UINT8_MAX);
     2345DECL_HIDDEN_THROW(uint8_t)  iemNativeVarRegisterAcquire(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff);
     2346DECL_HIDDEN_THROW(uint8_t)  iemNativeVarRegisterAcquireWithPref(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff, uint8_t idxRegPref);
     2347DECL_HIDDEN_THROW(uint8_t)  iemNativeVarRegisterAcquireInited(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff);
     2348DECL_HIDDEN_THROW(uint8_t)  iemNativeVarRegisterAcquireInitedWithPref(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff, uint8_t idxRegPref);
    23472349#ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR
    23482350DECL_HIDDEN_THROW(uint8_t)  iemNativeVarSimdRegisterAcquire(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar, uint32_t *poff,
  • trunk/src/VBox/VMM/include/IEMN8veRecompilerTlbLookup.h

    r106286 r106407  
    120120                             != kIemNativeVarKind_Immediate
    121121                          && !fSkip
    122                           ? iemNativeVarRegisterAcquire(a_pReNative, a_idxVarGCPtrMem, a_poff,
    123                                                         true /*fInitialized*/, IEMNATIVE_CALL_ARG2_GREG)
     122                          ? iemNativeVarRegisterAcquireInitedWithPref(a_pReNative, a_idxVarGCPtrMem, a_poff,
     123                                                                      IEMNATIVE_CALL_ARG2_GREG)
    124124                          : idxRegPtrHlp)
    125125        ,   idxRegSegBase(a_iSegReg == UINT8_MAX || fSkip
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