VirtualBox

Changeset 96104 in vbox


Ignore:
Timestamp:
Aug 8, 2022 9:10:25 AM (2 years ago)
Author:
vboxsync
Message:

VMM/IEM: Implement [v]pmuludq instructions, bugref:9898

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

Legend:

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

    r96099 r96104  
    36603660IEMIMPL_MEDIA_F2 pmaddubsw, 1
    36613661IEMIMPL_MEDIA_F2 pmulhrsw,  1
     3662IEMIMPL_MEDIA_F2 pmuludq,   1
    36623663
    36633664
     
    42114212IEMIMPL_MEDIA_OPT_F3 vpsadbw
    42124213IEMIMPL_MEDIA_OPT_F3 vpmuldq
     4214IEMIMPL_MEDIA_OPT_F3 vpmuludq
    42134215
    42144216
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp

    r96099 r96104  
    1319713197
    1319813198/*
     13199 * PMULUDQ / VPMULUDQ
     13200 */
     13201#ifdef IEM_WITHOUT_ASSEMBLY
     13202
     13203IEM_DECL_IMPL_DEF(void, iemAImpl_pmuludq_u64,(PCX86FXSTATE pFpuState, uint64_t *puDst, uint64_t const *puSrc))
     13204{
     13205    RTUINT64U uSrc1 = { *puDst };
     13206    RTUINT64U uSrc2 = { *puSrc };
     13207    ASMCompilerBarrier();
     13208    *puDst = (uint64_t)uSrc1.au32[0] * uSrc2.au32[0];
     13209    RT_NOREF(pFpuState);
     13210}
     13211
     13212
     13213IEM_DECL_IMPL_DEF(void, iemAImpl_pmuludq_u128,(PCX86FXSTATE pFpuState, PRTUINT128U puDst, PCRTUINT128U puSrc))
     13214{
     13215    RTUINT128U uSrc1 = *puDst;
     13216    RTUINT128U uSrc2 = *puSrc;
     13217    ASMCompilerBarrier();
     13218    puDst->au64[0] = (uint64_t)uSrc1.au32[0] * uSrc2.au32[0];
     13219    puDst->au64[1] = (uint64_t)uSrc1.au32[2] * uSrc2.au32[2];
     13220    RT_NOREF(pFpuState);
     13221}
     13222
     13223#endif
     13224
     13225IEM_DECL_IMPL_DEF(void, iemAImpl_vpmuludq_u128_fallback,(PRTUINT128U puDst, PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     13226{
     13227    RTUINT128U uSrc1 = *puSrc1; /* Could overlap with puDst */
     13228    RTUINT128U uSrc2 = *puSrc2; /* Could overlap with puDst */
     13229    ASMCompilerBarrier();
     13230    puDst->au64[0] = (uint64_t)uSrc1.au32[0] * uSrc2.au32[0];
     13231    puDst->au64[1] = (uint64_t)uSrc1.au32[2] * uSrc2.au32[2];
     13232}
     13233
     13234
     13235IEM_DECL_IMPL_DEF(void, iemAImpl_vpmuludq_u256_fallback,(PRTUINT256U puDst, PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     13236{
     13237    RTUINT256U uSrc1 = *puSrc1; /* Could overlap with puDst */
     13238    RTUINT256U uSrc2 = *puSrc2; /* Could overlap with puDst */
     13239    ASMCompilerBarrier();
     13240    puDst->au64[0] = (uint64_t)uSrc1.au32[0] * uSrc2.au32[0];
     13241    puDst->au64[1] = (uint64_t)uSrc1.au32[2] * uSrc2.au32[2];
     13242    puDst->au64[2] = (uint64_t)uSrc1.au32[4] * uSrc2.au32[4];
     13243    puDst->au64[3] = (uint64_t)uSrc1.au32[6] * uSrc2.au32[6];
     13244}
     13245
     13246
     13247/*
    1319913248 * CRC32 (SEE 4.2).
    1320013249 */
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h

    r96097 r96104  
    1056510565
    1056610566/** Opcode      0x0f 0xf4 - pmuludq Pq, Qq */
    10567 FNIEMOP_STUB(iemOp_pmuludq_Pq_Qq);
     10567FNIEMOP_DEF(iemOp_pmuludq_Pq_Qq)
     10568{
     10569    IEMOP_MNEMONIC2(RM, PMULUDQ, pmuludq, Pq, Qq, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     10570    return FNIEMOP_CALL_1(iemOpCommonMmx_FullFull_To_Full, iemAImpl_pmuludq_u64);
     10571}
     10572
     10573
    1056810574/** Opcode 0x66 0x0f 0xf4 - pmuludq Vx, W */
    10569 FNIEMOP_STUB(iemOp_pmuludq_Vx_Wx);
     10575FNIEMOP_DEF(iemOp_pmuludq_Vx_Wx)
     10576{
     10577    IEMOP_MNEMONIC2(RM, PMULUDQ, pmuludq, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, 0);
     10578    return FNIEMOP_CALL_1(iemOpCommonSse2_FullFull_To_Full, iemAImpl_pmuludq_u128);
     10579}
     10580
     10581
    1057010582/*  Opcode 0xf2 0x0f 0xf4 - invalid */
    1057110583
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsVexMap1.cpp.h

    r96094 r96104  
    44754475
    44764476/*  Opcode VEX.0F 0xf4 - invalid */
     4477
     4478
    44774479/** Opcode VEX.66.0F 0xf4 - vpmuludq Vx, Hx, W */
    4478 FNIEMOP_STUB(iemOp_vpmuludq_Vx_Hx_W);
     4480FNIEMOP_DEF(iemOp_vpmuludq_Vx_Hx_W)
     4481{
     4482    IEMOP_MNEMONIC3(VEX_RVM, VPMULUDQ, vpmuludq, Vx, Hx, Wx, DISOPTYPE_HARMLESS, 0);
     4483    IEMOPMEDIAOPTF3_INIT_VARS(vpmuludq);
     4484    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     4485}
     4486
     4487
    44794488/*  Opcode VEX.F2.0F 0xf4 - invalid */
    44804489
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r96099 r96104  
    17951795FNIEMAIMPLMEDIAF2U64     iemAImpl_pmaddubsw_u64, iemAImpl_pmaddubsw_u64_fallback;
    17961796FNIEMAIMPLMEDIAF2U64     iemAImpl_pmulhrsw_u64, iemAImpl_pmulhrsw_u64_fallback;
     1797FNIEMAIMPLMEDIAF2U64     iemAImpl_pmuludq_u64;
    17971798FNIEMAIMPLMEDIAOPTF2U64  iemAImpl_psllw_u64, iemAImpl_psrlw_u64, iemAImpl_psraw_u64;
    17981799FNIEMAIMPLMEDIAOPTF2U64  iemAImpl_pslld_u64, iemAImpl_psrld_u64, iemAImpl_psrad_u64;
     
    18481849FNIEMAIMPLMEDIAF2U128    iemAImpl_pmaddubsw_u128, iemAImpl_pmaddubsw_u128_fallback;
    18491850FNIEMAIMPLMEDIAF2U128    iemAImpl_pmulhrsw_u128, iemAImpl_pmulhrsw_u128_fallback;
     1851FNIEMAIMPLMEDIAF2U128    iemAImpl_pmuludq_u128;
    18501852FNIEMAIMPLMEDIAOPTF2U128 iemAImpl_packsswb_u128, iemAImpl_packuswb_u128;
    18511853FNIEMAIMPLMEDIAOPTF2U128 iemAImpl_packssdw_u128, iemAImpl_packusdw_u128;
     
    19141916FNIEMAIMPLMEDIAOPTF3U128 iemAImpl_vpsadbw_u128,    iemAImpl_vpsadbw_u128_fallback;
    19151917FNIEMAIMPLMEDIAOPTF3U128 iemAImpl_vpmuldq_u128,    iemAImpl_vpmuldq_u128_fallback;
     1918FNIEMAIMPLMEDIAOPTF3U128 iemAImpl_vpmuludq_u128,   iemAImpl_vpmuludq_u128_fallback;
    19161919
    19171920FNIEMAIMPLMEDIAOPTF2U128 iemAImpl_vpabsb_u128,     iemAImpl_vpabsb_u128_fallback;
     
    19751978FNIEMAIMPLMEDIAOPTF3U256 iemAImpl_vpsadbw_u256,    iemAImpl_vpsadbw_u256_fallback;
    19761979FNIEMAIMPLMEDIAOPTF3U256 iemAImpl_vpmuldq_u256,    iemAImpl_vpmuldq_u256_fallback;
     1980FNIEMAIMPLMEDIAOPTF3U256 iemAImpl_vpmuludq_u256,   iemAImpl_vpmuludq_u256_fallback;
    19771981
    19781982FNIEMAIMPLMEDIAOPTF2U256 iemAImpl_vpabsb_u256,     iemAImpl_vpabsb_u256_fallback;
  • trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp

    r96094 r96104  
    447447#define iemAImpl_pavgw_u64              NULL
    448448#define iemAImpl_psadbw_u64             NULL
     449#define iemAImpl_pmuludq_u64            NULL
    449450
    450451#define iemAImpl_pmaxub_u128            NULL
     
    455456#define iemAImpl_pavgw_u128             NULL
    456457#define iemAImpl_psadbw_u128            NULL
     458#define iemAImpl_pmuludq_u128           NULL
    457459
    458460/** @}  */
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