VirtualBox

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


Ignore:
Timestamp:
Nov 13, 2023 12:57:44 PM (18 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160193
Message:

VMM/IEM: Native translation of IEM_MC_FETCH_GREG_U8_THREADED. bugref:10371

File:
1 edited

Legend:

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

    r102068 r102082  
    662662    /* movzx Gv,Eb */
    663663    uint8_t * const pbCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 4);
    664     if ((iGprDst | iGprSrc) >= 8)
     664    if (iGprDst >= 8 || iGprSrc >= 8)
    665665        pbCodeBuf[off++] = iGprDst < 8  ? X86_OP_REX_B
    666666                         : iGprSrc >= 8 ? X86_OP_REX_R | X86_OP_REX_B
    667667                         :                X86_OP_REX_R;
     668    else if (iGprSrc >= 4)
     669        pbCodeBuf[off++] = X86_OP_REX;
    668670    pbCodeBuf[off++] = 0x0f;
    669671    pbCodeBuf[off++] = 0xb6;
     
    688690}
    689691
    690 #if 0 /** @todo */
     692
    691693/**
    692694 * Emits a gprdst = gprsrc[15:8] load (ah, ch, dh, bh).
     
    694696 */
    695697DECL_INLINE_THROW(uint32_t)
    696 iemNativeEmitLoadGprFromGpr8hi(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGprDst, uint8_t iGprSrc)
    697 {
    698 #ifdef RT_ARCH_AMD64
    699     /* movzx Gv,Eb */
    700     /** @todo */
    701     uint8_t * const pbCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 4);
     698iemNativeEmitLoadGprFromGpr8Hi(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGprDst, uint8_t iGprSrc)
     699{
     700#ifdef RT_ARCH_AMD64
     701    uint8_t * const pbCodeBuf = iemNativeInstrBufEnsure(pReNative, off, 8);
     702
     703    /* movzx Gv,Ew */
    702704    if ((iGprDst | iGprSrc) >= 8)
    703705        pbCodeBuf[off++] = iGprDst < 8  ? X86_OP_REX_B
     
    705707                         :                X86_OP_REX_R;
    706708    pbCodeBuf[off++] = 0x0f;
    707     pbCodeBuf[off++] = 0xb6;
     709    pbCodeBuf[off++] = 0xb7;
    708710    pbCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iGprDst & 7, iGprSrc & 7);
    709711
     712    /* shr Ev,8 */
     713    if (iGprDst >= 8)
     714        pbCodeBuf[off++] = X86_OP_REX_B;
     715    pbCodeBuf[off++] = 0xc1;
     716    pbCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, 5, iGprDst & 7);
     717    pbCodeBuf[off++] = 8;
     718
    710719#elif RT_ARCH_ARM64
    711     /* ubfx gprdst, gprsrc, #8, #8 */
     720    /* bfi gprdst, gprsrc, #8, #8 */
    712721    uint32_t * const pu32CodeBuf = iemNativeInstrBufEnsure(pReNative, off, 1);
    713     Assert(Armv8A64ConvertImmRImmS2Mask64(0x47, 0) == UINT8_MAX);
    714     pu32CodeBuf[off++] = /** @todo ubfx */;
     722    pu32CodeBuf[off++] = Armv8A64MkInstrBfi(iGprDst, iGprSrc, 8, 8, false /*f64Bit*/);
    715723
    716724#else
     
    720728    return off;
    721729}
    722 #endif
     730
    723731
    724732#ifdef RT_ARCH_AMD64
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