VirtualBox

Ignore:
Timestamp:
Mar 11, 2024 10:31:33 PM (14 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162169
Message:

VMM/IEM: Implemented iemNativeEmit_or_r_i_efl and enabled it for both hosts. bugref:10376

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/target-x86/IEMAllN8veEmit-x86.h

    r103799 r103800  
    508508
    509509#elif defined(RT_ARCH_ARM64)
    510     /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones. */
     510    /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones, and of
     511       course the immediate variant when possible to save a register load. */
    511512    uint32_t uImmSizeLen, uImmRotations;
    512513    if (  cOpBits > 32
     
    606607
    607608#elif defined(RT_ARCH_ARM64)
    608     /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones.  We also
    609        need to keep the result in order to calculate the flags. */
     609    /* On ARM64 we use 32-bit AND for the 8-bit and 16-bit bit ones, and of
     610       course the immediate variant when possible to save a register load.
     611       We also need to keep the result in order to calculate the flags. */
    610612    uint8_t const         idxRegResult = iemNativeRegAllocTmp(pReNative, &off);
    611613    uint32_t uImmSizeLen, uImmRotations;
     
    688690                          uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl, uint8_t cOpBits, uint8_t cImmBits)
    689691{
    690     RT_NOREF(pReNative, off, idxVarDst, uImmOp, idxVarEfl, cOpBits, cImmBits);
     692    uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     693#ifdef RT_ARCH_AMD64
     694    /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */
     695    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8);
     696    off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 1, idxRegDst, uImmOp);
     697    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     698
     699    off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl);
     700
     701#elif defined(RT_ARCH_ARM64)
     702    /* On ARM64 we use 32-bit OR for the 8-bit and 16-bit bit ones, and of
     703       course the immediate variant when possible to save a register load.  */
     704    uint32_t uImmSizeLen, uImmRotations;
     705    if (  cOpBits > 32
     706        ? Armv8A64ConvertMask64ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations)
     707        : Armv8A64ConvertMask32ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations))
     708    {
     709        PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1);
     710        pCodeBuf[off++] = Armv8A64MkInstrOrrImm(idxRegDst, idxRegDst, uImmSizeLen, uImmRotations, cOpBits > 32 /*f64Bit*/);
     711    }
     712    else
     713    {
     714        uint8_t const idxRegTmpImm = iemNativeRegAllocTmpImm(pReNative, &off, uImmOp);
     715        PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1);
     716        pCodeBuf[off++] = Armv8A64MkInstrOrr(idxRegDst, idxRegDst, idxRegTmpImm, cOpBits > 32 /*f64Bit*/);
     717        iemNativeRegFreeTmpImm(pReNative, idxRegTmpImm);
     718    }
     719    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     720
     721    off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     722    RT_NOREF_PV(cImmBits)
     723
     724#else
     725# error "Port me"
     726#endif
     727    iemNativeVarRegisterRelease(pReNative, idxVarDst);
    691728    return off;
    692729}
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