VirtualBox

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


Ignore:
Timestamp:
Dec 12, 2024 4:36:19 AM (2 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
166324
Message:

VMM/IEM: fix wrong MXCSR handling of [v]rsqrtps, [v]rsqrtss, [v]rcpps, [v]rcpss instructions; bugref:10820; jiraref:VBP-1476

Partial repair of reciprocal & reciprocal square root instructions:

These instructions are defined to produce no MXCSR faults, but were incorrectly raising some.

They remain numerically too precise -- conflicting with CPU documentation & actual HW results.

This change should make some applications work; the overall implementation is still faulty.

File:
1 edited

Legend:

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

    r107143 r107294  
    1717717177{
    1717817178    if (iemSseUnaryValIsNaNR32(pr32Res, pr32Val, &fMxcsr))
    17179         return fMxcsr;
     17179        return 0;
    1718017180
    1718117181    RTFLOAT32U r32Src;
     
    1718417184    {
    1718517185        *pr32Res = g_ar32Infinity[r32Src.s.fSign];
    17186         return fMxcsr;
     17186        return 0;
    1718717187    }
    1718817188    else if (r32Src.s.fSign)
    1718917189    {
    1719017190        *pr32Res = g_ar32QNaN[1];
    17191         return fMxcsr | X86_MXCSR_IE;
     17191        return 0;
    1719217192    }
    1719317193
    1719417194    softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr);
    1719517195    float32_t r32Result = f32_rsqrt(iemFpSoftF32FromIprt(&r32Src), &SoftState);
    17196     return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr);
     17196    (void)iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr);
     17197    return 0;
    1719717198}
    1719817199
     
    1726217263{
    1726317264    if (iemSseUnaryValIsNaNR32(pr32Res, pr32Val, &fMxcsr))
    17264         return fMxcsr;
     17265        return 0;
    1726517266
    1726617267    RTFLOAT32U r32Src;
     
    1726917270    {
    1727017271        *pr32Res = g_ar32Infinity[r32Src.s.fSign];
    17271         return fMxcsr;
     17272        return 0;
    1727217273    }
    1727317274
    1727417275    softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr);
    1727517276    float32_t r32Result = f32_div(iemFpSoftF32FromIprt(&g_ar32One[0]), iemFpSoftF32FromIprt(&r32Src), &SoftState);
    17276     return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr);
     17277    (void)iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr);
     17278    return 0;
    1727717279}
    1727817280
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