Changeset 101536 in vbox
- Timestamp:
- Oct 20, 2023 10:04:41 PM (17 months ago)
- svn:sync-xref-src-repo-rev:
- 159613
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r101535 r101536 3563 3563 3564 3564 /********************************************************************************************************************************* 3565 * Emitters for IEM_MC_XXXX 3565 * Emitters for IEM_MC_XXXX and the associated IEM_MC_XXXX recompiler definitions * 3566 3566 *********************************************************************************************************************************/ 3567 3567 3568 #define IEM_MC_BEGIN(a_cArgs, a_cLocals, a_fMcFlags, a_fCImplFlags) \ 3569 { 3570 3571 #define IEM_MC_END() \ 3572 } AssertFailedReturn(UINT32_MAX /* shouldn't be reached! */) 3573 3574 3575 #define IEM_MC_DEFER_TO_CIMPL_0_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl) \ 3576 return iemNativeEmitCImplCall0(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr) /** @todo not used ... */ 3577 3578 3579 #define IEM_MC_DEFER_TO_CIMPL_1_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0) \ 3580 return iemNativeEmitCImplCall1(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0) 3568 3581 3569 3582 DECLINLINE(uint32_t) iemNativeEmitCImplCall1(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr, … … 3574 3587 3575 3588 3589 #define IEM_MC_DEFER_TO_CIMPL_2_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0, a1) \ 3590 return iemNativeEmitCImplCall2(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0, a1) 3591 3576 3592 DECLINLINE(uint32_t) iemNativeEmitCImplCall2(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr, 3577 3593 uintptr_t pfnCImpl, uint8_t cbInstr, uint64_t uArg0, uint64_t uArg1) … … 3581 3597 3582 3598 3599 #define IEM_MC_DEFER_TO_CIMPL_3_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0, a1, a2) \ 3600 return iemNativeEmitCImplCall3(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0, a1, a2) 3601 3583 3602 DECLINLINE(uint32_t) iemNativeEmitCImplCall3(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxInstr, 3584 3603 uintptr_t pfnCImpl, uint8_t cbInstr, uint64_t uArg0, uint64_t uArg1, uint64_t uArg2) … … 3588 3607 3589 3608 3590 #if 0 3591 /** Same as iemRegFinishClearingRF. */ 3592 DECLINLINE(uint32_t) iemNativeEmitFinishClearingRF(PIEMRECOMPILERSTATE pReNative, uint32_t off) 3593 { 3594 RT_NOREF(pReNative, off); 3595 #if 0 3596 uint32_t const fFlags = pReNative->pTbOrg->fFlags; 3597 if (fFlags & IEMTB_F_INHIBIT_SHADOW) 3598 { 3599 } 3600 IEMTB_F_IEM_F_MASK 3601 3602 // 3603 if (RT_LIKELY(!( pVCpu->cpum.GstCtx.eflags.uBoth 3604 & (X86_EFL_TF | X86_EFL_RF | CPUMCTX_INHIBIT_SHADOW | CPUMCTX_DBG_HIT_DRX_MASK | CPUMCTX_DBG_DBGF_MASK)) )) 3605 return VINF_SUCCESS; 3606 return iemFinishInstructionWithFlagsSet(pVCpu); 3607 #else 3608 return UINT32_MAX; 3609 #endif 3610 } 3611 #endif 3612 3609 /* 3610 * Advancing PC/RIP/EIP/IP. 3611 */ 3612 3613 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64(a_cbInstr) \ 3614 return iemNativeEmitAddToRip64AndFinishingNoFlags(pReNative, off, (a_cbInstr)) 3613 3615 3614 3616 /** Same as iemRegAddToRip64AndFinishingNoFlags. */ … … 3630 3632 3631 3633 3634 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32(a_cbInstr) \ 3635 return iemNativeEmitAddToEip32AndFinishingNoFlags(pReNative, off, (a_cbInstr)) 3636 3632 3637 /** Same as iemRegAddToEip32AndFinishingNoFlags. */ 3633 3638 DECLINLINE(uint32_t) iemNativeEmitAddToEip32AndFinishingNoFlags(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t cbInstr) … … 3647 3652 } 3648 3653 3654 3655 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16(a_cbInstr) \ 3656 return iemNativeEmitAddToIp16AndFinishingNoFlags(pReNative, off, (a_cbInstr)) 3649 3657 3650 3658 /** Same as iemRegAddToIp16AndFinishingNoFlags. */ … … 3666 3674 } 3667 3675 3676 3677 /* 3678 * Changing PC/RIP/EIP/IP with a relative jump. 3679 */ 3680 3681 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC64(a_i8, a_cbInstr, a_enmEffOpSize) \ 3682 return iemNativeEmitRip64RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int8_t)(a_i8), (a_enmEffOpSize), pCallEntry->idxInstr) 3683 3684 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC64(a_i16, a_cbInstr) \ 3685 return iemNativeEmitRip64RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int16_t)(a_i16), IEMMODE_16BIT, pCallEntry->idxInstr) 3686 3687 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC64(a_i32, a_cbInstr) \ 3688 return iemNativeEmitRip64RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (a_i32), IEMMODE_64BIT, pCallEntry->idxInstr) 3668 3689 3669 3690 /** Same as iemRegRip64RelativeJumpS8AndFinishNoFlags, … … 3706 3727 3707 3728 3729 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC32(a_i8, a_cbInstr, a_enmEffOpSize) \ 3730 return iemNativeEmitEip32RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int8_t)(a_i8), (a_enmEffOpSize), pCallEntry->idxInstr) 3731 3732 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC32(a_i16, a_cbInstr) \ 3733 return iemNativeEmitEip32RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int16_t)(a_i16), IEMMODE_16BIT, pCallEntry->idxInstr) 3734 3735 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC32(a_i32, a_cbInstr) \ 3736 return iemNativeEmitEip32RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (a_i32), IEMMODE_32BIT, pCallEntry->idxInstr) 3737 3708 3738 /** Same as iemRegEip32RelativeJumpS8AndFinishNoFlags, 3709 3739 * iemRegEip32RelativeJumpS16AndFinishNoFlags and … … 3744 3774 3745 3775 3776 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC16(a_i8, a_cbInstr) \ 3777 return iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int8_t)(a_i8), pCallEntry->idxInstr) 3778 3779 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC16(a_i16, a_cbInstr) \ 3780 return iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int16_t)(a_i16), pCallEntry->idxInstr) 3781 3782 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC16(a_i32, a_cbInstr) \ 3783 return iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (a_i32), pCallEntry->idxInstr) 3784 3746 3785 /** Same as iemRegIp16RelativeJumpS8AndFinishNoFlags. */ 3747 3786 DECLINLINE(uint32_t) iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(PIEMRECOMPILERSTATE pReNative, uint32_t off, … … 3770 3809 3771 3810 /********************************************************************************************************************************* 3772 * MC definitions for the native recompiler*3811 * Builtin functions * 3773 3812 *********************************************************************************************************************************/ 3774 3775 #define IEM_MC_DEFER_TO_CIMPL_0_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl) \3776 return iemNativeEmitCImplCall0(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr) /** @todo not used ... */3777 3778 #define IEM_MC_DEFER_TO_CIMPL_1_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0) \3779 return iemNativeEmitCImplCall1(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0)3780 3781 #define IEM_MC_DEFER_TO_CIMPL_2_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0, a1) \3782 return iemNativeEmitCImplCall2(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0, a1)3783 3784 #define IEM_MC_DEFER_TO_CIMPL_3_RET_THREADED(a_cbInstr, a_fFlags, a_pfnCImpl, a0, a1, a2) \3785 return iemNativeEmitCImplCall3(pReNative, off, pCallEntry->idxInstr, (uintptr_t)a_pfnCImpl, a_cbInstr, a0, a1, a2)3786 3787 3788 #define IEM_MC_BEGIN(a_cArgs, a_cLocals, a_fMcFlags, a_fCImplFlags) \3789 {3790 3791 #define IEM_MC_END() \3792 } AssertFailedReturn(UINT32_MAX /* shouldn't be reached! */)3793 3794 3795 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC16(a_cbInstr) \3796 return iemNativeEmitAddToIp16AndFinishingNoFlags(pReNative, off, (a_cbInstr))3797 3798 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC32(a_cbInstr) \3799 return iemNativeEmitAddToEip32AndFinishingNoFlags(pReNative, off, (a_cbInstr))3800 3801 #define IEM_MC_ADVANCE_RIP_AND_FINISH_THREADED_PC64(a_cbInstr) \3802 return iemNativeEmitAddToRip64AndFinishingNoFlags(pReNative, off, (a_cbInstr))3803 3804 3805 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC16(a_i8, a_cbInstr) \3806 return iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int8_t)(a_i8), pCallEntry->idxInstr)3807 3808 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC32(a_i8, a_cbInstr, a_enmEffOpSize) \3809 return iemNativeEmitEip32RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int8_t)(a_i8), (a_enmEffOpSize), pCallEntry->idxInstr)3810 3811 #define IEM_MC_REL_JMP_S8_AND_FINISH_THREADED_PC64(a_i8, a_cbInstr, a_enmEffOpSize) \3812 return iemNativeEmitRip64RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int8_t)(a_i8), (a_enmEffOpSize), pCallEntry->idxInstr)3813 3814 3815 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC16(a_i16, a_cbInstr) \3816 return iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int16_t)(a_i16), pCallEntry->idxInstr)3817 3818 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC32(a_i16, a_cbInstr) \3819 return iemNativeEmitEip32RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int16_t)(a_i16), IEMMODE_16BIT, pCallEntry->idxInstr)3820 3821 #define IEM_MC_REL_JMP_S16_AND_FINISH_THREADED_PC64(a_i16, a_cbInstr) \3822 return iemNativeEmitRip64RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (int16_t)(a_i16), IEMMODE_16BIT, pCallEntry->idxInstr)3823 3824 3825 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC16(a_i32, a_cbInstr) \3826 return iemNativeEmitIp16RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (a_i32), pCallEntry->idxInstr)3827 3828 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC32(a_i32, a_cbInstr) \3829 return iemNativeEmitEip32RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (a_i32), IEMMODE_32BIT, pCallEntry->idxInstr)3830 3831 #define IEM_MC_REL_JMP_S32_AND_FINISH_THREADED_PC64(a_i32, a_cbInstr) \3832 return iemNativeEmitRip64RelativeJumpAndFinishingNoFlags(pReNative, off, (a_cbInstr), (a_i32), IEMMODE_64BIT, pCallEntry->idxInstr)3833 3834 3835 3836 /*3837 * Builtin functions.3838 */3839 3813 3840 3814 /** … … 3850 3824 3851 3825 3826 /********************************************************************************************************************************* 3827 * The native code generator functions for each MC block. * 3828 *********************************************************************************************************************************/ 3829 3830 3852 3831 /* 3853 3832 * Include g_apfnIemNativeRecompileFunctions and associated functions. … … 3857 3836 */ 3858 3837 #include "IEMNativeFunctions.cpp.h" 3838 3839 3840 3841 /********************************************************************************************************************************* 3842 * Recompiler Core. * 3843 *********************************************************************************************************************************/ 3859 3844 3860 3845
Note:
See TracChangeset
for help on using the changeset viewer.