VirtualBox

Ignore:
Timestamp:
Mar 13, 2024 2:01:20 PM (11 months ago)
Author:
vboxsync
Message:

VMM/IEM: Implemented simple (whole sale) status flag up update skipping for arithmetic operations with native emitter. bugref:10375

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h

    r103801 r103828  
    207207                              )
    208208{
    209 #ifdef IEMNATIVE_WITH_LIVENESS_ANALYSIS
    210     if (1) /** @todo check if all bits are clobbered. */
     209#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
     210    /** @todo */
    211211#endif
    212212    {
     
    276276#endif
    277277        IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     278
     279#  ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
     280        off = iemNativeEmitStoreImmToVCpuU32(pReNative, off, 0, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
     281#  endif
    278282    }
    279283    return off;
     
    294298                                 )
    295299{
    296 #ifdef IEMNATIVE_WITH_LIVENESS_ANALYSIS
    297     if (1) /** @todo check if all bits are clobbered. */
    298 #endif
    299     {
     300#ifdef IEMNATIVE_WITH_EFLAGS_SKIPPING
     301    /*
     302     * See if we can skip this wholesale.
     303     */
     304    PCIEMLIVENESSENTRY const pLivenessEntry = &pReNative->paLivenessEntries[pReNative->idxCurCall];
     305    if (IEMLIVENESS_STATE_ARE_STATUS_EFL_TO_BE_CLOBBERED(pLivenessEntry))
     306    {
     307        STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflArithmeticSkipped);
     308# ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
     309        off = iemNativeEmitOrImmIntoVCpuU32(pReNative, off, X86_EFL_STATUS_BITS, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
     310# endif
     311    }
     312    else
     313#endif
     314    {
     315#ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
     316        uint32_t fSkipped = 0;
     317#endif
    300318#ifdef RT_ARCH_AMD64
    301319        /*
     
    446464            iemNativeVarRegisterRelease(pReNative, idxVarEfl);
    447465        iemNativeRegFreeTmp(pReNative, idxTmpReg);
     466
    448467#else
    449468# error "port me"
    450469#endif
    451470        IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     471
     472#ifdef IEMNATIVE_STRICT_EFLAGS_SKIPPING
     473        off = iemNativeEmitStoreImmToVCpuU32(pReNative, off, fSkipped, RT_UOFFSETOF(VMCPU, iem.s.fSkippingEFlags));
     474#endif
    452475    }
    453476    return off;
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