VirtualBox

Changeset 103762 in vbox


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

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

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

Legend:

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

    r103761 r103762  
    29952995    'IEM_MC_CLEAR_HIGH_GREG_U64':                                (McBlock.parseMcGeneric,           True,  True,  True,  ),
    29962996    'IEM_MC_CLEAR_XREG_U32_MASK':                                (McBlock.parseMcGeneric,           True,  True,  False, ),
    2997     'IEM_MC_CLEAR_YREG_128_UP':                                  (McBlock.parseMcGeneric,           True,  True,  False, ),
     2997    'IEM_MC_CLEAR_YREG_128_UP':                                  (McBlock.parseMcGeneric,           True,  True,  True, ),
    29982998    'IEM_MC_COMMIT_EFLAGS':                                      (McBlock.parseMcGeneric,           True,  True,  True,  ),
    29992999    'IEM_MC_COPY_XREG_U128':                                     (McBlock.parseMcGeneric,           True,  True,  True,  ),
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r103761 r103762  
    1517815178}
    1517915179
     15180
     15181#define IEM_MC_CLEAR_YREG_128_UP(a_iYReg) \
     15182    off = iemNativeEmitSimdClearYregHighU128(pReNative, off, a_iYReg)
     15183
     15184/** Emits code for IEM_MC_CLEAR_YREG_128_UP. */
     15185DECL_INLINE_THROW(uint32_t)
     15186iemNativeEmitSimdClearYregHighU128(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iYReg)
     15187{
     15188    uint8_t const idxSimdReg = iemNativeSimdRegAllocTmpForGuestSimdReg(pReNative, &off, IEMNATIVEGSTSIMDREG_SIMD(iYReg),
     15189                                                                       kIemNativeGstSimdRegLdStSz_High128, kIemNativeGstRegUse_ForFullWrite);
     15190
     15191    off = iemNativeEmitSimdZeroVecRegHighU128(pReNative, off, idxSimdReg);
     15192    IEMNATIVE_SIMD_REG_STATE_SET_DIRTY_HI_U128(pReNative, iYReg);
     15193
     15194    /* Free but don't flush the register. */
     15195    iemNativeSimdRegFreeTmp(pReNative, idxSimdReg);
     15196
     15197    return off;
     15198}
    1518015199
    1518115200#endif /* IEMNATIVE_WITH_SIMD_REG_ALLOCATOR */
  • trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h

    r103761 r103762  
    71327132}
    71337133
     7134
     7135/**
     7136 * Emits a vecdst[128:255] = 0 store.
     7137 */
     7138DECL_FORCE_INLINE(uint32_t)
     7139iemNativeEmitSimdZeroVecRegHighU128Ex(PIEMNATIVEINSTR pCodeBuf, uint32_t off, uint8_t iVecReg)
     7140{
     7141#ifdef RT_ARCH_AMD64
     7142    /* vmovdqa xmm, xmm. This will clear the upper half of ymm */
     7143    if (iVecReg < 8)
     7144    {
     7145        pCodeBuf[off++] = X86_OP_VEX2;
     7146        pCodeBuf[off++] = 0xf9;
     7147    }
     7148    else
     7149    {
     7150        pCodeBuf[off++] = X86_OP_VEX3;
     7151        pCodeBuf[off++] = 0x41;
     7152        pCodeBuf[off++] = 0x79;
     7153    }
     7154    pCodeBuf[off++] = 0x6f;
     7155    pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iVecReg & 7, iVecReg & 7);
     7156#elif defined(RT_ARCH_ARM64)
     7157    /* ASSUMES that there are two adjacent 128-bit registers available for the 256-bit value. */
     7158    Assert(!(iVecReg & 0x1));
     7159    /* eor vecreg, vecreg, vecreg */
     7160    pCodeBuf[off++] = Armv8A64MkVecInstrEor(iVecReg + 1, iVecReg + 1, iVecReg + 1);
     7161#else
     7162# error "port me"
     7163#endif
     7164    return off;
     7165}
     7166
     7167
     7168/**
     7169 * Emits a vecdst[128:255] = 0 store.
     7170 */
     7171DECL_INLINE_THROW(uint32_t)
     7172iemNativeEmitSimdZeroVecRegHighU128(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iVecReg)
     7173{
     7174#ifdef RT_ARCH_AMD64
     7175    off = iemNativeEmitSimdZeroVecRegHighU128Ex(iemNativeInstrBufEnsure(pReNative, off, 7), off, iVecReg);
     7176#elif defined(RT_ARCH_ARM64)
     7177    off = iemNativeEmitSimdZeroVecRegHighU128Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iVecReg);
     7178#else
     7179# error "port me"
     7180#endif
     7181    IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off);
     7182    return off;
     7183}
     7184
    71347185#endif /* IEMNATIVE_WITH_SIMD_REG_ALLOCATOR */
    71357186
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