VirtualBox

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

VMM/IEM: Implemented iemNativeEmit_xor_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

    r103800 r103801  
    467467    uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
    468468#ifdef RT_ARCH_AMD64
    469     /* On AMD64 we just use the correctly size AND instruction harvest the EFLAGS. */
     469    /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */
    470470    off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off,
    471471                                                  0x22, 0x23, cOpBits, idxRegDst, idxRegSrc);
     
    500500    uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    501501#ifdef RT_ARCH_AMD64
    502     /* On AMD64 we just use the correctly size AND instruction harvest the EFLAGS. */
     502    /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */
    503503    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8);
    504504    off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 4, idxRegDst, uImmOp);
     
    556556                                       : iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
    557557#ifdef RT_ARCH_AMD64
    558     /* On AMD64 we just use the correctly size TEST instruction harvest the EFLAGS. */
     558    /* On AMD64 we just use the correctly sized TEST instruction harvest the EFLAGS. */
    559559    off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off,
    560560                                                  0x84, 0x85, cOpBits, idxRegSrc, idxRegDst);
     
    598598    uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    599599#ifdef RT_ARCH_AMD64
    600     /* On AMD64 we just use the correctly size AND instruction harvest the EFLAGS. */
     600    /* On AMD64 we just use the correctly sized AND instruction harvest the EFLAGS. */
    601601    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8);
    602602    off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0xf6, 0xcc, 0xf7, cOpBits, cImmBits, 0, idxRegDst, uImmOp);
     
    658658    uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
    659659#ifdef RT_ARCH_AMD64
    660     /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */
     660    /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */
    661661    off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off,
    662662                                                  0x0a, 0x0b, cOpBits, idxRegDst, idxRegSrc);
     
    692692    uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
    693693#ifdef RT_ARCH_AMD64
    694     /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */
     694    /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */
    695695    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8);
    696696    off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 1, idxRegDst, uImmOp);
     
    741741    uint8_t const idxRegSrc = iemNativeVarRegisterAcquire(pReNative, idxVarSrc, &off, true /*fInitialized*/);
    742742#ifdef RT_ARCH_AMD64
    743     /* On AMD64 we just use the correctly size OR instruction harvest the EFLAGS. */
     743    /* On AMD64 we just use the correctly sized OR instruction harvest the EFLAGS. */
    744744    off = iemNativeEmitAmd64OneByteModRmInstrRREx(iemNativeInstrBufEnsure(pReNative, off, 4), off,
    745745                                                  0x32, 0x33, cOpBits, idxRegDst, idxRegSrc);
     
    773773                          uint8_t idxVarDst, uint64_t uImmOp, uint8_t idxVarEfl, uint8_t cOpBits, uint8_t cImmBits)
    774774{
    775     RT_NOREF(pReNative, off, idxVarDst, uImmOp, idxVarEfl, cOpBits, cImmBits);
     775    uint8_t const idxRegDst = iemNativeVarRegisterAcquire(pReNative, idxVarDst, &off, true /*fInitialized*/);
     776#ifdef RT_ARCH_AMD64
     777    /* On AMD64 we just use the correctly sized XOR instruction harvest the EFLAGS. */
     778    PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8);
     779    off = iemNativeEmitAmd64OneByteModRmInstrRIEx(pCodeBuf, off, 0x80, 0x83, 0x81, cOpBits, cImmBits, 6, idxRegDst, uImmOp);
     780    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     781
     782    off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl);
     783
     784#elif defined(RT_ARCH_ARM64)
     785    /* On ARM64 we use 32-bit OR for the 8-bit and 16-bit bit ones, and of
     786       course the immediate variant when possible to save a register load.  */
     787    uint32_t uImmSizeLen, uImmRotations;
     788    if (  cOpBits > 32
     789        ? Armv8A64ConvertMask64ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations)
     790        : Armv8A64ConvertMask32ToImmRImmS(uImmOp, &uImmSizeLen, &uImmRotations))
     791    {
     792        PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1);
     793        pCodeBuf[off++] = Armv8A64MkInstrEorImm(idxRegDst, idxRegDst, uImmSizeLen, uImmRotations, cOpBits > 32 /*f64Bit*/);
     794    }
     795    else
     796    {
     797        uint8_t const idxRegTmpImm = iemNativeRegAllocTmpImm(pReNative, &off, uImmOp);
     798        PIEMNATIVEINSTR const pCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1);
     799        pCodeBuf[off++] = Armv8A64MkInstrEor(idxRegDst, idxRegDst, idxRegTmpImm, cOpBits > 32 /*f64Bit*/);
     800        iemNativeRegFreeTmpImm(pReNative, idxRegTmpImm);
     801    }
     802    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     803
     804    off = iemNativeEmitEFlagsForLogical(pReNative, off, idxVarEfl, cOpBits, idxRegDst);
     805    RT_NOREF_PV(cImmBits)
     806
     807#else
     808# error "Port me"
     809#endif
     810    iemNativeVarRegisterRelease(pReNative, idxVarDst);
    776811    return off;
    777812}
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