VirtualBox

Changeset 103761 in vbox


Ignore:
Timestamp:
Mar 11, 2024 12:07:32 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
162130
Message:

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

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

Legend:

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

    r103759 r103761  
    30873087    'IEM_MC_FETCH_XREG_U16':                                     (McBlock.parseMcGeneric,           False, False, False, ),
    30883088    'IEM_MC_FETCH_XREG_U32':                                     (McBlock.parseMcGeneric,           False, False, False, ),
    3089     'IEM_MC_FETCH_XREG_U64':                                     (McBlock.parseMcGeneric,           False, False, False, ),
     3089    'IEM_MC_FETCH_XREG_U64':                                     (McBlock.parseMcGeneric,           False, False, True, ),
    30903090    'IEM_MC_FETCH_XREG_U8':                                      (McBlock.parseMcGeneric,           False, False, False, ),
    30913091    'IEM_MC_FETCH_XREG_XMM':                                     (McBlock.parseMcGeneric,           False, False, False, ),
  • TabularUnified trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r103760 r103761  
    1513115131    off = iemNativeEmitSimdCopyXregU128(pReNative, off, a_iXRegDst, a_iXRegSrc)
    1513215132
    15133 /** Emits code for IEM_MC_FETCH_FSW. */
     15133/** Emits code for IEM_MC_COPY_XREG_U128. */
    1513415134DECL_INLINE_THROW(uint32_t)
    1513515135iemNativeEmitSimdCopyXregU128(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iXRegDst, uint8_t iXRegSrc)
     
    1515115151    return off;
    1515215152}
    15153 #endif
     15153
     15154
     15155#define IEM_MC_FETCH_XREG_U64(a_u64Value, a_iXReg, a_iQWord) \
     15156    off = iemNativeEmitSimdFetchXregU64(pReNative, off, a_u64Value, a_iXReg, a_iQWord)
     15157
     15158/** Emits code for IEM_MC_FETCH_XREG_U64. */
     15159DECL_INLINE_THROW(uint32_t)
     15160iemNativeEmitSimdFetchXregU64(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxDstVar, uint8_t iXReg, uint8_t iQWord)
     15161{
     15162    IEMNATIVE_ASSERT_VAR_IDX(pReNative, idxDstVar);
     15163    IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxDstVar, sizeof(uint64_t));
     15164
     15165    uint8_t const idxSimdRegSrc = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iXReg),
     15166                                                                          kIemNativeGstSimdRegLdStSz_Low128, kIemNativeGstRegUse_ReadOnly);
     15167
     15168    iemNativeVarSetKindToStack(pReNative, idxDstVar);
     15169    uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off);
     15170
     15171    off = iemNativeEmitSimdLoadGprFromVecRegU64(pReNative, off, idxVarReg, idxSimdRegSrc, iQWord);
     15172
     15173    /* Free but don't flush the source register. */
     15174    iemNativeSimdRegFreeTmp(pReNative, idxSimdRegSrc);
     15175    iemNativeVarRegisterRelease(pReNative, idxDstVar);
     15176
     15177    return off;
     15178}
     15179
     15180
     15181#endif /* IEMNATIVE_WITH_SIMD_REG_ALLOCATOR */
    1515415182
    1515515183
  • TabularUnified trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h

    r103758 r103761  
    70307030
    70317031/**
    7032  * Emits a gprdst = gprsrc load, 128-bit.
     7032 * Emits a vecdst = vecsrc load, 128-bit.
    70337033 */
    70347034DECL_INLINE_THROW(uint32_t)
     
    70857085}
    70867086
     7087
     7088/**
     7089 * Emits a gprdst = vecsrc[x] load, 64-bit.
     7090 */
     7091DECL_FORCE_INLINE(uint32_t)
     7092iemNativeEmitSimdLoadGprFromVecRegU64Ex(PIEMNATIVEINSTR pCodeBuf, uint32_t off, uint8_t iGprDst, uint8_t iVecRegSrc, uint8_t iQWord)
     7093{
     7094#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;
     7105#elif defined(RT_ARCH_ARM64)
     7106    /* umov gprdst, vecsrc[iQWord] */
     7107    pCodeBuf[off++] = Armv8A64MkVecInstrUmov(iGprDst, iVecRegSrc, iQWord, kArmv8InstrUmovSz_U64);
     7108#else
     7109# error "port me"
     7110#endif
     7111    return off;
     7112}
     7113
     7114
     7115/**
     7116 * Emits a gprdst = vecsrc[x] load, 64-bit.
     7117 */
     7118DECL_INLINE_THROW(uint32_t)
     7119iemNativeEmitSimdLoadGprFromVecRegU64(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGprDst, uint8_t iVecRegSrc, uint8_t iQWord)
     7120{
     7121    Assert(iQWord <= 1);
     7122
     7123#ifdef RT_ARCH_AMD64
     7124    off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 7), off, iGprDst, iVecRegSrc, iQWord);
     7125#elif defined(RT_ARCH_ARM64)
     7126    off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc, iQWord);
     7127#else
     7128# error "port me"
     7129#endif
     7130    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     7131    return off;
     7132}
     7133
    70877134#endif /* IEMNATIVE_WITH_SIMD_REG_ALLOCATOR */
    70887135
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