Changeset 106090 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 19, 2024 9:13:54 AM (2 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veLiveness.h
r106078 r106090 65 65 IEMLIVENESSENTRY LiveState = { { 0, 0, 0, 0 } }; \ 66 66 IEMLIVENESSBIT LiveMask = { 0 }; \ 67 bool f DoneXpctOrCall= false67 bool fNoInherit = false 68 68 #endif 69 69 … … 85 85 #else 86 86 # define IEM_LIVENESS_MARK_POTENTIAL_CALL() do { \ 87 if (!fDoneXpctOrCall) \88 { \89 LiveState.aBits[IEMLIVENESS_BIT_READ].bm64 |= pIncoming->aBits[IEMLIVENESS_BIT_READ].bm64 & ~LiveMask.bm64; \90 LiveMask.bm64 |= IEMLIVENESSBIT_MASK; \91 fDoneXpctOrCall = true; \92 } \93 87 LiveState.aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 |= IEMLIVENESSBIT_MASK; \ 94 88 } while (0) 95 89 # define IEM_LIVENESS_MARK_CALL() do { \ 96 if (!fDoneXpctOrCall) \97 { \98 LiveState.aBits[IEMLIVENESS_BIT_READ].bm64 |= pIncoming->aBits[IEMLIVENESS_BIT_READ].bm64 & ~LiveMask.bm64; \99 LiveMask.bm64 |= IEMLIVENESSBIT_MASK; \100 fDoneXpctOrCall = true; \101 } \102 90 LiveState.aBits[IEMLIVENESS_BIT_CALL].bm64 |= IEMLIVENESSBIT_MASK; \ 91 LiveMask.bm64 |= IEMLIVENESSBIT_MASK; \ 92 fNoInherit = true; /* full mask */ \ 103 93 } while (0) 104 94 #endif … … 285 275 #else 286 276 # define IEM_MC_END() \ 287 /* Combine the incoming state with what we've accumulated in this block. */ \ 288 /* We can help the compiler by skipping OR'ing when having applied XPCT_OR_CALL, */ \ 289 /* since that already imports all the incoming state. Saves a lot with cl.exe. */ \ 290 if (!fDoneXpctOrCall) \ 277 /* Use the mask to effect inheriting. */ \ 278 if (!fNoInherit) \ 291 279 { \ 280 uint64_t const fInhMask = ~LiveMask.bm64; \ 292 281 pOutgoing->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 = LiveState.aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 \ 293 | (~LiveMask.bm64 & pIncoming->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64); \294 pOutgoing->aBits[IEMLIVENESS_BIT_READ ].bm64 = LiveState.aBits[IEMLIVENESS_BIT_READ].bm64 \295 | (~LiveMask.bm64 & pIncoming->aBits[IEMLIVENESS_BIT_READ].bm64); \282 | (pIncoming->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 & fInhMask); \ 283 pOutgoing->aBits[IEMLIVENESS_BIT_READ ].bm64 = LiveState.aBits[IEMLIVENESS_BIT_READ ].bm64 \ 284 | (pIncoming->aBits[IEMLIVENESS_BIT_READ ].bm64 & fInhMask); \ 296 285 pOutgoing->aBits[IEMLIVENESS_BIT_WRITE].bm64 = LiveState.aBits[IEMLIVENESS_BIT_WRITE].bm64 \ 297 | (~LiveMask.bm64 & pIncoming->aBits[IEMLIVENESS_BIT_WRITE].bm64); \298 pOutgoing->aBits[IEMLIVENESS_BIT_CALL ].bm64 = LiveState.aBits[IEMLIVENESS_BIT_CALL].bm64 \299 | (~LiveMask.bm64 & pIncoming->aBits[IEMLIVENESS_BIT_CALL].bm64); \286 | (pIncoming->aBits[IEMLIVENESS_BIT_WRITE].bm64 & fInhMask); \ 287 pOutgoing->aBits[IEMLIVENESS_BIT_CALL ].bm64 = LiveState.aBits[IEMLIVENESS_BIT_CALL ].bm64 \ 288 | (pIncoming->aBits[IEMLIVENESS_BIT_CALL ].bm64 & fInhMask); \ 300 289 } \ 301 290 else \ -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompBltIn.cpp
r106078 r106090 190 190 IEM_DECL_IEMNATIVELIVENESSFUNC_DEF(iemNativeLivenessFunc_BltIn_DeferToCImpl0) 191 191 { 192 IEM_LIVENESS_RAW_INIT_WITH_CALL _AND_POTENTIAL_CALL(pOutgoing, pIncoming);192 IEM_LIVENESS_RAW_INIT_WITH_CALL(pOutgoing, pIncoming); 193 193 RT_NOREF(pCallEntry); 194 194 } … … 393 393 IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 394 394 IEM_LIVENESS_RAW_EFLAGS_ONE_INPUT(pOutgoing, fEflOther); 395 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 395 396 RT_NOREF(pCallEntry); 396 397 } … … 411 412 { 412 413 IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 414 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 413 415 RT_NOREF(pCallEntry); 414 416 } … … 429 431 IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 430 432 IEM_LIVENESS_RAW_EFLAGS_ONE_INPUT(pOutgoing, fEflOther); 433 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 431 434 RT_NOREF(pCallEntry); 432 435 } … … 455 458 { 456 459 IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 460 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 457 461 RT_NOREF(pCallEntry); 458 462 } … … 1791 1795 IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1792 1796 LIVENESS_CHECK_CS_LIM(pOutgoing); 1797 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1793 1798 RT_NOREF(pCallEntry); 1794 1799 } … … 1819 1824 LIVENESS_CHECK_CS_LIM(pOutgoing); 1820 1825 LIVENESS_CHECK_OPCODES(pOutgoing); 1826 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1821 1827 RT_NOREF(pCallEntry); 1822 1828 } … … 1845 1851 IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1846 1852 LIVENESS_CHECK_OPCODES(pOutgoing); 1853 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1847 1854 RT_NOREF(pCallEntry); 1848 1855 } … … 1873 1880 LIVENESS_CONSIDER_CS_LIM_CHECKING(pOutgoing); 1874 1881 LIVENESS_CHECK_OPCODES(pOutgoing); 1882 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1875 1883 RT_NOREF(pCallEntry); 1876 1884 } … … 1911 1919 LIVENESS_CHECK_PC_AFTER_BRANCH(pOutgoing, pCallEntry); 1912 1920 LIVENESS_CHECK_OPCODES(pOutgoing); 1921 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1913 1922 RT_NOREF(pCallEntry); 1914 1923 } … … 1943 1952 LIVENESS_CHECK_PC_AFTER_BRANCH(pOutgoing, pCallEntry); 1944 1953 LIVENESS_CHECK_OPCODES(pOutgoing); 1954 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1945 1955 RT_NOREF(pCallEntry); 1946 1956 } … … 1978 1988 LIVENESS_CHECK_PC_AFTER_BRANCH(pOutgoing, pCallEntry); 1979 1989 LIVENESS_CHECK_OPCODES(pOutgoing); 1990 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 1980 1991 RT_NOREF(pCallEntry); 1981 1992 } … … 2016 2027 LIVENESS_LOAD_TLB_AFTER_BRANCH(pOutgoing, pCallEntry); 2017 2028 LIVENESS_CHECK_OPCODES(pOutgoing); 2029 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2018 2030 RT_NOREF(pCallEntry); 2019 2031 } … … 2052 2064 LIVENESS_LOAD_TLB_AFTER_BRANCH(pOutgoing, pCallEntry); 2053 2065 LIVENESS_CHECK_OPCODES(pOutgoing); 2066 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2054 2067 RT_NOREF(pCallEntry); 2055 2068 } … … 2090 2103 LIVENESS_LOAD_TLB_AFTER_BRANCH(pOutgoing, pCallEntry); 2091 2104 LIVENESS_CHECK_OPCODES(pOutgoing); 2105 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2092 2106 RT_NOREF(pCallEntry); 2093 2107 } … … 2134 2148 LIVENESS_CHECK_OPCODES(pOutgoing); 2135 2149 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2150 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2136 2151 RT_NOREF(pCallEntry); 2137 2152 } … … 2171 2186 LIVENESS_CHECK_OPCODES(pOutgoing); 2172 2187 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2188 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2173 2189 RT_NOREF(pCallEntry); 2174 2190 } … … 2211 2227 LIVENESS_CHECK_OPCODES(pOutgoing); 2212 2228 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2229 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2213 2230 RT_NOREF(pCallEntry); 2214 2231 } … … 2247 2264 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2248 2265 LIVENESS_CHECK_OPCODES(pOutgoing); 2266 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2249 2267 RT_NOREF(pCallEntry); 2250 2268 } … … 2281 2299 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2282 2300 LIVENESS_CHECK_OPCODES(pOutgoing); 2301 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2283 2302 RT_NOREF(pCallEntry); 2284 2303 } … … 2317 2336 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2318 2337 LIVENESS_CHECK_OPCODES(pOutgoing); 2338 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2319 2339 RT_NOREF(pCallEntry); 2320 2340 } … … 2349 2369 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2350 2370 LIVENESS_CHECK_OPCODES(pOutgoing); 2371 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2351 2372 RT_NOREF(pCallEntry); 2352 2373 } … … 2379 2400 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2380 2401 LIVENESS_CHECK_OPCODES(pOutgoing); 2402 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2381 2403 RT_NOREF(pCallEntry); 2382 2404 } … … 2412 2434 LIVENESS_LOAD_TLB_FOR_NEW_PAGE(pOutgoing, pCallEntry); 2413 2435 LIVENESS_CHECK_OPCODES(pOutgoing); 2436 IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(pOutgoing, pIncoming); 2414 2437 RT_NOREF(pCallEntry); 2415 2438 } … … 2459 2482 IEM_DECL_IEMNATIVELIVENESSFUNC_DEF(iemNativeLivenessFunc_BltIn_Jump) 2460 2483 { 2461 /* * @todo This isn't right:*/2462 IEM_LIVENESS_RAW_INIT_WITH_ POTENTIAL_CALL(pOutgoing, pIncoming);2463 RT_NOREF(pCallEntry); 2464 } 2465 2484 /* We could also use UNUSED here, but this'll is equivialent (at the moment). */ 2485 IEM_LIVENESS_RAW_INIT_WITH_CALL(pOutgoing, pIncoming); 2486 RT_NOREF(pCallEntry); 2487 } 2488 -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
r106078 r106090 5812 5812 { 5813 5813 pLivenessEntry->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 5814 & pLivenessEntry->aBits[IEMLIVENESS_BIT_WRITE].bm64 5814 5815 & ~( pLivenessEntry->aBits[IEMLIVENESS_BIT_READ].bm64 5815 5816 | pLivenessEntry->aBits[IEMLIVENESS_BIT_CALL].bm64) -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r106078 r106090 3173 3173 #ifdef IEMNATIVE_WITH_LIVENESS_ANALYSIS 3174 3174 /* 3175 * When we have liv ness information, we use it to kick out all shadowed3175 * When we have liveness information, we use it to kick out all shadowed 3176 3176 * guest register that will not be needed any more in this TB. If we're 3177 3177 * lucky, this may prevent us from ending up here again. … … 3185 3185 { 3186 3186 PCIEMLIVENESSENTRY const pLivenessEntry = &pReNative->paLivenessEntries[idxCurCall - 1]; 3187 3188 # ifndef IEMLIVENESS_EXTENDED_LAYOUT 3189 /* Construct a mask of the guest registers in the UNUSED and XCPT_OR_CALL state. */ 3190 AssertCompile(IEMLIVENESS_STATE_UNUSED == 1 && IEMLIVENESS_STATE_XCPT_OR_CALL == 2); 3191 uint64_t fToFreeMask = pLivenessEntry->Bit0.bm64 ^ pLivenessEntry->Bit1.bm64; /* mask of regs in either UNUSED */ 3192 #else 3193 /* Construct a mask of the registers not in the read or write state. 3194 Note! We could skips writes, if they aren't from us, as this is just 3195 a hack to prevent trashing registers that have just been written 3196 or will be written when we retire the current instruction. */ 3197 uint64_t fToFreeMask = ~pLivenessEntry->aBits[IEMLIVENESS_BIT_READ].bm64 3198 & ~pLivenessEntry->aBits[IEMLIVENESS_BIT_WRITE].bm64 3199 & IEMLIVENESSBIT_MASK; 3200 #endif 3187 uint64_t fToFreeMask = IEMLIVENESS_STATE_GET_CAN_BE_FREED_SET(pLivenessEntry); 3188 3201 3189 /* Merge EFLAGS. */ 3202 3190 uint64_t fTmp = fToFreeMask & (fToFreeMask >> 3); /* AF2,PF2,CF2,Other2 = AF,PF,CF,Other & OF,SF,ZF,AF */ … … 4944 4932 { 4945 4933 PCIEMLIVENESSENTRY const pLivenessEntry = &pReNative->paLivenessEntries[idxCurCall - 1]; 4946 4947 # ifndef IEMLIVENESS_EXTENDED_LAYOUT 4948 /* Construct a mask of the guest registers in the UNUSED and XCPT_OR_CALL state. */ 4949 AssertCompile(IEMLIVENESS_STATE_UNUSED == 1 && IEMLIVENESS_STATE_XCPT_OR_CALL == 2); 4950 uint64_t fToFreeMask = pLivenessEntry->Bit0.bm64 ^ pLivenessEntry->Bit1.bm64; /* mask of regs in either UNUSED */ 4951 #else 4952 /* Construct a mask of the registers not in the read or write state. 4953 Note! We could skips writes, if they aren't from us, as this is just 4954 a hack to prevent trashing registers that have just been written 4955 or will be written when we retire the current instruction. */ 4956 uint64_t fToFreeMask = ~pLivenessEntry->aBits[IEMLIVENESS_BIT_READ].bm64 4957 & ~pLivenessEntry->aBits[IEMLIVENESS_BIT_WRITE].bm64 4958 & IEMLIVENESSBIT_MASK; 4959 #endif 4934 uint64_t const fToFreeMask = IEMLIVENESS_STATE_GET_CAN_BE_FREED_SET(pLivenessEntry); 4935 4960 4936 /* If it matches any shadowed registers. */ 4961 4937 if (pReNative->Core.bmGstRegShadows & fToFreeMask) … … 6537 6513 6538 6514 return off; 6515 } 6516 6517 6518 /** 6519 * The default liveness function, matching iemNativeEmitThreadedCall. 6520 */ 6521 IEM_DECL_IEMNATIVELIVENESSFUNC_DEF(iemNativeLivenessFunc_ThreadedCall) 6522 { 6523 IEM_LIVENESS_RAW_INIT_WITH_CALL(pOutgoing, pIncoming); 6524 RT_NOREF(pCallEntry); 6539 6525 } 6540 6526 … … 10012 9998 { 10013 9999 PFNIEMNATIVELIVENESSFUNC const pfnLiveness = g_apfnIemNativeLivenessFunctions[pCallEntry->enmFunction]; 10014 if (pfnLiveness) 10015 pfnLiveness(pCallEntry, &paLivenessEntries[idxCall], &paLivenessEntries[idxCall - 1]); 10016 else 10017 IEM_LIVENESS_RAW_INIT_WITH_CALL_AND_POTENTIAL_CALL(&paLivenessEntries[idxCall - 1], &paLivenessEntries[idxCall]); 10000 Assert(pfnLiveness); 10001 pfnLiveness(pCallEntry, &paLivenessEntries[idxCall], &paLivenessEntries[idxCall - 1]); 10018 10002 pCallEntry--; 10019 10003 idxCall--; 10020 10004 } 10021 10022 # ifdef VBOX_WITH_STATISTICS10023 /* Check if there are any EFLAGS optimization to be had here. This requires someone settings them10024 to 'clobbered' rather that 'input'. */10025 /** @todo */10026 # endif10027 10005 } 10028 10006 #endif … … 10143 10121 static const char s_achState[] = "CUXI"; 10144 10122 # else 10145 static const char s_achState[] = "UxRrWwMmCcQqKkNn"; 10123 /* 0123 4567 89ab cdef */ 10124 /* CCCC CCCC */ 10125 /* WWWW WWWW */ 10126 /* RR RR RR RR */ 10127 /* P P P P P P P P */ 10128 static const char s_achState[] = "UxRr" "WwMm" "CcQq" "KkNn"; 10146 10129 # endif 10147 10130 -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py
r106061 r106090 3587 3587 oOut.write(' iemNativeLivenessFunc_BltIn_%s,\n' % (sFuncNm,)) 3588 3588 else: 3589 oOut.write(' NULL, /*BltIn_%s*/\n' % (sFuncNm,))3589 oOut.write(' iemNativeLivenessFunc_ThreadedCall, /*BltIn_%s*/\n' % (sFuncNm,)) 3590 3590 3591 3591 iThreadedFunction = 1 + len(self.katBltIns); … … 3603 3603 oOut.write(' /*%4u*/ %s,\n' % (iThreadedFunction, sName,)); 3604 3604 else: 3605 oOut.write(' /*%4u*/ NULL/*%s*/,\n' % (iThreadedFunction, sName,));3605 oOut.write(' /*%4u*/ iemNativeLivenessFunc_ThreadedCall /*%s*/,\n' % (iThreadedFunction, sName,)); 3606 3606 3607 3607 oOut.write( '};\n' -
trunk/src/VBox/VMM/VMMR3/IEMR3.cpp
r106061 r106090 738 738 "/IEM/CPU%u/re/NativeEFlagsSkippedLogical", idCpu); 739 739 740 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.CF updating", "/IEM/CPU%u/re/NativeLivenessEFlags CfSkippable", idCpu);741 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflPfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.PF updating", "/IEM/CPU%u/re/NativeLivenessEFlags PfSkippable", idCpu);742 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflAfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.AF updating", "/IEM/CPU%u/re/NativeLivenessEFlags AfSkippable", idCpu);743 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflZfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.ZF updating", "/IEM/CPU%u/re/NativeLivenessEFlags ZfSkippable", idCpu);744 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflSfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.SF updating", "/IEM/CPU%u/re/NativeLivenessEFlags SfSkippable", idCpu);745 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflOfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.OF updating", "/IEM/CPU%u/re/NativeLivenessEFlags OfSkippable", idCpu);746 747 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.CF updating", "/IEM/CPU%u/re/NativeLivenessEFlags CfRequired", idCpu);748 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflPfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.PF updating", "/IEM/CPU%u/re/NativeLivenessEFlags PfRequired", idCpu);749 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflAfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.AF updating", "/IEM/CPU%u/re/NativeLivenessEFlags AfRequired", idCpu);750 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflZfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.ZF updating", "/IEM/CPU%u/re/NativeLivenessEFlags ZfRequired", idCpu);751 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflSfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.SF updating", "/IEM/CPU%u/re/NativeLivenessEFlags SfRequired", idCpu);752 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflOfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.OF updating", "/IEM/CPU%u/re/NativeLivenessEFlags OfRequired", idCpu);740 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.CF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/CfSkippable", idCpu); 741 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflPfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.PF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/PfSkippable", idCpu); 742 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflAfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.AF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/AfSkippable", idCpu); 743 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflZfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.ZF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/ZfSkippable", idCpu); 744 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflSfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.SF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/SfSkippable", idCpu); 745 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflOfSkippable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Skippable EFLAGS.OF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/OfSkippable", idCpu); 746 747 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.CF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/CfRequired", idCpu); 748 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflPfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.PF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/PfRequired", idCpu); 749 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflAfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.AF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/AfRequired", idCpu); 750 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflZfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.ZF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/ZfRequired", idCpu); 751 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflSfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.SF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/SfRequired", idCpu); 752 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflOfRequired, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Required EFLAGS.OF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/OfRequired", idCpu); 753 753 754 754 # ifdef IEMLIVENESS_EXTENDED_LAYOUT 755 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.CF updating", "/IEM/CPU%u/re/NativeLivenessEFlags CfDelayable", idCpu);756 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflPfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.PF updating", "/IEM/CPU%u/re/NativeLivenessEFlags PfDelayable", idCpu);757 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflAfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.AF updating", "/IEM/CPU%u/re/NativeLivenessEFlags AfDelayable", idCpu);758 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflZfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.ZF updating", "/IEM/CPU%u/re/NativeLivenessEFlags ZfDelayable", idCpu);759 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflSfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.SF updating", "/IEM/CPU%u/re/NativeLivenessEFlags SfDelayable", idCpu);760 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflOfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.OF updating", "/IEM/CPU%u/re/NativeLivenessEFlags OfDelayable", idCpu);755 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflCfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.CF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/CfDelayable", idCpu); 756 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflPfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.PF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/PfDelayable", idCpu); 757 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflAfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.AF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/AfDelayable", idCpu); 758 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflZfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.ZF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/ZfDelayable", idCpu); 759 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflSfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.SF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/SfDelayable", idCpu); 760 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeLivenessEflOfDelayable, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Maybe delayable EFLAGS.OF updating", "/IEM/CPU%u/re/NativeLivenessEFlags/OfDelayable", idCpu); 761 761 # endif 762 762 763 763 /* Sum up all status bits ('_' is a sorting hack). */ 764 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags ?fSkippable*", idCpu);764 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/?fSkippable*", idCpu); 765 765 STAMR3RegisterSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, szPat, "Total skippable EFLAGS status bit updating", 766 "/IEM/CPU%u/re/NativeLivenessEFlags _StatusSkippable", idCpu);767 768 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags ?fRequired*", idCpu);766 "/IEM/CPU%u/re/NativeLivenessEFlags/totalSkippable", idCpu); 767 768 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/?fRequired*", idCpu); 769 769 STAMR3RegisterSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, szPat, "Total required STATUS status bit updating", 770 "/IEM/CPU%u/re/NativeLivenessEFlags _StatusRequired", idCpu);770 "/IEM/CPU%u/re/NativeLivenessEFlags/totalRequired", idCpu); 771 771 772 772 # ifdef IEMLIVENESS_EXTENDED_LAYOUT 773 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags ?fDelayable*", idCpu);773 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/?fDelayable*", idCpu); 774 774 STAMR3RegisterSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, szPat, "Total potentially delayable STATUS status bit updating", 775 "/IEM/CPU%u/re/NativeLivenessEFlags _StatusDelayable", idCpu);775 "/IEM/CPU%u/re/NativeLivenessEFlags/totalDelayable", idCpu); 776 776 # endif 777 777 778 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags ?f*", idCpu);778 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/?f*", idCpu); 779 779 STAMR3RegisterSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, szPat, "Total STATUS status bit events of any kind", 780 "/IEM/CPU%u/re/NativeLivenessEFlags _StatusTotal", idCpu);781 782 /* Ratio of the status bit skippables. */783 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags _StatusTotal", idCpu);784 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags _StatusSkippable", idCpu);780 "/IEM/CPU%u/re/NativeLivenessEFlags/totalTotal", idCpu); 781 782 /* Corresponding ratios / percentages of the totals. */ 783 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/totalTotal", idCpu); 784 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags/totalSkippable", idCpu); 785 785 STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat, 786 786 "Total skippable EFLAGS status bit updating percentage", 787 "/IEM/CPU%u/re/NativeLivenessEFlags_StatusSkippablePct", idCpu); 787 "/IEM/CPU%u/re/NativeLivenessEFlags/totalSkippablePct", idCpu); 788 789 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/totalTotal", idCpu); 790 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags/totalRequired", idCpu); 791 STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat, 792 "Total required EFLAGS status bit updating percentage", 793 "/IEM/CPU%u/re/NativeLivenessEFlags/totalRequiredPct", idCpu); 788 794 789 795 # ifdef IEMLIVENESS_EXTENDED_LAYOUT 790 /* Ratio of the status bit skippables. */ 791 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags_StatusDelayable", idCpu); 796 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags/totalDelayable", idCpu); 792 797 STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat, 793 798 "Total potentially delayable EFLAGS status bit updating percentage", 794 "/IEM/CPU%u/re/NativeLivenessEFlags _StatusDelayablePct", idCpu);799 "/IEM/CPU%u/re/NativeLivenessEFlags/totalDelayablePct", idCpu); 795 800 # endif 796 801 797 802 /* Ratios of individual bits. */ 798 size_t const offFlagChar = RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags Cf*", idCpu) - 3;803 size_t const offFlagChar = RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativeLivenessEFlags/Cf*", idCpu) - 3; 799 804 Assert(szPat[offFlagChar] == 'C'); 800 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags CfSkippable", idCpu);805 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativeLivenessEFlags/CfSkippable", idCpu); 801 806 Assert(szVal[offFlagChar] == 'C'); 802 szPat[offFlagChar] = szVal[offFlagChar] = 'C'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.CF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlagsCfSkippablePct", idCpu); 803 szPat[offFlagChar] = szVal[offFlagChar] = 'P'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.PF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlagsPfSkippablePct", idCpu); 804 szPat[offFlagChar] = szVal[offFlagChar] = 'A'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.AF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlagsAfSkippablePct", idCpu); 805 szPat[offFlagChar] = szVal[offFlagChar] = 'Z'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.ZF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlagsZfSkippablePct", idCpu); 806 szPat[offFlagChar] = szVal[offFlagChar] = 'S'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.SF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlagsSfSkippablePct", idCpu); 807 szPat[offFlagChar] = szVal[offFlagChar] = 'O'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.OF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlagsOfSkippablePct", idCpu); 808 807 szPat[offFlagChar] = szVal[offFlagChar] = 'C'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.CF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlags/CfSkippablePct", idCpu); 808 szPat[offFlagChar] = szVal[offFlagChar] = 'P'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.PF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlags/PfSkippablePct", idCpu); 809 szPat[offFlagChar] = szVal[offFlagChar] = 'A'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.AF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlags/AfSkippablePct", idCpu); 810 szPat[offFlagChar] = szVal[offFlagChar] = 'Z'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.ZF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlags/ZfSkippablePct", idCpu); 811 szPat[offFlagChar] = szVal[offFlagChar] = 'S'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.SF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlags/SfSkippablePct", idCpu); 812 szPat[offFlagChar] = szVal[offFlagChar] = 'O'; STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, true, szPat, "Skippable EFLAGS.OF updating percentage", "/IEM/CPU%u/re/NativeLivenessEFlags/OfSkippablePct", idCpu); 813 814 /* PC updates total and skipped, with PCT ratio. */ 809 815 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativePcUpdateTotal, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Total RIP updates", "/IEM/CPU%u/re/NativePcUpdateTotal", idCpu); 810 816 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativePcUpdateDelayed, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, "Delayed RIP updates", "/IEM/CPU%u/re/NativePcUpdateDelayed", idCpu); 817 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativePcUpdateTotal", idCpu); 818 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativePcUpdateDelayed", idCpu); 819 STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat, 820 "Delayed RIP updating percentage", 821 "/IEM/CPU%u/re/NativePcUpdateDelayed_StatusDelayedPct", idCpu); 822 811 823 # endif /* VBOX_WITH_STATISTICS */ 812 824 # ifdef IEMNATIVE_WITH_DELAYED_REGISTER_WRITEBACK … … 851 863 "/IEM/CPU%u/re/NativeMaybeAvxXcptCheckOmitted", idCpu); 852 864 # endif 853 854 /* Ratio of the status bit skippables. */855 RTStrPrintf(szPat, sizeof(szPat), "/IEM/CPU%u/re/NativePcUpdateTotal", idCpu);856 RTStrPrintf(szVal, sizeof(szVal), "/IEM/CPU%u/re/NativePcUpdateDelayed", idCpu);857 STAMR3RegisterPctOfSum(pVM->pUVM, STAMVISIBILITY_ALWAYS, STAMUNIT_PCT, szVal, false, szPat,858 "Delayed RIP updating percentage",859 "/IEM/CPU%u/re/NativePcUpdateDelayed_StatusDelayedPct", idCpu);860 865 861 866 STAMR3RegisterF(pVM, &pVCpu->iem.s.StatNativeTbFinished, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_COUNT, -
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r106078 r106090 714 714 /** @name 64-bit value masks for IEMLIVENESSENTRY. 715 715 * @{ */ /* 0xzzzzyyyyxxxxwwww */ 716 /** @todo Changing this to 0x003ffffffffffffe would reduce the liveness code 717 * size by 3.2% on arm in extended layout. That means moving kIemNativeGstReg_Pc 718 * to zero, which may have other consequences so needs to be tested in full first. */ 716 719 #define IEMLIVENESSBIT_MASK UINT64_C(0x003ffffffffeffff) 717 720 … … 749 752 * state and when merging in incoming state for registers not touched by the 750 753 * current call. 754 * 755 * 756 * Extended Layout: 757 * 758 * The extended layout variation differs from the above as it records the 759 * different register accesses as individual bits, and it is currently used for 760 * the delayed EFLAGS calculation experiments. The latter means that 761 * calls/tb-exits and potential calls/exceptions/tb-exits are recorded 762 * separately so the latter can be checked for in combination with clobbering. 751 763 * 752 764 * @{ */ … … 796 808 # define IEMLIVENESS_STATE_BIT_COUNT 2 797 809 798 /** Check if we're expecting read & write accesses to a register with the given (previous) liveness state. */ 810 /** Check if we're expecting read & write accesses to a register with the given (previous) liveness state. 811 * @note only used in assertions. */ 799 812 # define IEMLIVENESS_STATE_IS_MODIFY_EXPECTED(a_uState) ((uint32_t)((a_uState) - 1U) >= (uint32_t)(IEMLIVENESS_STATE_INPUT - 1U)) 800 /** Check if we're expecting read accesses to a register with the given (previous) liveness state. */ 813 /** Check if we're expecting read accesses to a register with the given (previous) liveness state. 814 * @note only used in assertions. */ 801 815 # define IEMLIVENESS_STATE_IS_INPUT_EXPECTED(a_uState) IEMLIVENESS_STATE_IS_MODIFY_EXPECTED(a_uState) 802 816 /** Check if a register clobbering is expected given the (previous) liveness state. 803 817 * The state must be either CLOBBERED or XCPT_OR_CALL, but it may also 804 * include INPUT if the register is used in more than one place. */ 818 * include INPUT if the register is used in more than one place. 819 * @note only used in assertions. */ 805 820 # define IEMLIVENESS_STATE_IS_CLOBBER_EXPECTED(a_uState) ((uint32_t)(a_uState) != IEMLIVENESS_STATE_UNUSED) 806 821 807 822 /** Check if all status flags are going to be clobbered and doesn't need 808 823 * calculating in the current step. 809 * @param a_pCurEntry The current liveness entry. */ 810 # define IEMLIVENESS_STATE_ARE_STATUS_EFL_TO_BE_CLOBBERED(a_pCurEntry) \ 824 * @param a_pCurEntry The current liveness entry. 825 * @note Used by actual code. */ 826 # define IEMLIVENESS_STATE_ARE_STATUS_EFL_TO_BE_CLOBBERED(a_pCurEntry) \ 811 827 ( (((a_pCurEntry)->Bit0.bm64 | (a_pCurEntry)->Bit1.bm64) & IEMLIVENESSBIT_STATUS_EFL_MASK) == 0 ) 828 829 /** Construct a mask of the guest registers in the UNUSED and XCPT_OR_CALL 830 * states, as these are no longer needed. 831 * @param a_pCurEntry The current liveness entry. 832 * @note Used by actual code. */ 833 AssertCompile(IEMLIVENESS_STATE_UNUSED == 1 && IEMLIVENESS_STATE_XCPT_OR_CALL == 2); 834 # define IEMLIVENESS_STATE_GET_CAN_BE_FREED_SET(a_pCurEntry) \ 835 ( (a_pCurEntry)->Bit0.bm64 ^ (a_pCurEntry)->Bit1.bm64 ) 836 812 837 813 838 #else /* IEMLIVENESS_EXTENDED_LAYOUT */ … … 839 864 & IEMLIVENESSBIT_STATUS_EFL_MASK) ) 840 865 866 /** Construct a mask of the registers not in the read or write state. 867 * @note We could skips writes, if they aren't from us, as this is just a hack 868 * to prevent trashing registers that have just been written or will be 869 * written when we retire the current instruction. 870 * @param a_pCurEntry The current liveness entry. 871 * @note Used by actual code. */ 872 # define IEMLIVENESS_STATE_GET_CAN_BE_FREED_SET(a_pCurEntry) \ 873 ( ~(a_pCurEntry)->aBits[IEMLIVENESS_BIT_READ].bm64 \ 874 & ~(a_pCurEntry)->aBits[IEMLIVENESS_BIT_WRITE].bm64 \ 875 & IEMLIVENESSBIT_MASK ) 876 877 841 878 #endif /* IEMLIVENESS_EXTENDED_LAYOUT */ 842 879 /** @} */ … … 866 903 867 904 /** Initializing the outgoing state with a potential xcpt or call state. 868 * This only works when all later changes will be IEMLIVENESS_STATE_INPUT. */ 905 * This only works when all later changes will be IEMLIVENESS_STATE_INPUT. 906 * 907 * @note Must invoke IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL when done! 908 */ 869 909 #ifndef IEMLIVENESS_EXTENDED_LAYOUT 870 910 # define IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL(a_pOutgoing, a_pIncoming) \ … … 877 917 do { \ 878 918 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 = IEMLIVENESSBIT_MASK; \ 879 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 = (a_pIncoming)->aBits[IEMLIVENESS_BIT_READ].bm64; \919 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 = 0; \ 880 920 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_WRITE ].bm64 = 0; \ 881 921 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL ].bm64 = 0; \ … … 883 923 #endif 884 924 925 /** Completes IEM_LIVENESS_RAW_INIT_WITH_POTENTIAL_CALL after applying any 926 * other state modifications. 927 */ 928 #ifndef IEMLIVENESS_EXTENDED_LAYOUT 929 # define IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(a_pOutgoing, a_pIncoming) ((void)0) 930 #else 931 # define IEM_LIVENESS_RAW_FINISH_WITH_POTENTIAL_CALL(a_pOutgoing, a_pIncoming) \ 932 do { \ 933 uint64_t const fInhMask = ~( (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL].bm64 \ 934 | (a_pOutgoing)->aBits[IEMLIVENESS_BIT_WRITE].bm64); \ 935 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 |= (a_pIncoming)->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 & fInhMask; \ 936 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 |= (a_pIncoming)->aBits[IEMLIVENESS_BIT_READ].bm64 & fInhMask; \ 937 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_WRITE ].bm64 |= (a_pIncoming)->aBits[IEMLIVENESS_BIT_WRITE].bm64 & fInhMask; \ 938 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL ].bm64 |= (a_pIncoming)->aBits[IEMLIVENESS_BIT_CALL].bm64 & fInhMask; \ 939 } while (0) 940 #endif 941 885 942 /** Initializing the outgoing state with an unconditional call state. 886 * This only works when all later changes will be IEMLIVENESS_STATE_INPUT. */943 * This should only really be used alone. */ 887 944 #ifndef IEMLIVENESS_EXTENDED_LAYOUT 888 945 # define IEM_LIVENESS_RAW_INIT_WITH_CALL(a_pOutgoing, a_pIncoming) \ … … 894 951 # define IEM_LIVENESS_RAW_INIT_WITH_CALL(a_pOutgoing, a_pIncoming) \ 895 952 do { \ 953 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL ].bm64 = IEMLIVENESSBIT_MASK; \ 896 954 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 = 0; \ 897 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 = (a_pIncoming)->aBits[IEMLIVENESS_BIT_READ].bm64; \955 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 = 0; \ 898 956 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_WRITE ].bm64 = 0; \ 899 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL ].bm64 = IEMLIVENESSBIT_MASK; \957 RT_NOREF(a_pIncoming); \ 900 958 } while (0) 901 959 #endif 902 960 961 #if 0 /* unused */ 903 962 /** Initializing the outgoing state with an unconditional call state as well as 904 963 * an potential call/exception preceeding it. 905 * This should only be used alone, really. */964 * This should only really be used alone. */ 906 965 #ifndef IEMLIVENESS_EXTENDED_LAYOUT 907 966 # define IEM_LIVENESS_RAW_INIT_WITH_CALL_AND_POTENTIAL_CALL(a_pOutgoing, a_pIncoming) \ … … 914 973 do { \ 915 974 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_POTENTIAL_CALL].bm64 = IEMLIVENESSBIT_MASK; \ 916 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 = (a_pIncoming)->aBits[IEMLIVENESS_BIT_READ].bm64; \ 975 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL ].bm64 = IEMLIVENESSBIT_MASK; \ 976 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_READ ].bm64 = 0; \ 917 977 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_WRITE ].bm64 = 0; \ 918 (a_pOutgoing)->aBits[IEMLIVENESS_BIT_CALL ].bm64 = IEMLIVENESSBIT_MASK; \919 978 } while (0) 979 #endif 920 980 #endif 921 981 … … 1863 1923 DECL_HIDDEN_THROW(uint32_t) iemNativeEmitThreadedCall(PIEMRECOMPILERSTATE pReNative, uint32_t off, 1864 1924 PCIEMTHRDEDCALLENTRY pCallEntry); 1925 IEM_DECL_IEMNATIVELIVENESSFUNC_PROTO(iemNativeLivenessFunc_ThreadedCall); 1865 1926 DECL_HIDDEN_THROW(uint32_t) iemNativeEmitLeaGprByGstRegRef(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxGprDst, 1866 1927 IEMNATIVEGSTREGREF enmClass, uint8_t idxRegInClass);
Note:
See TracChangeset
for help on using the changeset viewer.