VirtualBox

Ignore:
Timestamp:
Mar 11, 2024 12:07:32 PM (11 months ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette