VirtualBox

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


Ignore:
Timestamp:
Mar 14, 2022 1:32:35 PM (3 years ago)
Author:
vboxsync
Message:

VMM/IEM: Fixes for AMD versions of RCL and SHLD. Another stab at doxygen issues. bugref:9898

File:
1 edited

Legend:

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

    r94224 r94225  
    16651665    EMIT_MUL_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoadF1, a_fnStore, a_fnMul, _amd,       0) \
    16661666
     1667# ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */
    16671668EMIT_MUL(64, 128, (uint64_t *puA, uint64_t *puD, uint64_t uFactor, uint32_t *pfEFlags), (puA, puD, uFactor, pfEFlags),
    16681669         MUL_LOAD_F1, MUL_STORE, MULDIV_MUL_U128)
    1669 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY)
     1670#  if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY)
    16701671EMIT_MUL(32, 64, (uint32_t *puA, uint32_t *puD, uint32_t uFactor, uint32_t *pfEFlags),  (puA, puD, uFactor, pfEFlags),
    16711672         MUL_LOAD_F1, MUL_STORE, MULDIV_MUL)
     
    16741675EMIT_MUL(8, 16, (uint16_t *puAX, uint8_t uFactor, uint32_t *pfEFlags),                  (puAX,     uFactor, pfEFlags),
    16751676         MUL_LOAD_F1_U8, MUL_STORE_U8, MULDIV_MUL)
    1676 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
     1677#  endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
     1678# endif /* !DOXYGEN_RUNNING */
    16771679
    16781680
     
    17451747    EMIT_IMUL_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoadF1, a_fnStore, a_fnNeg, a_fnMul, _amd,       0)
    17461748
     1749# ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */
    17471750EMIT_IMUL(64, 128, (uint64_t *puA, uint64_t *puD, uint64_t uFactor2, uint32_t *pfEFlags), (puA, puD, uFactor2, pfEFlags),
    17481751          MUL_LOAD_F1, MUL_STORE, MULDIV_NEG_U128, MULDIV_MUL_U128)
    1749 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY)
     1752#  if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY)
    17501753EMIT_IMUL(32, 64, (uint32_t *puA, uint32_t *puD, uint32_t uFactor2, uint32_t *pfEFlags),  (puA, puD, uFactor2, pfEFlags),
    17511754          MUL_LOAD_F1, MUL_STORE, MULDIV_NEG, MULDIV_MUL)
     
    17541757EMIT_IMUL(8, 16, (uint16_t *puAX, uint8_t uFactor2, uint32_t *pfEFlags),                  (puAX,     uFactor2, pfEFlags),
    17551758          MUL_LOAD_F1_U8, MUL_STORE_U8, MULDIV_NEG, MULDIV_MUL)
    1756 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
     1759#  endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
     1760# endif /* !DOXYGEN_RUNNING */
    17571761
    17581762
     
    18161820    EMIT_DIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnDivRem, _amd,       0)
    18171821
     1822# ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */
    18181823EMIT_DIV(64,128,(uint64_t *puA, uint64_t *puD, uint64_t uDivisor, uint32_t *pfEFlags), (puA, puD, uDivisor, pfEFlags),
    18191824         DIV_LOAD, DIV_STORE, MULDIV_MODDIV_U128)
    1820 # if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY)
     1825#  if !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY)
    18211826EMIT_DIV(32,64, (uint32_t *puA, uint32_t *puD, uint32_t uDivisor, uint32_t *pfEFlags), (puA, puD, uDivisor, pfEFlags),
    18221827         DIV_LOAD, DIV_STORE, MULDIV_MODDIV)
     
    18251830EMIT_DIV(8,16,  (uint16_t *puAX, uint8_t uDivisor, uint32_t *pfEFlags),                (puAX,     uDivisor, pfEFlags),
    18261831         DIV_LOAD_U8, DIV_STORE_U8, MULDIV_MODDIV)
    1827 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
     1832#  endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
     1833# endif /* !DOXYGEN_RUNNING */
    18281834
    18291835
     
    18351841 *
    18361842 */
    1837 # ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */
    1838 #  define EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, \
    1839                           a_Suffix, a_fIntelFlags) \
     1843# define EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, \
     1844                         a_Suffix, a_fIntelFlags) \
    18401845IEM_DECL_IMPL_DEF(int, RT_CONCAT3(iemAImpl_idiv_u,a_cBitsWidth,a_Suffix),a_Args) \
    18411846{ \
     
    19201925    return -1; \
    19211926}
    1922 #  define EMIT_IDIV(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem) \
     1927# define EMIT_IDIV(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem) \
    19231928     EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, RT_NOTHING, 1) \
    19241929     EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, _intel,     1) \
    19251930     EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, _amd,       0)
    19261931
     1932# ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */
    19271933EMIT_IDIV(64,128,(uint64_t *puA, uint64_t *puD, uint64_t uDivisor, uint32_t *pfEFlags), (puA, puD, uDivisor, pfEFlags),
    19281934          DIV_LOAD, DIV_STORE, MULDIV_NEG_U128, MULDIV_MODDIV_U128)
     
    19351941          DIV_LOAD_U8, DIV_STORE_U8, MULDIV_NEG, MULDIV_MODDIV)
    19361942#  endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */
    1937 # endif /* DOXYGEN_RUNNING */
     1943# endif /* !DOXYGEN_RUNNING */
    19381944
    19391945
     
    23632369        /* Calc EFLAGS. */ \
    23642370        fEfl &= ~(X86_EFL_CF | X86_EFL_OF); \
    2365         uint32_t const fOutCarry = a_cBitsWidth >= 32 || cShift \
     2371        uint32_t const fOutCarry = a_cBitsWidth >= 32 || a_fIntelFlags || cShift \
    23662372                                 ? (uDst >> (a_cBitsWidth - cShift)) & X86_EFL_CF : fInCarry; \
    23672373        fEfl |= fOutCarry; \
     
    24262432           it the same way as for 1 bit shifts. */ \
    24272433        fEfl &= ~(X86_EFL_CF | X86_EFL_OF); \
    2428         uint32_t const fOutCarry = (uDst >> (cShift - 1)) & X86_EFL_CF; \
     2434        uint32_t const fOutCarry = a_cBitsWidth >= 32 || a_fIntelFlags || cShift \
     2435                                 ? (uDst >> (cShift - 1)) & X86_EFL_CF : fInCarry; \
    24292436        fEfl |= fOutCarry; \
    24302437        if (!a_fIntelFlags) /* AMD 3990X: XOR two most signficant bits of the result: */ \
     
    27122719            } \
    27132720            else \
     2721            { \
     2722                if (cShift == 16) \
     2723                    fEfl |= uDst & X86_EFL_CF; \
    27142724                fEfl |= X86_EFL_GET_OF_16((uDst << (cShift - 1)) ^ 0); \
     2725            } \
    27152726            fEfl |= X86_EFL_AF; \
    27162727        } \
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