VirtualBox

Changeset 61899 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 27, 2016 2:22:17 PM (9 years ago)
Author:
vboxsync
Message:

iemRegAddToRipAndClearRF: Tried to optimize the 32-bit code version a little bit too.

File:
1 edited

Legend:

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

    r61898 r61899  
    52885288    PCPUMCTX pCtx = pIemCpu->CTX_SUFF(pCtx);
    52895289
     5290    pCtx->eflags.Bits.u1RF = 0;
     5291
     5292    AssertCompile(IEMMODE_16BIT == 0 && IEMMODE_32BIT == 1 && IEMMODE_64BIT == 2);
    52905293#if ARCH_BITS >= 64
    5291     AssertCompile(IEMMODE_16BIT == 0 && IEMMODE_32BIT == 1 && IEMMODE_64BIT == 2);
    52925294    static uint64_t const s_aRipMasks[] = { UINT64_C(0xffff), UINT64_C(0xffffffff), UINT64_MAX };
    52935295    Assert(pCtx->rip <= s_aRipMasks[(unsigned)pIemCpu->enmCpuMode]);
    52945296    pCtx->rip = (pCtx->rip + cbInstr) & s_aRipMasks[(unsigned)pIemCpu->enmCpuMode];
    52955297#else
    5296     switch (pIemCpu->enmCpuMode)
    5297     {
    5298         case IEMMODE_16BIT:
    5299             Assert(pCtx->rip <= UINT16_MAX);
    5300             pCtx->ip += cbInstr;
    5301             break;
    5302 
    5303         case IEMMODE_32BIT:
    5304             Assert(pCtx->rip <= UINT32_MAX);
    5305             pCtx->eip += cbInstr;
    5306             break;
    5307 
    5308         case IEMMODE_64BIT:
    5309             pCtx->rip += cbInstr;
    5310             break;
    5311 
    5312         default: AssertFailed();
    5313     }
    5314 #endif
    5315 
    5316     pCtx->eflags.Bits.u1RF = 0;
     5298    if (pIemCpu->enmCpuMode == IEMMODE_64BIT)
     5299        pCtx->rip += cbInstr;
     5300    else
     5301    {
     5302        static uint32_t const s_aEipMasks[] = { UINT32_C(0xffff), UINT32_MAX };
     5303        pCtx->eip = (pCtx->eip + cbInstr) & s_aEipMasks[(unsigned)pIemCpu->enmCpuMode];
     5304    }
     5305#endif
    53175306}
    53185307
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