Changeset 104036 in vbox for trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
- Timestamp:
- Mar 25, 2024 12:56:46 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r104034 r104036 3728 3728 */ 3729 3729 uint32_t idx = pDbgInfo->cEntries; 3730 uint32_t idxStop = idx > 8 ? idx - 8: 0;3730 uint32_t idxStop = idx > 16 ? idx - 16 : 0; 3731 3731 while (idx-- > idxStop) 3732 3732 if (pDbgInfo->aEntries[idx].Gen.uType == kIemTbDbgEntryType_NativeOffset) … … 3795 3795 PIEMTBDBGENTRY const pEntry = iemNativeDbgInfoAddNewEntry(pReNative, pReNative->pDbgInfo); 3796 3796 pEntry->GuestRegShadowing.uType = kIemTbDbgEntryType_GuestRegShadowing; 3797 #ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK3798 pEntry->GuestRegShadowing.fDirty = (pReNative->Core.bmGstRegShadowDirty & RT_BIT_64(enmGstReg)) ? 1 : 0;3799 #endif3800 3797 pEntry->GuestRegShadowing.uUnused = 0; 3801 3798 pEntry->GuestRegShadowing.idxGstReg = enmGstReg; … … 3837 3834 pEntry->DelayedPcUpdate.offPc = offPc; 3838 3835 pEntry->DelayedPcUpdate.cInstrSkipped = cInstrSkipped; 3836 } 3837 # endif 3838 3839 3840 # ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK 3841 /** 3842 * Debug Info: Record info about a dirty guest register. 3843 */ 3844 DECL_HIDDEN_THROW(void) iemNaitveDbgInfoAddGuestRegDirty(PIEMRECOMPILERSTATE pReNative, bool fSimdReg, 3845 uint8_t idxGstReg, uint8_t idxHstReg) 3846 { 3847 PIEMTBDBGENTRY const pEntry = iemNativeDbgInfoAddNewEntry(pReNative, pReNative->pDbgInfo); 3848 pEntry->GuestRegDirty.uType = kIemTbDbgEntryType_GuestRegDirty; 3849 pEntry->GuestRegDirty.fSimdReg = fSimdReg ? 1 : 0; 3850 pEntry->GuestRegDirty.idxGstReg = idxGstReg; 3851 pEntry->GuestRegDirty.idxHstReg = idxHstReg; 3852 } 3853 3854 3855 /** 3856 * Debug Info: Record info about a dirty guest register writeback operation. 3857 */ 3858 DECL_HIDDEN_THROW(void) iemNaitveDbgInfoAddGuestRegWriteback(PIEMRECOMPILERSTATE pReNative, bool fSimdReg, uint64_t fGstReg) 3859 { 3860 PIEMTBDBGENTRY const pEntry = iemNativeDbgInfoAddNewEntry(pReNative, pReNative->pDbgInfo); 3861 pEntry->GuestRegWriteback.uType = kIemTbDbgEntryType_GuestRegWriteback; 3862 pEntry->GuestRegWriteback.fSimdReg = fSimdReg ? 1 : 0; 3863 pEntry->GuestRegWriteback.fGstReg = (uint32_t)fGstReg; 3864 /** @todo r=aeichner Can't fit the whole register mask in the debug info entry, deal with it when it becomes necessary. */ 3865 Assert((uint64_t)pEntry->GuestRegWriteback.fGstReg == fGstReg); 3839 3866 } 3840 3867 # endif … … 4105 4132 if (pReNative->Core.bmGstRegShadowDirty & fFlushGstReg) 4106 4133 { 4134 # ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 4135 iemNativeDbgInfoAddNativeOffset(pReNative, off); 4136 iemNaitveDbgInfoAddGuestRegWriteback(pReNative, false /*fSimdReg*/, pReNative->Core.bmGstRegShadowDirty & fFlushGstReg); 4137 # endif 4138 4107 4139 uint64_t bmGstRegShadowDirty = pReNative->Core.bmGstRegShadowDirty & fFlushGstReg; 4108 4140 uint32_t idxGstReg = 0; … … 4140 4172 if (pReNative->Core.bmGstRegShadowDirty & fGstRegShadows) 4141 4173 { 4174 # ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 4175 iemNativeDbgInfoAddNativeOffset(pReNative, off); 4176 iemNaitveDbgInfoAddGuestRegWriteback(pReNative, false /*fSimdReg*/, pReNative->Core.bmGstRegShadowDirty & fGstRegShadows); 4177 # endif 4178 4142 4179 uint64_t bmGstRegShadowDirty = pReNative->Core.bmGstRegShadowDirty & fGstRegShadows; 4143 4180 uint32_t idxGstReg = 0; … … 4635 4672 ? IEMNATIVE_HST_GREG_MASK & ~IEMNATIVE_REG_FIXED_MASK 4636 4673 : IEMNATIVE_HST_GREG_MASK & ~IEMNATIVE_REG_FIXED_MASK & ~IEMNATIVE_CALL_VOLATILE_GREG_MASK; 4637 4638 #ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK4639 /** @todo r=aeichner Implement for registers other than GPR as well. */4640 if ( ( enmIntendedUse == kIemNativeGstRegUse_ForFullWrite4641 || enmIntendedUse == kIemNativeGstRegUse_ForUpdate)4642 && enmGstReg >= kIemNativeGstReg_GprFirst4643 && enmGstReg <= kIemNativeGstReg_GprLast4644 )4645 pReNative->Core.bmGstRegShadowDirty |= RT_BIT_64(enmGstReg);4646 #endif4647 4674 4648 4675 /* … … 4763 4790 #endif 4764 4791 4792 #ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK 4793 /** @todo r=aeichner Implement for registers other than GPR as well. */ 4794 if ( ( enmIntendedUse == kIemNativeGstRegUse_ForFullWrite 4795 || enmIntendedUse == kIemNativeGstRegUse_ForUpdate) 4796 && enmGstReg >= kIemNativeGstReg_GprFirst 4797 && enmGstReg <= kIemNativeGstReg_GprLast 4798 ) 4799 { 4800 # ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 4801 iemNativeDbgInfoAddNativeOffset(pReNative, *poff); 4802 iemNaitveDbgInfoAddGuestRegDirty(pReNative, false /*fSimdReg*/, enmGstReg, idxReg); 4803 # endif 4804 4805 pReNative->Core.bmGstRegShadowDirty |= RT_BIT_64(enmGstReg); 4806 } 4807 #endif 4808 4765 4809 return idxReg; 4766 4810 } … … 4778 4822 Log12(("iemNativeRegAllocTmpForGuestReg: Allocated %s for guest %s %s\n", 4779 4823 g_apszIemNativeHstRegNames[idxRegNew], g_aGstShadowInfo[enmGstReg].pszName, s_pszIntendedUse[enmIntendedUse])); 4824 4825 #ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK 4826 /** @todo r=aeichner Implement for registers other than GPR as well. */ 4827 if ( ( enmIntendedUse == kIemNativeGstRegUse_ForFullWrite 4828 || enmIntendedUse == kIemNativeGstRegUse_ForUpdate) 4829 && enmGstReg >= kIemNativeGstReg_GprFirst 4830 && enmGstReg <= kIemNativeGstReg_GprLast 4831 ) 4832 { 4833 # ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 4834 iemNativeDbgInfoAddNativeOffset(pReNative, *poff); 4835 iemNaitveDbgInfoAddGuestRegDirty(pReNative, false /*fSimdReg*/, enmGstReg, idxRegNew); 4836 # endif 4837 4838 pReNative->Core.bmGstRegShadowDirty |= RT_BIT_64(enmGstReg); 4839 } 4840 #endif 4780 4841 4781 4842 return idxRegNew; … … 6247 6308 6248 6309 #ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR 6310 # ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 6311 if (pReNative->Core.bmGstSimdRegShadowDirtyLo128 | pReNative->Core.bmGstSimdRegShadowDirtyHi128) 6312 { 6313 iemNativeDbgInfoAddNativeOffset(pReNative, off); 6314 iemNaitveDbgInfoAddGuestRegWriteback(pReNative, true /*fSimdReg*/, 6315 pReNative->Core.bmGstSimdRegShadowDirtyLo128 6316 | pReNative->Core.bmGstSimdRegShadowDirtyHi128); 6317 } 6318 # endif 6249 6319 /** @todo r=bird: There must be a quicker way to check if anything needs 6250 6320 * doing and then call simd function to do the flushing */ … … 8091 8161 #ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK 8092 8162 if (enmGstReg >= kIemNativeGstReg_GprFirst && enmGstReg <= kIemNativeGstReg_GprLast) 8163 { 8164 # ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 8165 iemNativeDbgInfoAddNativeOffset(pReNative, *poff); 8166 iemNaitveDbgInfoAddGuestRegDirty(pReNative, false /*fSimdReg*/, enmGstReg, idxReg); 8167 # endif 8168 8093 8169 pReNative->Core.bmGstRegShadowDirty |= RT_BIT_64(enmGstReg); 8170 } 8094 8171 #endif 8095 8172 … … 9446 9523 const char * const pszGstReg = g_aGstShadowInfo[pEntry->GuestRegShadowing.idxGstReg].pszName; 9447 9524 if (pEntry->GuestRegShadowing.idxHstReg == UINT8_MAX) 9448 pHlp->pfnPrintf(pHlp, " Guest register %s != host register %s (Dirty: %RTbool)\n", pszGstReg, 9449 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstRegPrev], 9450 RT_BOOL(pEntry->GuestRegShadowing.fDirty)); 9525 pHlp->pfnPrintf(pHlp, " Guest register %s != host register %s\n", pszGstReg, 9526 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstRegPrev]); 9451 9527 else if (pEntry->GuestRegShadowing.idxHstRegPrev == UINT8_MAX) 9452 pHlp->pfnPrintf(pHlp, " Guest register %s == host register %s (Dirty: %RTbool)\n", pszGstReg, 9528 pHlp->pfnPrintf(pHlp, " Guest register %s == host register %s \n", pszGstReg, 9529 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstReg]); 9530 else 9531 pHlp->pfnPrintf(pHlp, " Guest register %s == host register %s (previously in %s)\n", pszGstReg, 9453 9532 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstReg], 9454 RT_BOOL(pEntry->GuestRegShadowing.fDirty)); 9455 else 9456 pHlp->pfnPrintf(pHlp, " Guest register %s == host register %s (previously in %s, Dirty: %RTbool)\n", pszGstReg, 9457 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstReg], 9458 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstRegPrev], 9459 RT_BOOL(pEntry->GuestRegShadowing.fDirty)); 9533 g_apszIemNativeHstRegNames[pEntry->GuestRegShadowing.idxHstRegPrev]); 9460 9534 continue; 9461 9535 } … … 9557 9631 #endif 9558 9632 9633 #ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK 9634 case kIemTbDbgEntryType_GuestRegDirty: 9635 { 9636 PCIEMTBDBGENTRY const pEntry = &pDbgInfo->aEntries[iDbgEntry]; 9637 const char * const pszGstReg = pEntry->GuestRegDirty.fSimdReg 9638 ? g_aGstSimdShadowInfo[pEntry->GuestRegDirty.idxGstReg].pszName 9639 : g_aGstShadowInfo[pEntry->GuestRegDirty.idxGstReg].pszName; 9640 const char * const pszHstReg = pEntry->GuestRegDirty.fSimdReg 9641 ? g_apszIemNativeHstSimdRegNames[pEntry->GuestRegDirty.idxHstReg] 9642 : g_apszIemNativeHstRegNames[pEntry->GuestRegDirty.idxHstReg]; 9643 pHlp->pfnPrintf(pHlp, 9644 " Guest register %s (shadowed by %s) is now dirty\n", 9645 pszGstReg, pszHstReg); 9646 continue; 9647 } 9648 9649 case kIemTbDbgEntryType_GuestRegWriteback: 9650 pHlp->pfnPrintf(pHlp, 9651 " Writing dirty %s registers (gst %#RX64)\n", 9652 pDbgInfo->aEntries[iDbgEntry].GuestRegWriteback.fSimdReg ? "SIMD" : "general", 9653 pDbgInfo->aEntries[iDbgEntry].GuestRegWriteback.fGstReg); 9654 continue; 9655 #endif 9656 9559 9657 default: 9560 9658 AssertFailed();
Note:
See TracChangeset
for help on using the changeset viewer.