VirtualBox

Changeset 98492 in vbox for trunk


Ignore:
Timestamp:
Feb 7, 2023 12:28:19 PM (2 years ago)
Author:
vboxsync
Message:

VMM/IEM: Worker function for rsqrtss and rsqrtps SSE instructions, bugref:9898

File:
1 edited

Legend:

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

    r98480 r98492  
    1558115581static uint32_t iemAImpl_rsqrt_worker(PRTFLOAT32U pr32Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val)
    1558215582{
    15583     RT_NOREF(pr32Res);
    15584     RT_NOREF(pr32Val);
    15585     AssertReleaseFailed();
    15586     return fMxcsr;
     15583    if (iemSseUnaryValIsNaNR32(pr32Res, pr32Val, &fMxcsr))
     15584        return fMxcsr;
     15585
     15586    RTFLOAT32U r32Src;
     15587    iemSsePrepareValueR32(&r32Src, fMxcsr | X86_MXCSR_DAZ, pr32Val);
     15588    if (RTFLOAT32U_IS_ZERO(&r32Src))
     15589    {
     15590        *pr32Res = g_ar32Infinity[r32Src.s.fSign];
     15591        return fMxcsr;
     15592    }
     15593    else if (r32Src.s.fSign)
     15594    {
     15595        *pr32Res = g_ar32QNaN[1];
     15596        return fMxcsr | X86_MXCSR_IE;
     15597    }
     15598
     15599    softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr);
     15600    float32_t r32Result = f32_rsqrt(iemFpSoftF32FromIprt(&r32Src), &SoftState);
     15601    return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr);
    1558715602}
    1558815603
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