VirtualBox

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


Ignore:
Timestamp:
Jul 5, 2022 3:01:42 PM (3 years ago)
Author:
vboxsync
Message:

VMM/IEM: Simplified IEMOPMEDIAF3 and IEMOPMEDIAOPTF3 function table creation, moving most of them into the functions where they are used. Exceptions are 4 tables used by multiple decoder functions. bugref:9898

File:
1 edited

Legend:

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

    r95516 r95517  
    19981998typedef IEMOPMEDIAF3 const *PCIEMOPMEDIAF3;
    19991999
     2000/** @def IEMOPMEDIAF3_INIT_VARS_EX
     2001 * Declares a s_Host (x86 & amd64 only) and a s_Fallback variable with the
     2002 * given functions as initializers.  For use in AVX functions where a pair of
     2003 * functions are only used once and the function table need not be public. */
     2004#ifndef TST_IEM_CHECK_MC
     2005# if (defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && !defined(IEM_WITHOUT_ASSEMBLY)
     2006#  define IEMOPMEDIAF3_INIT_VARS_EX(a_pfnHostU128, a_pfnHostU256, a_pfnFallbackU128, a_pfnFallbackU256) \
     2007    static IEMOPMEDIAF3 const s_Host     = { a_pfnHostU128,     a_pfnHostU256 }; \
     2008    static IEMOPMEDIAF3 const s_Fallback = { a_pfnFallbackU128, a_pfnFallbackU256 }
     2009# else
     2010#  define IEMOPMEDIAF3_INIT_VARS_EX(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) \
     2011    static IEMOPMEDIAF3 const s_Fallback = { a_pfnFallbackU128, a_pfnFallbackU256 }
     2012# endif
     2013#else
     2014# define IEMOPMEDIAF3_INIT_VARS_EX(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) (void)0
     2015#endif
     2016/** @def IEMOPMEDIAF3_INIT_VARS
     2017 * Generate AVX function tables for the @a a_InstrNm instruction.
     2018 * @sa IEMOPMEDIAF3_INIT_VARS_EX */
     2019#define IEMOPMEDIAF3_INIT_VARS(a_InstrNm) \
     2020    IEMOPMEDIAF3_INIT_VARS_EX(RT_CONCAT3(iemAImpl_,a_InstrNm,_u128),           RT_CONCAT3(iemAImpl_,a_InstrNm,_u256),\
     2021                              RT_CONCAT3(iemAImpl_,a_InstrNm,_u128_fallback),  RT_CONCAT3(iemAImpl_,a_InstrNm,_u256_fallback))
     2022
    20002023/**
    20012024 * Function table for media instruction taking two full sized media source
     
    20112034typedef IEMOPMEDIAOPTF3 const *PCIEMOPMEDIAOPTF3;
    20122035
    2013 /** @def IEMOPMEDIAOPTF3_INIT_VARS
     2036/** @def IEMOPMEDIAOPTF3_INIT_VARS_EX
    20142037 * Declares a s_Host (x86 & amd64 only) and a s_Fallback variable with the
    20152038 * given functions as initializers.  For use in AVX functions where a pair of
     
    20172040#ifndef TST_IEM_CHECK_MC
    20182041# if (defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && !defined(IEM_WITHOUT_ASSEMBLY)
    2019 #  define IEMOPMEDIAOPTF3_INIT_VARS(a_pfnHostU128, a_pfnHostU256, a_pfnFallbackU128, a_pfnFallbackU256) \
     2042#  define IEMOPMEDIAOPTF3_INIT_VARS_EX(a_pfnHostU128, a_pfnHostU256, a_pfnFallbackU128, a_pfnFallbackU256) \
    20202043    static IEMOPMEDIAOPTF3 const s_Host     = { a_pfnHostU128,     a_pfnHostU256 }; \
    20212044    static IEMOPMEDIAOPTF3 const s_Fallback = { a_pfnFallbackU128, a_pfnFallbackU256 }
    20222045# else
    2023 #  define IEMOPMEDIAOPTF3_INIT_VARS(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) \
     2046#  define IEMOPMEDIAOPTF3_INIT_VARS_EX(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) \
    20242047    static IEMOPMEDIAOPTF3 const s_Fallback = { a_pfnFallbackU128, a_pfnFallbackU256 }
    20252048# endif
    20262049#else
    2027 # define IEMOPMEDIAOPTF3_INIT_VARS(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) (void)0
    2028 #endif
     2050# define IEMOPMEDIAOPTF3_INIT_VARS_EX(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) (void)0
     2051#endif
     2052/** @def IEMOPMEDIAOPTF3_INIT_VARS
     2053 * Generate AVX function tables for the @a a_InstrNm instruction.
     2054 * @sa IEMOPMEDIAOPTF3_INIT_VARS_EX */
     2055#define IEMOPMEDIAOPTF3_INIT_VARS(a_InstrNm) \
     2056    IEMOPMEDIAOPTF3_INIT_VARS_EX(RT_CONCAT3(iemAImpl_,a_InstrNm,_u128),           RT_CONCAT3(iemAImpl_,a_InstrNm,_u256),\
     2057                                 RT_CONCAT3(iemAImpl_,a_InstrNm,_u128_fallback),  RT_CONCAT3(iemAImpl_,a_InstrNm,_u256_fallback))
    20292058
    20302059
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