Changeset 103964 in vbox
- Timestamp:
- Mar 20, 2024 3:01:46 PM (11 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r103953 r103964 4121 4121 uint32_t const idxVar = ASMBitFirstSetU32(fVars) - 1; 4122 4122 uint8_t const idxReg = pReNative->Core.aVars[idxVar].idxReg; 4123 #ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR 4124 if (pReNative->Core.aVars[idxVar].fSimdReg) /* Need to ignore SIMD variables here or we end up freeing random registers. */ 4125 continue; 4126 #endif 4127 4123 4128 if ( idxReg < RT_ELEMENTS(pReNative->Core.aHstRegs) 4124 4129 && (RT_BIT_32(idxReg) & fRegMask) … … 5334 5339 uint32_t fRegMask = IEMNATIVE_HST_SIMD_REG_MASK & ~IEMNATIVE_SIMD_REG_FIXED_MASK) 5335 5340 { 5336 //STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeRegFindFree);5341 STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeSimdRegFindFree); 5337 5342 Assert(!(fRegMask & ~IEMNATIVE_HST_SIMD_REG_MASK)); 5338 5343 Assert(!(fRegMask & IEMNATIVE_SIMD_REG_FIXED_MASK)); … … 5344 5349 if (fRegs) 5345 5350 { 5346 //STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeRegFindFreeNoVar);5351 STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeSimdRegFindFreeNoVar); 5347 5352 5348 5353 #if 0 /** @todo def IEMNATIVE_WITH_LIVENESS_ANALYSIS */ … … 5377 5382 if (pReNative->Core.bmGstRegShadows & fToFreeMask) 5378 5383 { 5379 STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNative RegFindFreeLivenessUnshadowed);5384 STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeSimdRegFindFreeLivenessUnshadowed); 5380 5385 iemNativeRegFlushGuestShadows(pReNative, fToFreeMask); 5381 5386 Assert(fRegs == (~pReNative->Core.bmHstRegs & fRegMask)); /* this shall not change. */ … … 5385 5390 if (fUnshadowedRegs) 5386 5391 { 5387 STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNative RegFindFreeLivenessHelped);5392 STAM_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeSimdRegFindFreeLivenessHelped); 5388 5393 return (fPreferVolatile 5389 5394 ? ASMBitFirstSetU32(fUnshadowedRegs) … … 5428 5433 } 5429 5434 5435 AssertFailed(); /** @todo The following needs testing when it actually gets hit. */ 5436 5430 5437 /* 5431 5438 * Try free up a variable that's in a register. … … 5434 5441 * saved on the stack, then in the second round move things to the stack. 5435 5442 */ 5436 //STAM_REL_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeRegFindFreeVar); 5437 AssertReleaseFailed(); /** @todo No variable support right now. */ 5438 #if 0 5443 STAM_REL_COUNTER_INC(&pReNative->pVCpu->iem.s.StatNativeSimdRegFindFreeVar); 5439 5444 for (uint32_t iLoop = 0; iLoop < 2; iLoop++) 5440 5445 { 5441 uint32_t fVars = pReNative->Core.bm SimdVars;5446 uint32_t fVars = pReNative->Core.bmVars; 5442 5447 while (fVars) 5443 5448 { 5444 5449 uint32_t const idxVar = ASMBitFirstSetU32(fVars) - 1; 5445 uint8_t const idxReg = pReNative->Core.aSimdVars[idxVar].idxReg; 5450 uint8_t const idxReg = pReNative->Core.aVars[idxVar].idxReg; 5451 if (!pReNative->Core.aVars[idxVar].fSimdReg) /* Ignore non SIMD variables here. */ 5452 continue; 5453 5446 5454 if ( idxReg < RT_ELEMENTS(pReNative->Core.aHstSimdRegs) 5447 5455 && (RT_BIT_32(idxReg) & fRegMask) 5448 5456 && ( iLoop == 0 5449 ? pReNative->Core.a SimdVars[idxVar].enmKind != kIemNativeVarKind_Stack5450 : pReNative->Core.a SimdVars[idxVar].enmKind == kIemNativeVarKind_Stack)5451 && !pReNative->Core.a SimdVars[idxVar].fRegAcquired)5457 ? pReNative->Core.aVars[idxVar].enmKind != kIemNativeVarKind_Stack 5458 : pReNative->Core.aVars[idxVar].enmKind == kIemNativeVarKind_Stack) 5459 && !pReNative->Core.aVars[idxVar].fRegAcquired) 5452 5460 { 5453 Assert(pReNative->Core.bmHst Regs & RT_BIT_32(idxReg));5461 Assert(pReNative->Core.bmHstSimdRegs & RT_BIT_32(idxReg)); 5454 5462 Assert( (pReNative->Core.bmGstSimdRegShadows & pReNative->Core.aHstSimdRegs[idxReg].fGstRegShadows) 5455 5463 == pReNative->Core.aHstSimdRegs[idxReg].fGstRegShadows); 5456 Assert(pReNative->Core.bmGstSimdRegShadows < RT_BIT_64(kIemNativeGst Reg_End));5457 Assert( RT_BOOL(pReNative->Core.bmHst RegsWithGstShadow & RT_BIT_32(idxReg))5464 Assert(pReNative->Core.bmGstSimdRegShadows < RT_BIT_64(kIemNativeGstSimdReg_End)); 5465 Assert( RT_BOOL(pReNative->Core.bmHstSimdRegsWithGstShadow & RT_BIT_32(idxReg)) 5458 5466 == RT_BOOL(pReNative->Core.aHstSimdRegs[idxReg].fGstRegShadows)); 5459 5467 5460 if (pReNative->Core.a SimdVars[idxVar].enmKind == kIemNativeVarKind_Stack)5468 if (pReNative->Core.aVars[idxVar].enmKind == kIemNativeVarKind_Stack) 5461 5469 { 5462 5470 uint8_t const idxStackSlot = iemNativeVarGetStackSlot(pReNative, IEMNATIVE_VAR_IDX_PACK(idxVar)); … … 5464 5472 } 5465 5473 5466 pReNative->Core.a SimdVars[idxVar].idxReg= UINT8_MAX;5474 pReNative->Core.aVars[idxVar].idxReg = UINT8_MAX; 5467 5475 pReNative->Core.bmHstSimdRegs &= ~RT_BIT_32(idxReg); 5468 5476 5469 5477 pReNative->Core.bmHstSimdRegsWithGstShadow &= ~RT_BIT_32(idxReg); 5470 pReNative->Core.bmGstSimdRegShadows &= ~pReNative->Core.aHst SimdRegs[idxReg].fGstRegShadows;5478 pReNative->Core.bmGstSimdRegShadows &= ~pReNative->Core.aHstRegs[idxReg].fGstRegShadows; 5471 5479 pReNative->Core.aHstSimdRegs[idxReg].fGstRegShadows = 0; 5472 5480 return idxReg; … … 5475 5483 } 5476 5484 } 5477 #endif5478 5485 5479 5486 AssertFailed(); -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r103888 r103964 543 543 544 544 #ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR 545 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeSimdRegFindFree, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 546 "Number of calls to iemNativeSimdRegAllocFindFree.", 547 "/IEM/CPU%u/re/NativeSimdRegFindFree", idCpu); 548 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeSimdRegFindFreeVar, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 549 "Number of times iemNativeSimdRegAllocFindFree needed to free a variable.", 550 "/IEM/CPU%u/re/NativeSimdRegFindFreeVar", idCpu); 551 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeSimdRegFindFreeNoVar, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 552 "Number of times iemNativeSimdRegAllocFindFree did not needed to free any variables.", 553 "/IEM/CPU%u/re/NativeSimdRegFindFreeNoVar", idCpu); 554 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeSimdRegFindFreeLivenessUnshadowed, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 555 "Times liveness info freeed up shadowed guest registers in iemNativeSimdRegAllocFindFree.", 556 "/IEM/CPU%u/re/NativeSimdRegFindFreeLivenessUnshadowed", idCpu); 557 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeSimdRegFindFreeLivenessHelped, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, 558 "Times liveness info helped finding the return register in iemNativeSimdRegAllocFindFree.", 559 "/IEM/CPU%u/re/NativeSimdRegFindFreeLivenessHelped", idCpu); 560 545 561 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeMaybeDeviceNotAvailXcptCheckPotential, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Potential IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE() checks", "/IEM/CPU%u/re/NativeMaybeDeviceNotAvailXcptCheckPotential", idCpu); 546 562 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeMaybeSseXcptCheckPotential, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Potential IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT() checks", "/IEM/CPU%u/re/NativeMaybeSseXcptCheckPotential", idCpu); -
trunk/src/VBox/VMM/include/IEMInternal.h
r103955 r103964 1901 1901 1902 1902 #ifdef IEMNATIVE_WITH_SIMD_REG_ALLOCATOR 1903 /** Native recompiler: Number of calls to iemNativeSimdRegAllocFindFree. */ 1904 STAMCOUNTER StatNativeSimdRegFindFree; 1905 /** Native recompiler: Number of times iemNativeSimdRegAllocFindFree needed 1906 * to free a variable. */ 1907 STAMCOUNTER StatNativeSimdRegFindFreeVar; 1908 /** Native recompiler: Number of times iemNativeSimdRegAllocFindFree did 1909 * not need to free any variables. */ 1910 STAMCOUNTER StatNativeSimdRegFindFreeNoVar; 1911 /** Native recompiler: Liveness info freed shadowed guest registers in 1912 * iemNativeSimdRegAllocFindFree. */ 1913 STAMCOUNTER StatNativeSimdRegFindFreeLivenessUnshadowed; 1914 /** Native recompiler: Liveness info helped with the allocation in 1915 * iemNativeSimdRegAllocFindFree. */ 1916 STAMCOUNTER StatNativeSimdRegFindFreeLivenessHelped; 1917 1903 1918 /** Native recompiler: Number of potential IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE() checks. */ 1904 1919 STAMCOUNTER StatNativeMaybeDeviceNotAvailXcptCheckPotential; … … 1916 1931 #endif 1917 1932 1918 uint64_t au64Padding[ 2];1933 uint64_t au64Padding[5]; 1919 1934 /** @} */ 1920 1935
Note:
See TracChangeset
for help on using the changeset viewer.