VirtualBox

Changeset 96002 in vbox


Ignore:
Timestamp:
Aug 3, 2022 5:20:27 PM (2 years ago)
Author:
vboxsync
Message:

VMM/IEM: Implement missing [v]pmaxu{w,d} variants, bugref:9898

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

Legend:

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

    r95989 r96002  
    36333633IEMIMPL_MEDIA_F2 pmulhw,  1
    36343634IEMIMPL_MEDIA_F2 pmaddwd, 1
     3635IEMIMPL_MEDIA_F2 pminub,  1
    36353636IEMIMPL_MEDIA_F2 pmaxub,  1
    3636 IEMIMPL_MEDIA_F2 pminub,  1
     3637IEMIMPL_MEDIA_F2 pmaxuw,  0
     3638IEMIMPL_MEDIA_F2 pmaxud,  0
    36373639
    36383640;;
     
    40884090IEMIMPL_MEDIA_F3 vpminub
    40894091IEMIMPL_MEDIA_F3 vpmaxub
     4092IEMIMPL_MEDIA_F3 vpmaxuw
     4093IEMIMPL_MEDIA_F3 vpmaxud
    40904094IEMIMPL_MEDIA_F3 vpandn
    40914095IEMIMPL_MEDIA_F3 vpor
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp

    r95989 r96002  
    95079507
    95089508/*
    9509  * PMAXUB / VPMAXUB
     9509 * PMAXUB / VPMAXUB / PMAXUW / VPMAXUW / PMAXUD / VPMAXUD
    95109510 */
    95119511#ifdef IEM_WITHOUT_ASSEMBLY
     
    95549554
    95559555#endif
     9556
     9557
     9558IEM_DECL_IMPL_DEF(void, iemAImpl_pmaxuw_u128_fallback,(PCX86FXSTATE pFpuState, PRTUINT128U puDst, PCRTUINT128U puSrc))
     9559{
     9560    RTUINT128U uSrc1 = *puDst;
     9561
     9562    puDst->au16[ 0] = RT_MAX(uSrc1.au16[ 0], puSrc->au16[ 0]);
     9563    puDst->au16[ 1] = RT_MAX(uSrc1.au16[ 1], puSrc->au16[ 1]);
     9564    puDst->au16[ 2] = RT_MAX(uSrc1.au16[ 2], puSrc->au16[ 2]);
     9565    puDst->au16[ 3] = RT_MAX(uSrc1.au16[ 3], puSrc->au16[ 3]);
     9566    puDst->au16[ 4] = RT_MAX(uSrc1.au16[ 4], puSrc->au16[ 4]);
     9567    puDst->au16[ 5] = RT_MAX(uSrc1.au16[ 5], puSrc->au16[ 5]);
     9568    puDst->au16[ 6] = RT_MAX(uSrc1.au16[ 6], puSrc->au16[ 6]);
     9569    puDst->au16[ 7] = RT_MAX(uSrc1.au16[ 7], puSrc->au16[ 7]);
     9570    RT_NOREF(pFpuState);
     9571}
     9572
     9573
     9574IEM_DECL_IMPL_DEF(void, iemAImpl_pmaxud_u128_fallback,(PCX86FXSTATE pFpuState, PRTUINT128U puDst, PCRTUINT128U puSrc))
     9575{
     9576    RTUINT128U uSrc1 = *puDst;
     9577
     9578    puDst->au32[ 0] = RT_MAX(uSrc1.au32[ 0], puSrc->au32[ 0]);
     9579    puDst->au32[ 1] = RT_MAX(uSrc1.au32[ 1], puSrc->au32[ 1]);
     9580    puDst->au32[ 2] = RT_MAX(uSrc1.au32[ 2], puSrc->au32[ 2]);
     9581    puDst->au32[ 3] = RT_MAX(uSrc1.au32[ 3], puSrc->au32[ 3]);
     9582    RT_NOREF(pFpuState);
     9583}
     9584
    95569585
    95579586IEM_DECL_IMPL_DEF(void, iemAImpl_vpmaxub_u128_fallback,(PX86XSAVEAREA pExtState, PRTUINT128U puDst,
     
    96139642    puDst->au8[30] = RT_MAX(puSrc1->au8[30], puSrc2->au8[30]);
    96149643    puDst->au8[31] = RT_MAX(puSrc1->au8[31], puSrc2->au8[31]);
     9644    RT_NOREF(pExtState);
     9645}
     9646
     9647
     9648IEM_DECL_IMPL_DEF(void, iemAImpl_vpmaxuw_u128_fallback,(PX86XSAVEAREA pExtState, PRTUINT128U puDst,
     9649                                                        PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     9650{
     9651    puDst->au16[ 0] = RT_MAX(puSrc1->au16[ 0], puSrc2->au16[ 0]);
     9652    puDst->au16[ 1] = RT_MAX(puSrc1->au16[ 1], puSrc2->au16[ 1]);
     9653    puDst->au16[ 2] = RT_MAX(puSrc1->au16[ 2], puSrc2->au16[ 2]);
     9654    puDst->au16[ 3] = RT_MAX(puSrc1->au16[ 3], puSrc2->au16[ 3]);
     9655    puDst->au16[ 4] = RT_MAX(puSrc1->au16[ 4], puSrc2->au16[ 4]);
     9656    puDst->au16[ 5] = RT_MAX(puSrc1->au16[ 5], puSrc2->au16[ 5]);
     9657    puDst->au16[ 6] = RT_MAX(puSrc1->au16[ 6], puSrc2->au16[ 6]);
     9658    puDst->au16[ 7] = RT_MAX(puSrc1->au16[ 7], puSrc2->au16[ 7]);
     9659    RT_NOREF(pExtState);
     9660}
     9661
     9662
     9663IEM_DECL_IMPL_DEF(void, iemAImpl_vpmaxuw_u256_fallback,(PX86XSAVEAREA pExtState, PRTUINT256U puDst,
     9664                                                        PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     9665{
     9666    puDst->au16[ 0] = RT_MAX(puSrc1->au16[ 0], puSrc2->au16[ 0]);
     9667    puDst->au16[ 1] = RT_MAX(puSrc1->au16[ 1], puSrc2->au16[ 1]);
     9668    puDst->au16[ 2] = RT_MAX(puSrc1->au16[ 2], puSrc2->au16[ 2]);
     9669    puDst->au16[ 3] = RT_MAX(puSrc1->au16[ 3], puSrc2->au16[ 3]);
     9670    puDst->au16[ 4] = RT_MAX(puSrc1->au16[ 4], puSrc2->au16[ 4]);
     9671    puDst->au16[ 5] = RT_MAX(puSrc1->au16[ 5], puSrc2->au16[ 5]);
     9672    puDst->au16[ 6] = RT_MAX(puSrc1->au16[ 6], puSrc2->au16[ 6]);
     9673    puDst->au16[ 7] = RT_MAX(puSrc1->au16[ 7], puSrc2->au16[ 7]);
     9674    puDst->au16[ 8] = RT_MAX(puSrc1->au16[ 8], puSrc2->au16[ 8]);
     9675    puDst->au16[ 9] = RT_MAX(puSrc1->au16[ 9], puSrc2->au16[ 9]);
     9676    puDst->au16[10] = RT_MAX(puSrc1->au16[10], puSrc2->au16[10]);
     9677    puDst->au16[11] = RT_MAX(puSrc1->au16[11], puSrc2->au16[11]);
     9678    puDst->au16[12] = RT_MAX(puSrc1->au16[12], puSrc2->au16[12]);
     9679    puDst->au16[13] = RT_MAX(puSrc1->au16[13], puSrc2->au16[13]);
     9680    puDst->au16[14] = RT_MAX(puSrc1->au16[14], puSrc2->au16[14]);
     9681    puDst->au16[15] = RT_MAX(puSrc1->au16[15], puSrc2->au16[15]);
     9682    RT_NOREF(pExtState);
     9683}
     9684
     9685
     9686IEM_DECL_IMPL_DEF(void, iemAImpl_vpmaxud_u128_fallback,(PX86XSAVEAREA pExtState, PRTUINT128U puDst,
     9687                                                        PCRTUINT128U puSrc1, PCRTUINT128U puSrc2))
     9688{
     9689    puDst->au32[ 0] = RT_MAX(puSrc1->au32[ 0], puSrc2->au32[ 0]);
     9690    puDst->au32[ 1] = RT_MAX(puSrc1->au32[ 1], puSrc2->au32[ 1]);
     9691    puDst->au32[ 2] = RT_MAX(puSrc1->au32[ 2], puSrc2->au32[ 2]);
     9692    puDst->au32[ 3] = RT_MAX(puSrc1->au32[ 3], puSrc2->au32[ 3]);
     9693    RT_NOREF(pExtState);
     9694}
     9695
     9696
     9697IEM_DECL_IMPL_DEF(void, iemAImpl_vpmaxud_u256_fallback,(PX86XSAVEAREA pExtState, PRTUINT256U puDst,
     9698                                                        PCRTUINT256U puSrc1, PCRTUINT256U puSrc2))
     9699{
     9700    puDst->au32[ 0] = RT_MAX(puSrc1->au32[ 0], puSrc2->au32[ 0]);
     9701    puDst->au32[ 1] = RT_MAX(puSrc1->au32[ 1], puSrc2->au32[ 1]);
     9702    puDst->au32[ 2] = RT_MAX(puSrc1->au32[ 2], puSrc2->au32[ 2]);
     9703    puDst->au32[ 3] = RT_MAX(puSrc1->au32[ 3], puSrc2->au32[ 3]);
     9704    puDst->au32[ 4] = RT_MAX(puSrc1->au32[ 4], puSrc2->au32[ 4]);
     9705    puDst->au32[ 5] = RT_MAX(puSrc1->au32[ 5], puSrc2->au32[ 5]);
     9706    puDst->au32[ 6] = RT_MAX(puSrc1->au32[ 6], puSrc2->au32[ 6]);
     9707    puDst->au32[ 7] = RT_MAX(puSrc1->au32[ 7], puSrc2->au32[ 7]);
    96159708    RT_NOREF(pExtState);
    96169709}
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsThree0f38.cpp.h

    r95578 r96002  
    552552/** Opcode 0x66 0x0f 0x38 0x3d. */
    553553FNIEMOP_STUB(iemOp_pmaxsd_Vx_Wx);
     554
     555
    554556/** Opcode 0x66 0x0f 0x38 0x3e. */
    555 FNIEMOP_STUB(iemOp_pmaxuw_Vx_Wx);
     557FNIEMOP_DEF(iemOp_pmaxuw_Vx_Wx)
     558{
     559    IEMOP_MNEMONIC2(RM, PMAXUW, pmaxuw, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, IEMOPHINT_IGNORES_OP_SIZES);
     560    return FNIEMOP_CALL_1(iemOpCommonSse41_FullFull_To_Full,
     561                          IEM_SELECT_HOST_OR_FALLBACK(fSse41, iemAImpl_pmaxuw_u128, iemAImpl_pmaxuw_u128_fallback));
     562}
     563
     564
    556565/** Opcode 0x66 0x0f 0x38 0x3f. */
    557 FNIEMOP_STUB(iemOp_pmaxud_Vx_Wx);
     566FNIEMOP_DEF(iemOp_pmaxud_Vx_Wx)
     567{
     568    IEMOP_MNEMONIC2(RM, PMAXUD, pmaxud, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_SSE, IEMOPHINT_IGNORES_OP_SIZES);
     569    return FNIEMOP_CALL_1(iemOpCommonSse41_FullFull_To_Full,
     570                          IEM_SELECT_HOST_OR_FALLBACK(fSse41, iemAImpl_pmaxud_u128, iemAImpl_pmaxud_u128_fallback));
     571}
    558572
    559573
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsVexMap2.cpp.h

    r95578 r96002  
    393393/** Opcode VEX.66.0F38 0x3d. */
    394394FNIEMOP_STUB(iemOp_vpmaxsd_Vx_Hx_Wx);
     395
     396
    395397/** Opcode VEX.66.0F38 0x3e. */
    396 FNIEMOP_STUB(iemOp_vpmaxuw_Vx_Hx_Wx);
     398FNIEMOP_DEF(iemOp_vpmaxuw_Vx_Hx_Wx)
     399{
     400    IEMOP_MNEMONIC3(VEX_RVM, VPMAXUW, vpmaxuw, Vx, Hx, Wx, DISOPTYPE_HARMLESS, 0);
     401    IEMOPMEDIAF3_INIT_VARS(vpmaxuw);
     402    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     403}
     404
     405
    397406/** Opcode VEX.66.0F38 0x3f. */
    398 FNIEMOP_STUB(iemOp_vpmaxud_Vx_Hx_Wx);
     407FNIEMOP_DEF(iemOp_vpmaxud_Vx_Hx_Wx)
     408{
     409    IEMOP_MNEMONIC3(VEX_RVM, VPMAXUD, vpmaxud, Vx, Hx, Wx, DISOPTYPE_HARMLESS, 0);
     410    IEMOPMEDIAF3_INIT_VARS(vpmaxud);
     411    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx, IEM_SELECT_HOST_OR_FALLBACK(fAvx2, &s_Host, &s_Fallback));
     412}
    399413
    400414
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r95989 r96002  
    18001800FNIEMAIMPLMEDIAF2U128    iemAImpl_pmullw_u128, iemAImpl_pmulhw_u128;
    18011801FNIEMAIMPLMEDIAF2U128    iemAImpl_pmaddwd_u128;
    1802 FNIEMAIMPLMEDIAF2U128    iemAImpl_pminub_u128, iemAImpl_pmaxub_u128;
     1802FNIEMAIMPLMEDIAF2U128    iemAImpl_pminub_u128;
     1803FNIEMAIMPLMEDIAF2U128    iemAImpl_pmaxub_u128;
     1804FNIEMAIMPLMEDIAF2U128    iemAImpl_pmaxud_u128, iemAImpl_pmaxud_u128_fallback;
     1805FNIEMAIMPLMEDIAF2U128    iemAImpl_pmaxuw_u128, iemAImpl_pmaxuw_u128_fallback;
    18031806FNIEMAIMPLMEDIAOPTF2U128 iemAImpl_packsswb_u128, iemAImpl_packuswb_u128;
    18041807FNIEMAIMPLMEDIAOPTF2U128 iemAImpl_packssdw_u128, iemAImpl_packusdw_u128;
     
    18281831FNIEMAIMPLMEDIAF3U128    iemAImpl_vpsubd_u128,     iemAImpl_vpsubd_u128_fallback;
    18291832FNIEMAIMPLMEDIAF3U128    iemAImpl_vpsubq_u128,     iemAImpl_vpsubq_u128_fallback;
     1833FNIEMAIMPLMEDIAF3U128    iemAImpl_vpminub_u128,    iemAImpl_vpminub_u128_fallback;
    18301834FNIEMAIMPLMEDIAF3U128    iemAImpl_vpmaxub_u128,    iemAImpl_vpmaxub_u128_fallback;
    1831 FNIEMAIMPLMEDIAF3U128    iemAImpl_vpminub_u128,    iemAImpl_vpminub_u128_fallback;
     1835FNIEMAIMPLMEDIAF3U128    iemAImpl_vpmaxuw_u128,    iemAImpl_vpmaxuw_u128_fallback;
     1836FNIEMAIMPLMEDIAF3U128    iemAImpl_vpmaxud_u128,    iemAImpl_vpmaxud_u128_fallback;
    18321837FNIEMAIMPLMEDIAOPTF3U128 iemAImpl_vpacksswb_u128,  iemAImpl_vpacksswb_u128_fallback;
    18331838FNIEMAIMPLMEDIAOPTF3U128 iemAImpl_vpackssdw_u128,  iemAImpl_vpackssdw_u128_fallback;
     
    18561861FNIEMAIMPLMEDIAF3U256    iemAImpl_vpsubd_u256,     iemAImpl_vpsubd_u256_fallback;
    18571862FNIEMAIMPLMEDIAF3U256    iemAImpl_vpsubq_u256,     iemAImpl_vpsubq_u256_fallback;
     1863FNIEMAIMPLMEDIAF3U256    iemAImpl_vpminub_u256,    iemAImpl_vpminub_u256_fallback;
    18581864FNIEMAIMPLMEDIAF3U256    iemAImpl_vpmaxub_u256,    iemAImpl_vpmaxub_u256_fallback;
    1859 FNIEMAIMPLMEDIAF3U256    iemAImpl_vpminub_u256,    iemAImpl_vpminub_u256_fallback;
     1865FNIEMAIMPLMEDIAF3U256    iemAImpl_vpmaxuw_u256,    iemAImpl_vpmaxuw_u256_fallback;
     1866FNIEMAIMPLMEDIAF3U256    iemAImpl_vpmaxud_u256,    iemAImpl_vpmaxud_u256_fallback;
    18601867FNIEMAIMPLMEDIAOPTF3U256 iemAImpl_vpacksswb_u256,  iemAImpl_vpacksswb_u256_fallback;
    18611868FNIEMAIMPLMEDIAOPTF3U256 iemAImpl_vpackssdw_u256,  iemAImpl_vpackssdw_u256_fallback;
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