Changeset 106036 in vbox for trunk/src/VBox
- Timestamp:
- Sep 12, 2024 1:40:36 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
r106006 r106036 5959 5959 typedef enum IEMNATIVEMITEFLOP 5960 5960 { 5961 kIemNativeEmitEflOp_Invalid = 0,5962 5961 kIemNativeEmitEflOp_Set, 5963 5962 kIemNativeEmitEflOp_Clear, … … 5966 5965 5967 5966 #define IEM_MC_SET_EFL_BIT(a_fBit) \ 5968 off = iemNativeEmitModifyEFlagsBit (pReNative, off, a_fBit, kIemNativeEmitEflOp_Set);5967 off = iemNativeEmitModifyEFlagsBit<kIemNativeEmitEflOp_Set>(pReNative, off, a_fBit) 5969 5968 5970 5969 #define IEM_MC_CLEAR_EFL_BIT(a_fBit) \ 5971 off = iemNativeEmitModifyEFlagsBit (pReNative, off, a_fBit, kIemNativeEmitEflOp_Clear);5970 off = iemNativeEmitModifyEFlagsBit<kIemNativeEmitEflOp_Clear>(pReNative, off, a_fBit) 5972 5971 5973 5972 #define IEM_MC_FLIP_EFL_BIT(a_fBit) \ 5974 off = iemNativeEmitModifyEFlagsBit (pReNative, off, a_fBit, kIemNativeEmitEflOp_Flip);5973 off = iemNativeEmitModifyEFlagsBit<kIemNativeEmitEflOp_Flip>(pReNative, off, a_fBit) 5975 5974 5976 5975 /** Handles IEM_MC_SET_EFL_BIT/IEM_MC_CLEAR_EFL_BIT/IEM_MC_FLIP_EFL_BIT. */ 5977 DECL_INLINE_THROW(uint32_t) 5978 iemNativeEmitModifyEFlagsBit(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint32_t fEflBit, IEMNATIVEMITEFLOP enmOp)5976 template<IEMNATIVEMITEFLOP const a_enmOp> 5977 DECL_INLINE_THROW(uint32_t) iemNativeEmitModifyEFlagsBit(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint32_t fEflBit) 5979 5978 { 5980 5979 uint8_t const idxEflReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, kIemNativeGstReg_EFlags, 5981 5980 kIemNativeGstRegUse_ForUpdate, false /*fNoVolatileRegs*/); 5982 5981 5983 switch (enmOp) 5984 { 5985 case kIemNativeEmitEflOp_Set: 5986 off = iemNativeEmitOrGpr32ByImm(pReNative, off, idxEflReg, fEflBit); 5987 break; 5988 case kIemNativeEmitEflOp_Clear: 5989 off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxEflReg, ~fEflBit); 5990 break; 5991 case kIemNativeEmitEflOp_Flip: 5992 off = iemNativeEmitXorGpr32ByImm(pReNative, off, idxEflReg, fEflBit); 5993 break; 5994 default: 5995 AssertFailed(); 5996 break; 5997 } 5982 /* Using 'if constexpr' forces code elimination in debug builds with VC. */ 5983 if RT_CONSTEXPR_IF(a_enmOp == kIemNativeEmitEflOp_Set) 5984 off = iemNativeEmitOrGpr32ByImm(pReNative, off, idxEflReg, fEflBit); 5985 else if RT_CONSTEXPR_IF(a_enmOp == kIemNativeEmitEflOp_Clear) 5986 off = iemNativeEmitAndGpr32ByImm(pReNative, off, idxEflReg, ~fEflBit); 5987 else if RT_CONSTEXPR_IF(a_enmOp == kIemNativeEmitEflOp_Flip) 5988 off = iemNativeEmitXorGpr32ByImm(pReNative, off, idxEflReg, fEflBit); 5989 else 5990 AssertCompile( a_enmOp == kIemNativeEmitEflOp_Set /* AssertCompile(false) works with VC 2019 but not clang 15. */ 5991 || a_enmOp == kIemNativeEmitEflOp_Clear 5992 || a_enmOp == kIemNativeEmitEflOp_Flip); 5998 5993 5999 5994 /** @todo No delayed writeback for EFLAGS right now. */
Note:
See TracChangeset
for help on using the changeset viewer.