Changeset 94176 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 11, 2022 3:14:51 PM (3 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r94174 r94176 757 757 ; 758 758 BEGINCODE 759 BEGINPROC_FASTCALL iemAImpl_imul_two_u16_intel, 12 760 BEGINPROC_FASTCALL iemAImpl_imul_two_u16_amd, 12 761 BEGINPROC_FASTCALL iemAImpl_imul_two_u16, 12 762 PROLOGUE_3_ARGS 763 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_CF), (X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF) 759 ; @param 1 EFLAGS that are modified. 760 ; @param 2 Undefined EFLAGS. 761 ; @param 3 Function suffix. 762 ; @param 4 EFLAGS variation: 0 for native, 1 for intel (ignored), 763 ; 2 for AMD (set AF, clear PF, ZF and SF). 764 %macro IEMIMPL_IMUL_TWO 4 765 BEGINPROC_FASTCALL iemAImpl_imul_two_u16 %+ %3, 12 766 PROLOGUE_3_ARGS 767 IEM_MAYBE_LOAD_FLAGS A2, %1, %2 764 768 imul A1_16, word [A0] 765 769 mov [A0], A1_16 766 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_CF), (X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF) 767 EPILOGUE_3_ARGS 768 ENDPROC iemAImpl_imul_two_u16 769 770 BEGINPROC_FASTCALL iemAImpl_imul_two_u32_intel, 12 771 BEGINPROC_FASTCALL iemAImpl_imul_two_u32_amd, 12 772 BEGINPROC_FASTCALL iemAImpl_imul_two_u32, 12 773 PROLOGUE_3_ARGS 774 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_CF), (X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF) 770 %if %4 != 1 771 IEM_SAVE_FLAGS A2, %1, %2 772 %else 773 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %1, X86_EFL_AF | X86_EFL_ZF, A1_16, 16, A1 774 %endif 775 EPILOGUE_3_ARGS 776 ENDPROC iemAImpl_imul_two_u16 %+ %3 777 778 BEGINPROC_FASTCALL iemAImpl_imul_two_u32 %+ %3, 12 779 PROLOGUE_3_ARGS 780 IEM_MAYBE_LOAD_FLAGS A2, %1, %2 775 781 imul A1_32, dword [A0] 776 782 mov [A0], A1_32 777 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_CF), (X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF) 778 EPILOGUE_3_ARGS 779 ENDPROC iemAImpl_imul_two_u32 780 781 %ifdef RT_ARCH_AMD64 782 BEGINPROC_FASTCALL iemAImpl_imul_two_u64_intel, 16 783 BEGINPROC_FASTCALL iemAImpl_imul_two_u64_amd, 16 784 BEGINPROC_FASTCALL iemAImpl_imul_two_u64, 16 785 PROLOGUE_3_ARGS 786 IEM_MAYBE_LOAD_FLAGS A2, (X86_EFL_OF | X86_EFL_CF), (X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF) 783 %if %4 != 1 784 IEM_SAVE_FLAGS A2, %1, %2 785 %else 786 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %1, X86_EFL_AF | X86_EFL_ZF, A1_32, 32, A1 787 %endif 788 EPILOGUE_3_ARGS 789 ENDPROC iemAImpl_imul_two_u32 %+ %3 790 791 %ifdef RT_ARCH_AMD64 792 BEGINPROC_FASTCALL iemAImpl_imul_two_u64 %+ %3, 16 793 PROLOGUE_3_ARGS 794 IEM_MAYBE_LOAD_FLAGS A2, %1, %2 787 795 imul A1, qword [A0] 788 796 mov [A0], A1 789 IEM_SAVE_FLAGS A2, (X86_EFL_OF | X86_EFL_CF), (X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF) 797 %if %4 != 1 798 IEM_SAVE_FLAGS A2, %1, %2 799 %else 800 IEM_SAVE_FLAGS_ADJUST_AND_CALC_SF_PF A2, %1, X86_EFL_AF | X86_EFL_ZF, A1, 64, A1 801 %endif 790 802 EPILOGUE_3_ARGS_EX 8 791 ENDPROC iemAImpl_imul_two_u64 792 %endif ; RT_ARCH_AMD64 803 ENDPROC iemAImpl_imul_two_u64 %+ %3 804 %endif ; RT_ARCH_AMD64 805 %endmacro 806 IEMIMPL_IMUL_TWO X86_EFL_OF | X86_EFL_CF, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, , 0 807 IEMIMPL_IMUL_TWO X86_EFL_OF | X86_EFL_CF, 0, _intel, 1 808 IEMIMPL_IMUL_TWO X86_EFL_OF | X86_EFL_CF, 0, _amd, 2 793 809 794 810 -
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r94170 r94176 1681 1681 * 1682 1682 * The SF, ZF, AF and PF flags are "undefined". AMD (3990x) leaves these 1683 * flags as is - at least for the two op version. Whereas Intel skylake (6700K 1684 * and 10980X (Cascade Lake)) always clear AF and ZF and calculates SF and PF 1685 * as per the lower half of the result. 1683 * flags as is. Whereas Intel skylake (6700K and 10980X (Cascade Lake)) always 1684 * clear AF and ZF and calculates SF and PF as per the lower half of the result. 1686 1685 */ 1687 1686 # define EMIT_IMUL_INNER(a_cBitsWidth, a_cBitsWidth2x, a_Args, a_CallArgs, a_fnLoadF1, a_fnStore, a_fnNeg, a_fnMul, \
Note:
See TracChangeset
for help on using the changeset viewer.