VirtualBox

Changeset 99354 in vbox


Ignore:
Timestamp:
Apr 8, 2023 12:37:37 AM (20 months ago)
Author:
vboxsync
Message:

VMM/IEM: Mojo improvments for IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT. bugref:10369

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMMc.h

    r99353 r99354  
    127127#define IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT() \
    128128    do { \
    129         if (RT_LIKELY(!(pVCpu->cpum.GstCtx.cr0 & (X86_CR0_EM | X86_CR0_TS)))) \
     129        /* Since the two CR0 bits doesn't overlap with FSW.ES, this can be reduced to a
     130           single compare branch in the more probable code path. */ \
     131        if (RT_LIKELY(!(  (pVCpu->cpum.GstCtx.cr0 & (X86_CR0_EM | X86_CR0_TS)) \
     132                        | (pVCpu->cpum.GstCtx.XState.x87.FSW & X86_FSW_ES)))) \
    130133        { /* probable */ } \
    131134        else if (pVCpu->cpum.GstCtx.cr0 & X86_CR0_EM) \
    132135            return iemRaiseUndefinedOpcode(pVCpu); \
     136        else if (pVCpu->cpum.GstCtx.cr0 & X86_CR0_TS) \
     137            return iemRaiseDeviceNotAvailable(pVCpu); \
    133138        else \
    134             return iemRaiseDeviceNotAvailable(pVCpu); \
    135         \
    136         if (!(pVCpu->cpum.GstCtx.XState.x87.FSW & X86_FSW_ES)) { /* probable */ } \
    137         else return iemRaiseMathFault(pVCpu); \
    138     } while (0)
     139            return iemRaiseMathFault(pVCpu); \
     140    } while (0)
     141AssertCompile(!((X86_CR0_EM | X86_CR0_TS) & X86_FSW_ES));
    139142#define IEM_MC_RAISE_GP0_IF_CPL_NOT_ZERO() \
    140143    do { \
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