VirtualBox

Changeset 94679 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Apr 21, 2022 11:54:24 PM (3 years ago)
Author:
vboxsync
Message:

VMM/IEM: Implemented C helper for the FSCALE instruction. bugref:9898

File:
1 edited

Legend:

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

    r94640 r94679  
    46964696        fFsw |= X86_FSW_ES | X86_FSW_B;
    46974697
    4698     if (!(fFsw & ~fFcw & X86_FSW_IE))
     4698    if (!(fFsw & ~fFcw & (X86_FSW_IE | X86_FSW_DE)))
    46994699        iemFpuSoftF80ToIprt(pr80Result, r80XResult);
    47004700    else
     4701    {
     4702        fFsw &= ~(X86_FSW_OE | X86_FSW_UE | X86_FSW_PE | X86_FSW_ZE | X86_FSW_C1);
    47014703        *pr80Result = *pr80XcptResult;
     4704    }
    47024705    return fFsw;
    47034706}
     
    50435046
    50445047
    5045 /** Worker for iemAImpl_fdiv_r80_by_r80 & iemAImpl_fdivr_r80_by_r80. */
     5048/** Worker for iemAImpl_fprem_r80_by_r80 & iemAImpl_fprem1_r80_by_r80. */
    50465049static uint16_t iemAImpl_fprem_fprem1_r80_by_r80_worker(PCRTFLOAT80U pr80Val1, PCRTFLOAT80U pr80Val2, PRTFLOAT80U pr80Result,
    50475050                                                        uint16_t fFcw, uint16_t fFsw, PCRTFLOAT80U pr80Val1Org, bool fLegacyInstr)
     
    57775780                                                    PCRTFLOAT80U pr80Val1, PCRTFLOAT80U pr80Val2))
    57785781{
    5779     RT_NOREF(pFpuState, pFpuRes, pr80Val1, pr80Val2);
    5780     AssertReleaseFailed();
     5782    /* The SoftFloat worker function extF80_scale_extF80 is of our creation, so
     5783       it does everything we need it to do. */
     5784    uint16_t const fFcw = pFpuState->FCW;
     5785    uint16_t fFsw       = (pFpuState->FSW & (X86_FSW_C0 | X86_FSW_C2 | X86_FSW_C3)) | (6 << X86_FSW_TOP_SHIFT);
     5786    softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_FCW(fFcw);
     5787    extFloat80_t r80XResult = extF80_scale_extF80(iemFpuSoftF80FromIprt(pr80Val1), iemFpuSoftF80FromIprt(pr80Val2), &SoftState);
     5788    pFpuRes->FSW = iemFpuSoftStateAndF80ToFswAndIprtResult(&SoftState, r80XResult, &pFpuRes->r80Result, fFcw, fFsw, pr80Val1);
    57815789}
    57825790
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