VirtualBox

Changeset 106198 in vbox


Ignore:
Timestamp:
Oct 1, 2024 10:22:31 PM (4 months ago)
Author:
vboxsync
Message:

VMM/IEM: Some minor refactoring of iemNativeEmitEFlagsForLogical. bugref:10720

File:
1 edited

Legend:

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

    r106197 r106198  
    559559 * It takes liveness stuff into account.
    560560 */
    561 /** @todo make fNativeFlags a template argument. */
     561template<bool a_fNeedToSetFlags>
    562562DECL_INLINE_THROW(uint32_t)
    563563iemNativeEmitEFlagsForLogical(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxVarEfl,
    564                               uint8_t cOpBits, uint8_t idxRegResult
    565 #ifndef RT_ARCH_AMD64
    566                               , bool fNativeFlags = false
    567 #endif
    568                               )
     564                              uint8_t cOpBits, uint8_t idxRegResult)
    569565{
    570566    STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeEflTotalLogical);
     
    624620# error "port me"
    625621#endif
    626 #ifndef RT_ARCH_AMD64
    627         if (!fNativeFlags)
    628             off = iemNativeEmitPostponedEFlagsCalcLogical<true>(pCodeBuf, off, cOpBits, idxRegResult, idxRegEfl, idxRegTmp);
    629         else
    630 #endif
    631             off = iemNativeEmitPostponedEFlagsCalcLogical<false>(pCodeBuf, off, cOpBits, idxRegResult, idxRegEfl, idxRegTmp);
     622        off = iemNativeEmitPostponedEFlagsCalcLogical<a_fNeedToSetFlags>(pCodeBuf, off, cOpBits, idxRegResult,
     623                                                                         idxRegEfl, idxRegTmp);
    632624        IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    633625
     
    872864    iemNativeVarRegisterRelease(pReNative, idxVarSrc);
    873865
    874     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     866    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    875867
    876868#elif defined(RT_ARCH_ARM64)
     
    881873    iemNativeVarRegisterRelease(pReNative, idxVarSrc);
    882874
    883     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst, true /*fNativeFlags*/);
     875    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst, true /*fNativeFlags*/);
    884876#else
    885877# error "Port me"
     
    904896    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    905897
    906     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     898    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    907899
    908900#elif defined(RT_ARCH_ARM64)
     
    932924    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    933925
    934     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst, cOpBits >= 32 /*fNativeFlags*/);
     926    if (cOpBits >= 32)
     927        off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     928    else
     929        off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    935930    RT_NOREF_PV(cImmBits);
    936931
     
    979974
    980975#ifdef RT_ARCH_AMD64
    981     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, UINT8_MAX);
    982 #else
    983     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegResult, cOpBits >= 32 /*fNativeFlags*/);
     976    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, UINT8_MAX);
     977#else
     978    if (cOpBits >= 32)
     979        off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegResult);
     980    else
     981        off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegResult);
    984982    iemNativeRegFreeTmp(pReNative, idxRegResult);
    985983#endif
     
    10031001    iemNativeVarRegisterRelease(pReNative, idxVarDst);
    10041002
    1005     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, UINT8_MAX);
     1003    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, UINT8_MAX);
    10061004
    10071005#elif defined(RT_ARCH_ARM64)
     
    10341032    iemNativeVarRegisterRelease(pReNative, idxVarDst);
    10351033
    1036     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegResult, cOpBits >= 32 /*fNativeFlags*/);
     1034    if (cOpBits >= 32)
     1035        off = iemNativeEmitEFlagsForLogical<>(pReNative, off, idxVarEfl, cOpBits, idxRegResult);
     1036    else
     1037        off = iemNativeEmitEFlagsForLogical<>(pReNative, off, idxVarEfl, cOpBits, idxRegResult);
    10371038
    10381039    iemNativeRegFreeTmp(pReNative, idxRegResult);
     
    10631064    iemNativeVarRegisterRelease(pReNative, idxVarSrc);
    10641065
    1065     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1066    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    10661067
    10671068#elif defined(RT_ARCH_ARM64)
     
    10721073    iemNativeVarRegisterRelease(pReNative, idxVarSrc);
    10731074
    1074     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1075    off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    10751076
    10761077#else
     
    10961097    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    10971098
    1098     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1099    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    10991100
    11001101#elif defined(RT_ARCH_ARM64)
     
    11181119    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    11191120
    1120     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1121    off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    11211122    RT_NOREF_PV(cImmBits);
    11221123
     
    11461147    iemNativeVarRegisterRelease(pReNative, idxVarSrc);
    11471148
    1148     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1149    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    11491150
    11501151#elif defined(RT_ARCH_ARM64)
     
    11551156    iemNativeVarRegisterRelease(pReNative, idxVarSrc);
    11561157
    1157     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1158    off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    11581159
    11591160#else
     
    11791180    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    11801181
    1181     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1182    off = iemNativeEmitEFlagsForLogical<false>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    11821183
    11831184#elif defined(RT_ARCH_ARM64)
     
    12011202    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
    12021203
    1203     off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     1204    off = iemNativeEmitEFlagsForLogical<true>(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
    12041205    RT_NOREF_PV(cImmBits);
    12051206
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