Changeset 94225 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 14, 2022 1:32:35 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r94224 r94225 1665 1665 EMIT_MUL_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoadF1, a_fnStore, a_fnMul, _amd, 0) \ 1666 1666 1667 # ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */ 1667 1668 EMIT_MUL(64, 128, (uint64_t *puA, uint64_t *puD, uint64_t uFactor, uint32_t *pfEFlags), (puA, puD, uFactor, pfEFlags), 1668 1669 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) 1670 1671 EMIT_MUL(32, 64, (uint32_t *puA, uint32_t *puD, uint32_t uFactor, uint32_t *pfEFlags), (puA, puD, uFactor, pfEFlags), 1671 1672 MUL_LOAD_F1, MUL_STORE, MULDIV_MUL) … … 1674 1675 EMIT_MUL(8, 16, (uint16_t *puAX, uint8_t uFactor, uint32_t *pfEFlags), (puAX, uFactor, pfEFlags), 1675 1676 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 */ 1677 1679 1678 1680 … … 1745 1747 EMIT_IMUL_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoadF1, a_fnStore, a_fnNeg, a_fnMul, _amd, 0) 1746 1748 1749 # ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */ 1747 1750 EMIT_IMUL(64, 128, (uint64_t *puA, uint64_t *puD, uint64_t uFactor2, uint32_t *pfEFlags), (puA, puD, uFactor2, pfEFlags), 1748 1751 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) 1750 1753 EMIT_IMUL(32, 64, (uint32_t *puA, uint32_t *puD, uint32_t uFactor2, uint32_t *pfEFlags), (puA, puD, uFactor2, pfEFlags), 1751 1754 MUL_LOAD_F1, MUL_STORE, MULDIV_NEG, MULDIV_MUL) … … 1754 1757 EMIT_IMUL(8, 16, (uint16_t *puAX, uint8_t uFactor2, uint32_t *pfEFlags), (puAX, uFactor2, pfEFlags), 1755 1758 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 */ 1757 1761 1758 1762 … … 1816 1820 EMIT_DIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnDivRem, _amd, 0) 1817 1821 1822 # ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */ 1818 1823 EMIT_DIV(64,128,(uint64_t *puA, uint64_t *puD, uint64_t uDivisor, uint32_t *pfEFlags), (puA, puD, uDivisor, pfEFlags), 1819 1824 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) 1821 1826 EMIT_DIV(32,64, (uint32_t *puA, uint32_t *puD, uint32_t uDivisor, uint32_t *pfEFlags), (puA, puD, uDivisor, pfEFlags), 1822 1827 DIV_LOAD, DIV_STORE, MULDIV_MODDIV) … … 1825 1830 EMIT_DIV(8,16, (uint16_t *puAX, uint8_t uDivisor, uint32_t *pfEFlags), (puAX, uDivisor, pfEFlags), 1826 1831 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 */ 1828 1834 1829 1835 … … 1835 1841 * 1836 1842 */ 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) \ 1840 1845 IEM_DECL_IMPL_DEF(int, RT_CONCAT3(iemAImpl_idiv_u,a_cBitsWidth,a_Suffix),a_Args) \ 1841 1846 { \ … … 1920 1925 return -1; \ 1921 1926 } 1922 # 1927 # define EMIT_IDIV(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem) \ 1923 1928 EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, RT_NOTHING, 1) \ 1924 1929 EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, _intel, 1) \ 1925 1930 EMIT_IDIV_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoad, a_fnStore, a_fnNeg, a_fnDivRem, _amd, 0) 1926 1931 1932 # ifndef DOXYGEN_RUNNING /* this totally confuses doxygen for some reason */ 1927 1933 EMIT_IDIV(64,128,(uint64_t *puA, uint64_t *puD, uint64_t uDivisor, uint32_t *pfEFlags), (puA, puD, uDivisor, pfEFlags), 1928 1934 DIV_LOAD, DIV_STORE, MULDIV_NEG_U128, MULDIV_MODDIV_U128) … … 1935 1941 DIV_LOAD_U8, DIV_STORE_U8, MULDIV_NEG, MULDIV_MODDIV) 1936 1942 # endif /* !defined(RT_ARCH_X86) || defined(IEM_WITHOUT_ASSEMBLY) */ 1937 # endif /* DOXYGEN_RUNNING */1943 # endif /* !DOXYGEN_RUNNING */ 1938 1944 1939 1945 … … 2363 2369 /* Calc EFLAGS. */ \ 2364 2370 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 \ 2366 2372 ? (uDst >> (a_cBitsWidth - cShift)) & X86_EFL_CF : fInCarry; \ 2367 2373 fEfl |= fOutCarry; \ … … 2426 2432 it the same way as for 1 bit shifts. */ \ 2427 2433 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; \ 2429 2436 fEfl |= fOutCarry; \ 2430 2437 if (!a_fIntelFlags) /* AMD 3990X: XOR two most signficant bits of the result: */ \ … … 2712 2719 } \ 2713 2720 else \ 2721 { \ 2722 if (cShift == 16) \ 2723 fEfl |= uDst & X86_EFL_CF; \ 2714 2724 fEfl |= X86_EFL_GET_OF_16((uDst << (cShift - 1)) ^ 0); \ 2725 } \ 2715 2726 fEfl |= X86_EFL_AF; \ 2716 2727 } \
Note:
See TracChangeset
for help on using the changeset viewer.