VirtualBox

Changeset 62015 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Jul 4, 2016 7:58:28 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
108473
Message:

IEM: Switched from using IEMCPU directly to using with via VMCPU. This saves 4-5 KB in 64-bit mode (~1.2%), but the 32-bit code is larger (suspecting because we lost a few some 8-bit displacements).

File:
1 edited

Legend:

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

    r62010 r62015  
    264264        mov     r8d, ACCESS_FLAGS
    265265        mov     rdx, [VA]
    266         mov     rcx, [pIemCpu]
     266        mov     rcx, [pVCpu]
    267267        call    iemTlbTypeMiss
    268268    .Done:
     
    648648/** Gets the current IEMTARGETCPU value.
    649649 * @returns IEMTARGETCPU value.
    650  * @param   a_pIemCpu       The IEM per CPU instance data.
     650 * @param   a_pVCpu         The IEM per CPU instance data.
    651651 */
    652652#if IEM_CFG_TARGET_CPU != IEMTARGETCPU_DYNAMIC
    653 # define IEM_GET_TARGET_CPU(a_pIemCpu)   (IEM_CFG_TARGET_CPU)
     653# define IEM_GET_TARGET_CPU(a_pVCpu)   (IEM_CFG_TARGET_CPU)
    654654#else
    655 # define IEM_GET_TARGET_CPU(a_pIemCpu)   ((a_pIemCpu)->uTargetCpu)
     655# define IEM_GET_TARGET_CPU(a_pVCpu)   ((a_pVCpu)->iem.s.uTargetCpu)
    656656#endif
    657657
     
    785785 * of an if statement.  */
    786786#ifdef IEM_VERIFICATION_MODE_FULL
    787 # define IEM_VERIFICATION_ENABLED(a_pIemCpu)    (!(a_pIemCpu)->fNoRem)
     787# define IEM_VERIFICATION_ENABLED(a_pVCpu)      (!(a_pVCpu)->iem.s.fNoRem)
    788788#elif defined(IEM_VERIFICATION_MODE_MINIMAL)
    789 # define IEM_VERIFICATION_ENABLED(a_pIemCpu)    (true)
     789# define IEM_VERIFICATION_ENABLED(a_pVCpu)      (true)
    790790#else
    791 # define IEM_VERIFICATION_ENABLED(a_pIemCpu)    (false)
     791# define IEM_VERIFICATION_ENABLED(a_pVCpu)      (false)
    792792#endif
    793793
     
    799799 * of an if statement.  */
    800800#ifdef IEM_VERIFICATION_MODE_FULL
    801 # define IEM_FULL_VERIFICATION_ENABLED(a_pIemCpu) (!(a_pIemCpu)->fNoRem)
     801# define IEM_FULL_VERIFICATION_ENABLED(a_pVCpu) (!(a_pVCpu)->iem.s.fNoRem)
    802802#else
    803 # define IEM_FULL_VERIFICATION_ENABLED(a_pIemCpu) (false)
     803# define IEM_FULL_VERIFICATION_ENABLED(a_pVCpu) (false)
    804804#endif
    805805
     
    812812#ifdef IEM_VERIFICATION_MODE_FULL
    813813# ifdef IEM_VERIFICATION_MODE_FULL_HM
    814 #  define IEM_FULL_VERIFICATION_REM_ENABLED(a_pIemCpu) (!(a_pIemCpu)->fNoRem && !HMIsEnabled(IEMCPU_TO_VM(a_pIemCpu)))
     814#  define IEM_FULL_VERIFICATION_REM_ENABLED(a_pVCpu)    (!(a_pVCpu)->iem.s.fNoRem && !HMIsEnabled((a_pVCpu)->CTX_SUFF(pVM)))
    815815# else
    816 #  define IEM_FULL_VERIFICATION_REM_ENABLED(a_pIemCpu) (!(a_pIemCpu)->fNoRem)
     816#  define IEM_FULL_VERIFICATION_REM_ENABLED(a_pVCpu)    (!(a_pVCpu)->iem.s.fNoRem)
    817817# endif
    818818#else
    819 # define IEM_FULL_VERIFICATION_REM_ENABLED(a_pIemCpu) (false)
     819# define IEM_FULL_VERIFICATION_REM_ENABLED(a_pVCpu)    (false)
    820820#endif
    821821
     
    836836 */
    837837#ifdef IEM_VERIFICATION_MODE_FULL
    838 # define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { pIemCpu->fUndefinedEFlags |= (a_fEfl); } while (0)
     838# define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { pVCpu->iem.s.fUndefinedEFlags |= (a_fEfl); } while (0)
    839839#else
    840840# define IEMOP_VERIFICATION_UNDEFINED_EFLAGS(a_fEfl) do { } while (0)
     
    15441544 */
    15451545# define IEM_CIMPL_DECL_TYPE_0(a_Name) \
    1546     IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr))
     1546    IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr))
    15471547/**
    15481548 * For defining a C instruction implementation function taking no extra
     
    15521552 */
    15531553# define IEM_CIMPL_DEF_0(a_Name) \
    1554     IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr))
     1554    IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr))
    15551555/**
    15561556 * For calling a C instruction implementation function taking no extra
     
    15621562 * @param   a_fn                The name of the function.
    15631563 */
    1564 # define IEM_CIMPL_CALL_0(a_fn)            a_fn(pIemCpu, cbInstr)
     1564# define IEM_CIMPL_CALL_0(a_fn)            a_fn(pVCpu, cbInstr)
    15651565
    15661566/**
     
    15731573 */
    15741574# define IEM_CIMPL_DECL_TYPE_1(a_Name, a_Type0, a_Arg0) \
    1575     IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0))
     1575    IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0))
    15761576/**
    15771577 * For defining a C instruction implementation function taking one extra
     
    15831583 */
    15841584# define IEM_CIMPL_DEF_1(a_Name, a_Type0, a_Arg0) \
    1585     IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0))
     1585    IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0))
    15861586/**
    15871587 * For calling a C instruction implementation function taking one extra
     
    15941594 * @param   a0                  The name of the 1st argument.
    15951595 */
    1596 # define IEM_CIMPL_CALL_1(a_fn, a0)        a_fn(pIemCpu, cbInstr, (a0))
     1596# define IEM_CIMPL_CALL_1(a_fn, a0)        a_fn(pVCpu, cbInstr, (a0))
    15971597
    15981598/**
     
    16071607 */
    16081608# define IEM_CIMPL_DECL_TYPE_2(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1) \
    1609     IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1))
     1609    IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1))
    16101610/**
    16111611 * For defining a C instruction implementation function taking two extra
     
    16191619 */
    16201620# define IEM_CIMPL_DEF_2(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1) \
    1621     IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1))
     1621    IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1))
    16221622/**
    16231623 * For calling a C instruction implementation function taking two extra
     
    16311631 * @param   a1                  The name of the 2nd argument.
    16321632 */
    1633 # define IEM_CIMPL_CALL_2(a_fn, a0, a1)    a_fn(pIemCpu, cbInstr, (a0), (a1))
     1633# define IEM_CIMPL_CALL_2(a_fn, a0, a1)    a_fn(pVCpu, cbInstr, (a0), (a1))
    16341634
    16351635/**
     
    16461646 */
    16471647# define IEM_CIMPL_DECL_TYPE_3(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2) \
    1648     IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2))
     1648    IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2))
    16491649/**
    16501650 * For defining a C instruction implementation function taking three extra
     
    16601660 */
    16611661# define IEM_CIMPL_DEF_3(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2) \
    1662     IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2))
     1662    IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2))
    16631663/**
    16641664 * For calling a C instruction implementation function taking three extra
     
    16731673 * @param   a2                  The name of the 3rd argument.
    16741674 */
    1675 # define IEM_CIMPL_CALL_3(a_fn, a0, a1, a2) a_fn(pIemCpu, cbInstr, (a0), (a1), (a2))
     1675# define IEM_CIMPL_CALL_3(a_fn, a0, a1, a2) a_fn(pVCpu, cbInstr, (a0), (a1), (a2))
    16761676
    16771677
     
    16911691 */
    16921692# define IEM_CIMPL_DECL_TYPE_4(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3) \
    1693     IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, a_Type3 a_Arg3))
     1693    IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, a_Type3 a_Arg3))
    16941694/**
    16951695 * For defining a C instruction implementation function taking four extra
     
    17071707 */
    17081708# define IEM_CIMPL_DEF_4(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3) \
    1709     IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, \
     1709    IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, a_Type0 a_Arg0, a_Type1 a_Arg1, \
    17101710                                             a_Type2 a_Arg2, a_Type3 a_Arg3))
    17111711/**
     
    17221722 * @param   a3                  The name of the 4th argument.
    17231723 */
    1724 # define IEM_CIMPL_CALL_4(a_fn, a0, a1, a2, a3) a_fn(pIemCpu, cbInstr, (a0), (a1), (a2), (a3))
     1724# define IEM_CIMPL_CALL_4(a_fn, a0, a1, a2, a3) a_fn(pVCpu, cbInstr, (a0), (a1), (a2), (a3))
    17251725
    17261726
     
    17421742 */
    17431743# define IEM_CIMPL_DECL_TYPE_5(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3, a_Type4, a_Arg4) \
    1744     IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, \
     1744    IEM_DECL_IMPL_TYPE(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, \
    17451745                                               a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, \
    17461746                                               a_Type3 a_Arg3, a_Type4 a_Arg4))
     
    17621762 */
    17631763# define IEM_CIMPL_DEF_5(a_Name, a_Type0, a_Arg0, a_Type1, a_Arg1, a_Type2, a_Arg2, a_Type3, a_Arg3, a_Type4, a_Arg4) \
    1764     IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PIEMCPU pIemCpu, uint8_t cbInstr, \
     1764    IEM_DECL_IMPL_DEF(VBOXSTRICTRC, a_Name, (PVMCPU pVCpu, uint8_t cbInstr, \
    17651765                                             a_Type0 a_Arg0, a_Type1 a_Arg1, a_Type2 a_Arg2, \
    17661766                                             a_Type3 a_Arg3, a_Type4 a_Arg4))
     
    17791779 * @param   a4                  The name of the 5th argument.
    17801780 */
    1781 # define IEM_CIMPL_CALL_5(a_fn, a0, a1, a2, a3, a4) a_fn(pIemCpu, cbInstr, (a0), (a1), (a2), (a3), (a4))
     1781# define IEM_CIMPL_CALL_5(a_fn, a0, a1, a2, a3, a4) a_fn(pVCpu, cbInstr, (a0), (a1), (a2), (a3), (a4))
    17821782
    17831783/** @}  */
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette