VirtualBox

Changeset 105228 in vbox


Ignore:
Timestamp:
Jul 9, 2024 10:20:02 AM (5 months ago)
Author:
vboxsync
Message:

VMM/IEM: Implement vdiv{ps,pd,ss,sd} instruction emulations, bugref:9898

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp

    r105226 r105228  
    1647716477
    1647816478/**
    16479  * DIVPS
    16480  */
    16481 #ifdef IEM_WITHOUT_ASSEMBLY
     16479 * [V]DIVPS
     16480 */
    1648216481static uint32_t iemAImpl_divps_u128_worker(PRTFLOAT32U pr32Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val1, PCRTFLOAT32U pr32Val2)
    1648316482{
     
    1651416513
    1651516514
     16515#ifdef IEM_WITHOUT_ASSEMBLY
    1651616516IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_divps_u128,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2))
    1651716517{
     
    1652416524
    1652516525
     16526IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vdivps_u128_fallback,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2))
     16527{
     16528    return   iemAImpl_divps_u128_worker(&pResult->ar32[0], uMxCsrIn, &puSrc1->ar32[0], &puSrc2->ar32[0])
     16529           | iemAImpl_divps_u128_worker(&pResult->ar32[1], uMxCsrIn, &puSrc1->ar32[1], &puSrc2->ar32[1])
     16530           | iemAImpl_divps_u128_worker(&pResult->ar32[2], uMxCsrIn, &puSrc1->ar32[2], &puSrc2->ar32[2])
     16531           | iemAImpl_divps_u128_worker(&pResult->ar32[3], uMxCsrIn, &puSrc1->ar32[3], &puSrc2->ar32[3]);
     16532}
     16533
     16534
     16535IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vdivps_u256_fallback,(uint32_t uMxCsrIn, PX86YMMREG pResult, PCX86YMMREG puSrc1, PCX86YMMREG puSrc2))
     16536{
     16537    return   iemAImpl_divps_u128_worker(&pResult->ar32[0], uMxCsrIn, &puSrc1->ar32[0], &puSrc2->ar32[0])
     16538           | iemAImpl_divps_u128_worker(&pResult->ar32[1], uMxCsrIn, &puSrc1->ar32[1], &puSrc2->ar32[1])
     16539           | iemAImpl_divps_u128_worker(&pResult->ar32[2], uMxCsrIn, &puSrc1->ar32[2], &puSrc2->ar32[2])
     16540           | iemAImpl_divps_u128_worker(&pResult->ar32[3], uMxCsrIn, &puSrc1->ar32[3], &puSrc2->ar32[3])
     16541           | iemAImpl_divps_u128_worker(&pResult->ar32[4], uMxCsrIn, &puSrc1->ar32[4], &puSrc2->ar32[4])
     16542           | iemAImpl_divps_u128_worker(&pResult->ar32[5], uMxCsrIn, &puSrc1->ar32[5], &puSrc2->ar32[5])
     16543           | iemAImpl_divps_u128_worker(&pResult->ar32[6], uMxCsrIn, &puSrc1->ar32[6], &puSrc2->ar32[6])
     16544           | iemAImpl_divps_u128_worker(&pResult->ar32[7], uMxCsrIn, &puSrc1->ar32[7], &puSrc2->ar32[7]);
     16545}
     16546
     16547
    1652616548/**
    16527  * DIVSS
     16549 * [V]DIVSS
    1652816550 */
    1652916551#ifdef IEM_WITHOUT_ASSEMBLY
     
    1653816560
    1653916561
     16562IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vdivss_u128_r32_fallback,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCRTFLOAT32U pr32Src2))
     16563{
     16564    pResult->ar32[1] = puSrc1->ar32[1];
     16565    pResult->ar32[2] = puSrc1->ar32[2];
     16566    pResult->ar32[3] = puSrc1->ar32[3];
     16567    return iemAImpl_divps_u128_worker(&pResult->ar32[0], uMxCsrIn, &puSrc1->ar32[0], pr32Src2);
     16568}
     16569
     16570
    1654016571/**
    1654116572 * DIVPD
    1654216573 */
    16543 #ifdef IEM_WITHOUT_ASSEMBLY
    1654416574static uint32_t iemAImpl_divpd_u128_worker(PRTFLOAT64U pr64Res, uint32_t fMxcsr, PCRTFLOAT64U pr64Val1, PCRTFLOAT64U pr64Val2)
    1654516575{
     
    1657616606
    1657716607
     16608#ifdef IEM_WITHOUT_ASSEMBLY
    1657816609IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_divpd_u128,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2))
    1657916610{
     
    1658416615
    1658516616
     16617IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vdivpd_u128_fallback,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2))
     16618{
     16619    return   iemAImpl_divpd_u128_worker(&pResult->ar64[0], uMxCsrIn, &puSrc1->ar64[0], &puSrc2->ar64[0])
     16620           | iemAImpl_divpd_u128_worker(&pResult->ar64[1], uMxCsrIn, &puSrc1->ar64[1], &puSrc2->ar64[1]);
     16621}
     16622
     16623
     16624IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vdivpd_u256_fallback,(uint32_t uMxCsrIn, PX86YMMREG pResult, PCX86YMMREG puSrc1, PCX86YMMREG puSrc2))
     16625{
     16626    return   iemAImpl_divpd_u128_worker(&pResult->ar64[0], uMxCsrIn, &puSrc1->ar64[0], &puSrc2->ar64[0])
     16627           | iemAImpl_divpd_u128_worker(&pResult->ar64[1], uMxCsrIn, &puSrc1->ar64[1], &puSrc2->ar64[1])
     16628           | iemAImpl_divpd_u128_worker(&pResult->ar64[2], uMxCsrIn, &puSrc1->ar64[2], &puSrc2->ar64[2])
     16629           | iemAImpl_divpd_u128_worker(&pResult->ar64[3], uMxCsrIn, &puSrc1->ar64[3], &puSrc2->ar64[3])
     16630           | iemAImpl_divpd_u128_worker(&pResult->ar64[4], uMxCsrIn, &puSrc1->ar64[4], &puSrc2->ar64[4])
     16631           | iemAImpl_divpd_u128_worker(&pResult->ar64[5], uMxCsrIn, &puSrc1->ar64[5], &puSrc2->ar64[5])
     16632           | iemAImpl_divpd_u128_worker(&pResult->ar64[6], uMxCsrIn, &puSrc1->ar64[6], &puSrc2->ar64[6])
     16633           | iemAImpl_divpd_u128_worker(&pResult->ar64[7], uMxCsrIn, &puSrc1->ar64[7], &puSrc2->ar64[7]);
     16634}
     16635
     16636
    1658616637/**
    16587  * DIVSD
     16638 * [V]DIVSD
    1658816639 */
    1658916640#ifdef IEM_WITHOUT_ASSEMBLY
     
    1659416645}
    1659516646#endif
     16647
     16648
     16649IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vdivsd_u128_r64_fallback,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCRTFLOAT64U pr64Src2))
     16650{
     16651    pResult->ar64[1] = puSrc1->ar64[1];
     16652    return iemAImpl_divpd_u128_worker(&pResult->ar64[0], uMxCsrIn, &puSrc1->ar64[0], pr64Src2);
     16653}
    1659616654
    1659716655
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstVexMap1.cpp.h

    r105224 r105228  
    31213121
    31223122/** Opcode VEX.0F 0x5e - vdivps Vps, Hps, Wps */
    3123 FNIEMOP_STUB(iemOp_vdivps_Vps_Hps_Wps);
     3123FNIEMOP_DEF(iemOp_vdivps_Vps_Hps_Wps)
     3124{
     3125    IEMOP_MNEMONIC3(VEX_RVM, VDIVPS, vdivps, Vps, Hps, Wps, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0);
     3126    IEMOPMEDIAF3_INIT_VARS(          vdivps);
     3127    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx, IEM_SELECT_HOST_OR_FALLBACK(fAvx, &s_Host, &s_Fallback));
     3128}
     3129
     3130
    31243131/** Opcode VEX.66.0F 0x5e - vdivpd Vpd, Hpd, Wpd */
    3125 FNIEMOP_STUB(iemOp_vdivpd_Vpd_Hpd_Wpd);
     3132FNIEMOP_DEF(iemOp_vdivpd_Vpd_Hpd_Wpd)
     3133{
     3134    IEMOP_MNEMONIC3(VEX_RVM, VDIVPD, vdivpd, Vpd, Hpd, Wpd, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0);
     3135    IEMOPMEDIAF3_INIT_VARS(          vdivpd);
     3136    return FNIEMOP_CALL_1(iemOpCommonAvxAvx2_Vx_Hx_Wx, IEM_SELECT_HOST_OR_FALLBACK(fAvx, &s_Host, &s_Fallback));
     3137}
     3138
     3139
    31263140/** Opcode VEX.F3.0F 0x5e - vdivss Vss, Hss, Wss */
    3127 FNIEMOP_STUB(iemOp_vdivss_Vss_Hss_Wss);
     3141FNIEMOP_DEF(iemOp_vdivss_Vss_Hss_Wss)
     3142{
     3143    IEMOP_MNEMONIC3(VEX_RVM, VDIVSS, vdivss, Vps, Hps, Wss, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0);
     3144    return FNIEMOP_CALL_1(iemOpCommonAvx_Vx_Hx_R32,
     3145                          IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vdivss_u128_r32, iemAImpl_vdivss_u128_r32_fallback));
     3146}
     3147
     3148
    31283149/** Opcode VEX.F2.0F 0x5e - vdivsd Vsd, Hsd, Wsd */
    3129 FNIEMOP_STUB(iemOp_vdivsd_Vsd_Hsd_Wsd);
     3150FNIEMOP_DEF(iemOp_vdivsd_Vsd_Hsd_Wsd)
     3151{
     3152    IEMOP_MNEMONIC3(VEX_RVM, VDIVSD, vdivsd, Vpd, Hpd, Wsd, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0);
     3153    return FNIEMOP_CALL_1(iemOpCommonAvx_Vx_Hx_R64,
     3154                          IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vdivsd_u128_r64, iemAImpl_vdivsd_u128_r64_fallback));
     3155}
     3156
    31303157
    31313158/** Opcode VEX.0F 0x5f - vmaxps Vps, Hps, Wps */
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r105224 r105228  
    45634563FNIEMAIMPLMEDIAF3U128 iemAImpl_vminps_u128, iemAImpl_vminps_u128_fallback;
    45644564FNIEMAIMPLMEDIAF3U128 iemAImpl_vminpd_u128, iemAImpl_vminpd_u128_fallback;
    4565 FNIEMAIMPLFPAVXF3U128 iemAImpl_vdivps_u128, iemAImpl_vdivps_u128_fallback;
    4566 FNIEMAIMPLFPAVXF3U128 iemAImpl_vdivpd_u128, iemAImpl_vdivpd_u128_fallback;
     4565FNIEMAIMPLMEDIAF3U128 iemAImpl_vdivps_u128, iemAImpl_vdivps_u128_fallback;
     4566FNIEMAIMPLMEDIAF3U128 iemAImpl_vdivpd_u128, iemAImpl_vdivpd_u128_fallback;
    45674567FNIEMAIMPLFPAVXF3U128 iemAImpl_vmaxps_u128, iemAImpl_vmaxps_u128_fallback;
    45684568FNIEMAIMPLFPAVXF3U128 iemAImpl_vmaxpd_u128, iemAImpl_vmaxpd_u128_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