Changeset 101557 in vbox for trunk/src/VBox/VMM/include
- Timestamp:
- Oct 23, 2023 2:39:59 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r101547 r101557 264 264 kIemNativeLabelType_Invalid = 0, 265 265 kIemNativeLabelType_Return, 266 #ifdef IEMNATIVE_WITH_TB_DEBUG_INFO 267 kIemNativeLabelType_If, 268 #endif 266 269 kIemNativeLabelType_Else, 267 270 kIemNativeLabelType_Endif, … … 477 480 478 481 /** 482 * Core state for the native recompiler, that is, things that needs careful 483 * handling when dealing with branches. 484 */ 485 typedef struct IEMNATIVECORESTATE 486 { 487 /** Allocation bitmap for aHstRegs. */ 488 uint32_t bmHstRegs; 489 490 /** Bitmap marking which host register contains guest register shadow copies. 491 * This is used during register allocation to try preserve copies. */ 492 uint32_t bmHstRegsWithGstShadow; 493 /** Bitmap marking valid entries in aidxGstRegShadows. */ 494 uint64_t bmGstRegShadows; 495 496 union 497 { 498 /** Index of variable arguments, UINT8_MAX if not valid. */ 499 uint8_t aidxArgVars[8]; 500 /** For more efficient resetting. */ 501 uint64_t u64ArgVars; 502 }; 503 504 /** Allocation bitmap for aVars. */ 505 uint32_t bmVars; 506 507 /** Maps a guest register to a host GPR (index by IEMNATIVEGSTREG). 508 * Entries are only valid if the corresponding bit in bmGstRegShadows is set. 509 * (A shadow copy of a guest register can only be held in a one host register, 510 * there are no duplicate copies or ambiguities like that). */ 511 uint8_t aidxGstRegShadows[kIemNativeGstReg_End]; 512 513 /** Host register allocation tracking. */ 514 IEMNATIVEHSTREG aHstRegs[IEMNATIVE_HST_GREG_COUNT]; 515 516 /** Variables and arguments. */ 517 IEMNATIVEVAR aVars[9]; 518 } IEMNATIVECORESTATE; 519 /** Pointer to core state. */ 520 typedef IEMNATIVECORESTATE *PIEMNATIVECORESTATE; 521 /** Pointer to const core state. */ 522 typedef IEMNATIVECORESTATE const *PCIEMNATIVECORESTATE; 523 524 525 /** 479 526 * Conditional stack entry. 480 527 */ … … 482 529 { 483 530 /** Set if we're in the "else" part, clear if we're in the "if" before it. */ 484 bool fInElse;531 bool fInElse; 485 532 /** The label for the IEM_MC_ELSE. */ 486 uint32_t idxLabelElse;533 uint32_t idxLabelElse; 487 534 /** The label for the IEM_MC_ENDIF. */ 488 uint32_t idxLabelEndIf; 535 uint32_t idxLabelEndIf; 536 /** The initial state snapshot as the if-block starts executing. */ 537 IEMNATIVECORESTATE InitialState; 538 /** The state snapshot at the end of the if-block. */ 539 IEMNATIVECORESTATE IfFinalState; 489 540 } IEMNATIVECOND; 490 541 /** Pointer to a condition stack entry. */ … … 504 555 uint32_t offInstrBufChecked; 505 556 #else 506 uint32_t uPadding ; /* We don't keep track of the size here... */557 uint32_t uPadding1; /* We don't keep track of the size here... */ 507 558 #endif 508 559 /** Fixed temporary code buffer for native recompilation. */ … … 531 582 /** Debug info. */ 532 583 PIEMTBDBG pDbgInfo; 533 #else534 uint32_t abPadding1[2];535 uintptr_t uPtrPadding2;536 584 #endif 537 585 … … 539 587 PCIEMTB pTbOrg; 540 588 541 /** Allocation bitmap fro aHstRegs. */542 uint32_t bmHstRegs;543 544 /** Bitmap marking which host register contains guest register shadow copies.545 * This is used during register allocation to try preserve copies. */546 uint32_t bmHstRegsWithGstShadow;547 /** Bitmap marking valid entries in aidxGstRegShadows. */548 uint64_t bmGstRegShadows;549 550 589 /** The current condition stack depth (aCondStack). */ 551 590 uint8_t cCondDepth; 552 uint8_t bPadding ;591 uint8_t bPadding2; 553 592 /** Condition sequence number (for generating unique labels). */ 554 593 uint16_t uCondSeqNo; 555 556 /** Allocation bitmap for aVars. */ 557 uint32_t bmVars; 558 union 559 { 560 /** Index of variable arguments, UINT8_MAX if not valid. */ 561 uint8_t aidxArgVars[8]; 562 /** For more efficient resetting. */ 563 uint64_t u64ArgVars; 564 }; 565 566 /** Host register allocation tracking. */ 567 IEMNATIVEHSTREG aHstRegs[IEMNATIVE_HST_GREG_COUNT]; 568 /** Maps a guest register to a host GPR (index by IEMNATIVEGSTREG). 569 * Entries are only valid if the corresponding bit in bmGstRegShadows is set. 570 * (A shadow copy of a guest register can only be held in a one host register, 571 * there are no duplicate copies or ambiguities like that). */ 572 uint8_t aidxGstRegShadows[kIemNativeGstReg_End]; 594 uint32_t uPadding3; 595 596 /** Core state requiring care with branches. */ 597 IEMNATIVECORESTATE Core; 573 598 574 599 /** The condition nesting stack. */ 575 IEMNATIVECOND aCondStack[4]; 576 577 /** Variables and arguments. */ 578 IEMNATIVEVAR aVars[16]; 600 IEMNATIVECOND aCondStack[2]; 579 601 } IEMRECOMPILERSTATE; 580 602 /** Pointer to a native recompiler state. */ … … 1521 1543 /* Best to use a temporary register to deal with this in the simplest way: */ 1522 1544 uint8_t iTmpReg = iemNativeRegAllocTmpImm(pReNative, &off, (uint64_t)iAddend); 1523 AssertReturn(iTmpReg < RT_ELEMENTS(pReNative-> aHstRegs), UINT32_MAX);1545 AssertReturn(iTmpReg < RT_ELEMENTS(pReNative->Core.aHstRegs), UINT32_MAX); 1524 1546 1525 1547 /* add dst, tmpreg */ … … 1548 1570 /* Use temporary register for the immediate. */ 1549 1571 uint8_t iTmpReg = iemNativeRegAllocTmpImm(pReNative, &off, (uint64_t)iAddend); 1550 AssertReturn(iTmpReg < RT_ELEMENTS(pReNative-> aHstRegs), UINT32_MAX);1572 AssertReturn(iTmpReg < RT_ELEMENTS(pReNative->Core.aHstRegs), UINT32_MAX); 1551 1573 1552 1574 /* add gprdst, gprdst, tmpreg */ … … 1602 1624 /* Use temporary register for the immediate. */ 1603 1625 uint8_t iTmpReg = iemNativeRegAllocTmpImm(pReNative, &off, (uint32_t)iAddend); 1604 AssertReturn(iTmpReg < RT_ELEMENTS(pReNative-> aHstRegs), UINT32_MAX);1626 AssertReturn(iTmpReg < RT_ELEMENTS(pReNative->Core.aHstRegs), UINT32_MAX); 1605 1627 1606 1628 /* add gprdst, gprdst, tmpreg */
Note:
See TracChangeset
for help on using the changeset viewer.