VirtualBox

Ignore:
Timestamp:
Mar 14, 2024 11:12:04 AM (11 months ago)
Author:
vboxsync
Message:

VMM/IEM: Implement native emitter for IEM_MC_FETCH_XREG_U16(), bugref:10614 [missing file]

File:
1 edited

Legend:

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

    r103836 r103844  
    74817481    /* Need to access the "high" 128-bit vector register. */
    74827482    if (iDWord >= 4)
    7483         off = iemNativeEmitSimdLoadGprFromVecRegU64Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc + 1, iDWord - 4);
     7483        off = iemNativeEmitSimdLoadGprFromVecRegU32Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc + 1, iDWord - 4);
    74847484    else
    74857485        off = iemNativeEmitSimdLoadGprFromVecRegU32Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc, iDWord);
     7486#else
     7487# error "port me"
     7488#endif
     7489    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     7490    return off;
     7491}
     7492
     7493
     7494/**
     7495 * Emits a gprdst = vecsrc[x] load, 16-bit.
     7496 */
     7497DECL_FORCE_INLINE(uint32_t)
     7498iemNativeEmitSimdLoadGprFromVecRegU16Ex(PIEMNATIVEINSTR pCodeBuf, uint32_t off, uint8_t iGprDst, uint8_t iVecRegSrc, uint8_t iWord)
     7499{
     7500#ifdef RT_ARCH_AMD64
     7501    if (iWord >= 8)
     7502    {
     7503        /** @todo Currently not used. */
     7504        AssertReleaseFailed();
     7505    }
     7506    else
     7507    {
     7508        /* pextrw gpr, vecsrc, #iWord */
     7509        pCodeBuf[off++] = X86_OP_PRF_SIZE_OP;
     7510        if (iGprDst >= 8 || iVecRegSrc >= 8)
     7511            pCodeBuf[off++] =   (iVecRegSrc < 8 ? 0 : X86_OP_REX_R)
     7512                              | (iGprDst < 8 ? 0 : X86_OP_REX_B);
     7513        pCodeBuf[off++] = 0x0f;
     7514        pCodeBuf[off++] = 0xc5;
     7515        pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iGprDst & 7, iVecRegSrc & 7);
     7516        pCodeBuf[off++] = iWord;
     7517    }
     7518#elif defined(RT_ARCH_ARM64)
     7519    /* umov gprdst, vecsrc[iWord] */
     7520    pCodeBuf[off++] = Armv8A64MkVecInstrUmov(iGprDst, iVecRegSrc, iWord, kArmv8InstrUmovInsSz_U16, false /*fDst64Bit*/);
     7521#else
     7522# error "port me"
     7523#endif
     7524    return off;
     7525}
     7526
     7527
     7528/**
     7529 * Emits a gprdst = vecsrc[x] load, 16-bit.
     7530 */
     7531DECL_INLINE_THROW(uint32_t)
     7532iemNativeEmitSimdLoadGprFromVecRegU16(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGprDst, uint8_t iVecRegSrc, uint8_t iWord)
     7533{
     7534    Assert(iWord <= 16);
     7535
     7536#ifdef RT_ARCH_AMD64
     7537    off = iemNativeEmitSimdLoadGprFromVecRegU16Ex(iemNativeInstrBufEnsure(pReNative, off, 6), off, iGprDst, iVecRegSrc, iWord);
     7538#elif defined(RT_ARCH_ARM64)
     7539    /* ASSUMES that there are two adjacent 128-bit registers available for the 256-bit value. */
     7540    Assert(!(iVecRegSrc & 0x1));
     7541    /* Need to access the "high" 128-bit vector register. */
     7542    if (iWord >= 8)
     7543        off = iemNativeEmitSimdLoadGprFromVecRegU16Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc + 1, iWord - 8);
     7544    else
     7545        off = iemNativeEmitSimdLoadGprFromVecRegU16Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iGprDst, iVecRegSrc, iWord);
    74867546#else
    74877547# error "port me"
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