VirtualBox

Changeset 98887 in vbox


Ignore:
Timestamp:
Mar 9, 2023 11:18:21 AM (21 months ago)
Author:
vboxsync
Message:

VMM/IEM: Implement mpsadbw instruction emulation ,bugref:9898

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm

    r98827 r98887  
    51585158IEMIMPL_MEDIA_SSE_INSN_IMM8_6 pclmulqdq
    51595159IEMIMPL_MEDIA_SSE_INSN_IMM8_6 aeskeygenassist
     5160IEMIMPL_MEDIA_SSE_INSN_IMM8_6 mpsadbw
    51605161
    51615162
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp

    r98827 r98887  
    1805118051    ADX_EMIT(X86_EFL_OF, uint64_t, UINT64_MAX);
    1805218052}
     18053
     18054
     18055/**
     18056 * MPSADBW
     18057 */
     18058IEM_DECL_IMPL_DEF(void, iemAImpl_mpsadbw_u128_fallback,(PRTUINT128U puDst, PCRTUINT128U puSrc, uint8_t bEvil))
     18059{
     18060    uint8_t idxSrc2 = (bEvil & 0x3) * sizeof(uint32_t);
     18061    uint8_t idxSrc1 = ((bEvil >> 2) & 0x1) * sizeof(uint32_t);
     18062    int16_t ai16Src1[11];
     18063    int16_t ai16Src2[4];
     18064
     18065    for (uint32_t i = 0; i < RT_ELEMENTS(ai16Src1); i++)
     18066        ai16Src1[i] = puDst->au8[idxSrc1 + i];
     18067
     18068    for (uint32_t i = 0; i < RT_ELEMENTS(ai16Src2); i++)
     18069        ai16Src2[i] = puSrc->au8[idxSrc2 + i];
     18070
     18071    for (uint8_t i = 0; i < RT_ELEMENTS(puDst->au16); i++)
     18072        puDst->au16[i] =   RT_ABS(ai16Src1[i]     - ai16Src2[0])
     18073                         + RT_ABS(ai16Src1[i + 1] - ai16Src2[1])
     18074                         + RT_ABS(ai16Src1[i + 2] - ai16Src2[2])
     18075                         + RT_ABS(ai16Src1[i + 3] - ai16Src2[3]);
     18076}
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsThree0f3a.cpp.h

    r98812 r98887  
    10331033/** Opcode 0x66 0x0f 0x41, */
    10341034FNIEMOP_STUB(iemOp_dppd_Vdq_Wdq_Ib);
     1035
     1036
    10351037/** Opcode 0x66 0x0f 0x42. */
    1036 FNIEMOP_STUB(iemOp_mpsadbw_Vx_Wx_Ib);
     1038FNIEMOP_DEF(iemOp_mpsadbw_Vx_Wx_Ib)
     1039{
     1040    IEMOP_MNEMONIC3(RMI, MPSADBW, mpsadbw, Vx, Wx, Ib, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     1041    return FNIEMOP_CALL_1(iemOpCommonSse41_FullFullImm8_To_Full,
     1042                          IEM_SELECT_HOST_OR_FALLBACK(fSse41, iemAImpl_mpsadbw_u128, iemAImpl_mpsadbw_u128_fallback));
     1043}
     1044
     1045
    10371046/*  Opcode 0x66 0x0f 0x43 - invalid */
    10381047
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r98835 r98887  
    24432443FNIEMAIMPLMEDIAOPTF2U128IMM8 iemAImpl_pclmulqdq_u128, iemAImpl_pclmulqdq_u128_fallback;
    24442444FNIEMAIMPLMEDIAOPTF3U128IMM8 iemAImpl_vpclmulqdq_u128, iemAImpl_vpclmulqdq_u128_fallback;
     2445
     2446FNIEMAIMPLMEDIAOPTF2U128IMM8 iemAImpl_mpsadbw_u128, iemAImpl_mpsadbw_u128_fallback;
    24452447/** @} */
    24462448
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