VirtualBox

Changeset 102878 in vbox for trunk/src


Ignore:
Timestamp:
Jan 15, 2024 3:10:01 PM (13 months ago)
Author:
vboxsync
Message:

IEM: Added the simple C implementation of RCPSS/RCPPS instructions

File:
1 edited

Legend:

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

    r102817 r102878  
    479479
    480480/** One values (indexed by fSign). */
     481RTFLOAT32U const g_ar32One[] =
     482{ RTFLOAT32U_INIT(0, 0, RTFLOAT32U_EXP_BIAS), RTFLOAT32U_INIT(1, 0, RTFLOAT32U_EXP_BIAS) };
    481483RTFLOAT80U const g_ar80One[] =
    482484{ RTFLOAT80U_INIT(0, RT_BIT_64(63), RTFLOAT80U_EXP_BIAS), RTFLOAT80U_INIT(1, RT_BIT_64(63), RTFLOAT80U_EXP_BIAS) };
     
    1614216144static uint32_t iemAImpl_rcp_worker(PRTFLOAT32U pr32Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val)
    1614316145{
    16144     RT_NOREF(pr32Res); RT_NOREF(fMxcsr); RT_NOREF(pr32Val);
    16145     /** @todo implement using softfloat! */
    16146     Assert(0);
    16147     return 0;
     16146    if (iemSseUnaryValIsNaNR32(pr32Res, pr32Val, &fMxcsr))
     16147        return fMxcsr;
     16148
     16149    RTFLOAT32U r32Src;
     16150    iemSsePrepareValueR32(&r32Src, fMxcsr | X86_MXCSR_DAZ, pr32Val);
     16151    if (RTFLOAT32U_IS_ZERO(&r32Src))
     16152    {
     16153        *pr32Res = g_ar32Infinity[r32Src.s.fSign];
     16154        return fMxcsr;
     16155    }
     16156
     16157    softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr);
     16158    float32_t r32Result = f32_div(iemFpSoftF32FromIprt(&g_ar32One[0]), iemFpSoftF32FromIprt(&r32Src), &SoftState);
     16159    return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr);
    1614816160}
    1614916161
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