VirtualBox

Changeset 103782 in vbox


Ignore:
Timestamp:
Mar 11, 2024 5:25:09 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162151
Message:

VMM/IEM: Implement emitter for IEM_MC_FETCH_YREG_U64(), bugref:10614

Location:
trunk/src/VBox/VMM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py

    r103779 r103782  
    30983098    'IEM_MC_FETCH_YREG_U256':                                    (McBlock.parseMcGeneric,           False, False, False, ),
    30993099    'IEM_MC_FETCH_YREG_U32':                                     (McBlock.parseMcGeneric,           False, False, False, ),
    3100     'IEM_MC_FETCH_YREG_U64':                                     (McBlock.parseMcGeneric,           False, False, False, ),
     3100    'IEM_MC_FETCH_YREG_U64':                                     (McBlock.parseMcGeneric,           False, False, True, ),
    31013101    'IEM_MC_FLIP_EFL_BIT':                                       (McBlock.parseMcGeneric,           True,  True,  False, ),
    31023102    'IEM_MC_FPU_FROM_MMX_MODE':                                  (McBlock.parseMcGeneric,           True,  True,  False, ),
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r103779 r103782  
    1529315293    /* Free but don't flush the source register. */
    1529415294    iemNativeSimdRegFreeTmp(pReNative, idxSimdRegDst);
     15295    iemNativeVarRegisterRelease(pReNative, idxDstVar);
     15296
     15297    return off;
     15298}
     15299
     15300
     15301#define IEM_MC_FETCH_YREG_U64(a_u64Dst, a_iYRegSrc) \
     15302    off = iemNativeEmitSimdFetchYregU64(pReNative, off, a_u64Dst, a_iYRegSrc, 0)
     15303
     15304/** Emits code for IEM_MC_FETCH_YREG_U64. */
     15305DECL_INLINE_THROW(uint32_t)
     15306iemNativeEmitSimdFetchYregU64(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxDstVar, uint8_t iYReg, uint8_t iQWord)
     15307{
     15308    IEMNATIVE_ASSERT_VAR_IDX(pReNative, idxDstVar);
     15309    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxDstVar, sizeof(uint64_t));
     15310
     15311    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
     15312                                                                            iQWord >= 2
     15313                                                                          ? kIemNativeGstSimdRegLdStSz_High128
     15314                                                                          : kIemNativeGstSimdRegLdStSz_Low128,
     15315                                                                          kIemNativeGstRegUse_ReadOnly);
     15316
     15317    iemNativeVarSetKindToStack(pReNative, idxDstVar);
     15318    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off);
     15319
     15320    off = iemNativeEmitSimdLoadGprFromVecRegU64(pReNative, off, idxVarReg, idxSimdRegSrc, iQWord);
     15321
     15322    /* Free but don't flush the source register. */
     15323    iemNativeSimdRegFreeTmp(pReNative, idxSimdRegSrc);
    1529515324    iemNativeVarRegisterRelease(pReNative, idxDstVar);
    1529615325
  • trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h

    r103780 r103782  
    70937093{
    70947094#ifdef RT_ARCH_AMD64
    7095     /* pextrq gpr, vecsrc, #iQWord (ASSUMES SSE4.1). */
    7096     pCodeBuf[off++] = X86_OP_PRF_SIZE_OP;
    7097     pCodeBuf[off++] =   X86_OP_REX_W
    7098                       | (iVecRegSrc < 8 ? 0 : X86_OP_REX_R)
    7099                       | (iGprDst < 8 ? 0 : X86_OP_REX_B);
    7100     pCodeBuf[off++] = 0x0f;
    7101     pCodeBuf[off++] = 0x3a;
    7102     pCodeBuf[off++] = 0x16;
    7103     pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iVecRegSrc & 7, iGprDst & 7);
    7104     pCodeBuf[off++] = iQWord;
     7095    if (iQWord >= 2)
     7096    {
     7097        /** @todo Currently not used. */
     7098        AssertReleaseFailed();
     7099    }
     7100    else
     7101    {
     7102        /* pextrq gpr, vecsrc, #iQWord (ASSUMES SSE4.1). */
     7103        pCodeBuf[off++] = X86_OP_PRF_SIZE_OP;
     7104        pCodeBuf[off++] =   X86_OP_REX_W
     7105                          | (iVecRegSrc < 8 ? 0 : X86_OP_REX_R)
     7106                          | (iGprDst < 8 ? 0 : X86_OP_REX_B);
     7107        pCodeBuf[off++] = 0x0f;
     7108        pCodeBuf[off++] = 0x3a;
     7109        pCodeBuf[off++] = 0x16;
     7110        pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iVecRegSrc & 7, iGprDst & 7);
     7111        pCodeBuf[off++] = iQWord;
     7112    }
    71057113#elif defined(RT_ARCH_ARM64)
    71067114    /* umov gprdst, vecsrc[iQWord] */
     
    71197127iemNativeEmitSimdLoadGprFromVecRegU64(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGprDst, uint8_t iVecRegSrc, uint8_t iQWord)
    71207128{
    7121     Assert(iQWord <= 1);
     7129    Assert(iQWord <= 3);
    71227130
    71237131#ifdef RT_ARCH_AMD64
    71247132    off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 7), off, iGprDst, iVecRegSrc, iQWord);
    71257133#elif defined(RT_ARCH_ARM64)
    7126     off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc, iQWord);
     7134    /* ASSUMES that there are two adjacent 128-bit registers available for the 256-bit value. */
     7135    Assert(!(iVecRegSrc & 0x1));
     7136    /* Need to access the "high" 128-bit vector register. */
     7137    if (iQWord >= 2)
     7138        off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc + 1, iQWord - 2);
     7139    else
     7140        off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc,     iQWord);
    71277141#else
    71287142# error "port me"
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