VirtualBox

Changeset 102065 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Nov 10, 2023 4:14:51 PM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160174
Message:

VMM/IEM: Native translation of IEM_MC_STORE_GREG_U16. Fixed a bunch of variable, register & stack allocator issues. bugref:10371

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMN8veRecompiler.h

    r102022 r102065  
    804804/**
    805805 * Checks that we didn't exceed the space requested in the last
    806  * iemNativeInstrBufEnsure() call. */
     806 * iemNativeInstrBufEnsure() call.
     807 */
    807808#define IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(a_pReNative, a_off) \
    808809    AssertMsg((a_off) <= (a_pReNative)->offInstrBufChecked, \
    809810              ("off=%#x offInstrBufChecked=%#x\n", (a_off), (a_pReNative)->offInstrBufChecked))
    810811
     812/**
     813 * Checks that a variable index is valid.
     814 */
     815#define IEMNATIVE_ASSERT_VAR_IDX(a_pReNative, a_idxVar) \
     816    AssertMsg(   (unsigned)(a_idxVar) < RT_ELEMENTS((a_pReNative)->Core.aVars) \
     817              && ((a_pReNative)->Core.bmVars & RT_BIT_32(a_idxVar)), ("%s=%d\n", #a_idxVar, a_idxVar))
     818
     819/**
     820 * Calculates the stack address of a variable as a [r]BP displacement value.
     821 */
     822DECL_FORCE_INLINE(int32_t)
     823iemNativeStackCalcBpDisp(uint8_t idxStackSlot)
     824{
     825    Assert(idxStackSlot < IEMNATIVE_FRAME_VAR_SLOTS);
     826    return idxStackSlot * sizeof(uint64_t) + IEMNATIVE_FP_OFF_STACK_VARS;
     827}
     828
     829/**
     830 * Calculates the stack address of a variable as a [r]BP displacement value.
     831 */
     832DECL_FORCE_INLINE(int32_t)
     833iemNativeVarCalcBpDisp(PIEMRECOMPILERSTATE pReNative, uint8_t idxVar)
     834{
     835    return iemNativeStackCalcBpDisp(pReNative->Core.aVars[idxVar].idxStackSlot);
     836}
     837
    811838/** @} */
    812839
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette