VirtualBox

Changeset 105998 in vbox for trunk


Ignore:
Timestamp:
Sep 10, 2024 9:19:30 AM (3 months ago)
Author:
vboxsync
Message:

VMM/IEM: s/ReturnZero/ReturnSuccess/ and simplifying related code. (todo 16) bugref:10720

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

Legend:

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

    r105997 r105998  
    20962096    pReNative->Core.u64ArgVars             = UINT64_MAX;
    20972097
     2098    AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 23);
    20982099    pReNative->aidxUniqueLabels[0]         = UINT32_MAX;
    20992100    pReNative->aidxUniqueLabels[1]         = UINT32_MAX;
     
    21192120    pReNative->aidxUniqueLabels[21]        = UINT32_MAX;
    21202121    pReNative->aidxUniqueLabels[22]        = UINT32_MAX;
    2121 #ifdef IEMNATIVE_WITH_RECOMPILER_PER_CHUNK_TAIL_CODE
    2122     pReNative->aidxUniqueLabels[23]        = UINT32_MAX;
    2123     AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 24);
    2124 #else
    2125     AssertCompile(RT_ELEMENTS(pReNative->aidxUniqueLabels) == 23);
    2126 #endif
    21272122
    21282123    pReNative->idxLastCheckIrqCallNo       = UINT32_MAX;
     
    89538948        STR_CASE_CMN(NeedCsLimChecking);
    89548949        STR_CASE_CMN(CheckBranchMiss);
     8950#ifdef IEMNATIVE_WITH_RECOMPILER_PER_CHUNK_TAIL_CODE
     8951        STR_CASE_CMN(ReturnSuccess);
     8952#else
    89558953        STR_CASE_CMN(Return);
    8956 #ifdef IEMNATIVE_WITH_RECOMPILER_PER_CHUNK_TAIL_CODE
    8957         STR_CASE_CMN(ReturnZero);
    89588954#endif
    89598955        STR_CASE_CMN(ReturnBreak);
     
    97929788         * Emit the epilog code.
    97939789         */
    9794         aoffLabels[kIemNativeLabelType_ReturnZero] = off;
     9790        aoffLabels[kIemNativeLabelType_ReturnSuccess] = off;
    97959791        off = iemNativeEmitGprZero(pReNative, off, IEMNATIVE_CALL_RET_GREG);
    9796 
    9797         aoffLabels[kIemNativeLabelType_Return] = off;
     9792        uint32_t const offReturnWithStatus = off;
    97989793        off = iemNativeEmitCoreEpilog(pReNative, off);
    97999794
     
    98839878            off = iemNativeEmitCallImm(pReNative, off, (uintptr_t)s_aSimpleTailLabels[i].pfnCallback);
    98849879
    9885             /* jump back to the return sequence / generate a return sequence. */
    9886             if (!s_aSimpleTailLabels[i].fWithEpilog)
    9887                 off = iemNativeEmitJmpToFixed(pReNative, off, aoffLabels[kIemNativeLabelType_Return]);
     9880            /* If the callback is supposed to return with a status code we inline the epilog
     9881               sequence for better speed.  Otherwise, if the callback shouldn't return because
     9882               it throws/longjmps, we just jump to the return sequence to be on the safe side.  */
     9883            if (s_aSimpleTailLabels[i].fWithEpilog)
     9884                off = iemNativeEmitCoreEpilog(pReNative, off);
    98889885            else
    9889                 off = iemNativeEmitCoreEpilog(pReNative, off);
     9886            {
     9887# ifdef VBOX_STRICT
     9888                off = iemNativeEmitBrk(pReNative, off, 0x2201);
     9889# endif
     9890                off = iemNativeEmitJmpToFixed(pReNative, off, offReturnWithStatus);
     9891            }
    98909892        }
    98919893
     
    98949896        /* Make sure we've generate code for all labels. */
    98959897        for (uint32_t i = kIemNativeLabelType_Invalid + 1; i < RT_ELEMENTS(aoffLabels); i++)
    9896             Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_ReturnZero);
     9898            Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_ReturnSuccess);
    98979899# endif
    98989900    }
     
    99339935    for (uint32_t i = kIemNativeLabelType_Invalid + 1; i < RT_ELEMENTS(pCtx->apExitLabels); i++)
    99349936    {
    9935         Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_ReturnZero);
     9937        Assert(aoffLabels[i] != 0 || i == kIemNativeLabelType_ReturnSuccess);
    99369938        pCtx->apExitLabels[i] = &paFinalCommonCodeRx[aoffLabels[i]];
    99379939        Log10(("    apExitLabels[%u]=%p %s\n", i, pCtx->apExitLabels[i], iemNativeGetLabelName((IEMNATIVELABELTYPE)i, true)));
     
    1020710209         */
    1020810210        //off = iemNativeEmitBrk(pReNative, off, 0x1227);
    10209         off = iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnZero);
     10211        off = iemNativeEmitTbExit(pReNative, off, kIemNativeLabelType_ReturnSuccess);
    1021010212#endif
    1021110213
     
    1029810300         */
    1029910301# ifndef RT_ARCH_AMD64
    10300         Assert(!(pReNative->bmLabelTypes & (RT_BIT_64(kIemNativeLabelType_Return) | RT_BIT_64(kIemNativeLabelType_Invalid))));
     10302        Assert(!(pReNative->bmLabelTypes & (  RT_BIT_64(kIemNativeLabelType_ReturnSuccess)
     10303                                            | RT_BIT_64(kIemNativeLabelType_Invalid) )));
    1030110304        AssertCompile(kIemNativeLabelType_Invalid == 0);
    1030210305        uint64_t fTailLabels = pReNative->bmLabelTypes & (RT_BIT_64(kIemNativeLabelType_LastTbExit + 1U) - 2U);
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r105997 r105998  
    502502    kIemNativeLabelType_NonZeroRetOrPassUp,
    503503#ifdef IEMNATIVE_WITH_RECOMPILER_PER_CHUNK_TAIL_CODE
    504     kIemNativeLabelType_ReturnZero,             /**< Sets eax/w0 to zero and returns. */
    505 #endif
     504    kIemNativeLabelType_ReturnSuccess,          /**< Sets eax/w0 to zero and returns. */
     505#else
    506506    kIemNativeLabelType_Return,
     507#endif
    507508    /** The last fixup for branches that can span almost the whole TB length.
    508509     * @note Whether kIemNativeLabelType_Return needs to be one of these is
    509510     *       a bit questionable, since nobody jumps to it except other tail code. */
     511#ifdef IEMNATIVE_WITH_RECOMPILER_PER_CHUNK_TAIL_CODE
     512    kIemNativeLabelType_LastWholeTbBranch = kIemNativeLabelType_ReturnSuccess,
     513#else
    510514    kIemNativeLabelType_LastWholeTbBranch = kIemNativeLabelType_Return,
     515#endif
    511516    /** The last fixup for branches that exits the TB. */
     517#ifdef IEMNATIVE_WITH_RECOMPILER_PER_CHUNK_TAIL_CODE
     518    kIemNativeLabelType_LastTbExit        = kIemNativeLabelType_ReturnSuccess,
     519#else
    512520    kIemNativeLabelType_LastTbExit        = kIemNativeLabelType_Return,
     521#endif
    513522
    514523    /** Loop-jump target. */
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