VirtualBox

Changeset 97319 in vbox


Ignore:
Timestamp:
Oct 27, 2022 12:14:13 PM (2 years ago)
Author:
vboxsync
Message:

VMM/IEM: Underflow signalling in fsincos instruction as described in 1985 version of IEEE 754, bugref:9898

File:
1 edited

Legend:

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

    r97290 r97319  
    66056605        if (fFcw & X86_FCW_DM)
    66066606        {
    6607             pFpuResTwo->r80Result1 = *pr80Val;
    66086607            pFpuResTwo->r80Result2 = g_ar80One[0];
     6608
     6609            if (fFcw & X86_FCW_UM)
     6610            {
     6611                pFpuResTwo->r80Result1 = *pr80Val;
     6612            }
     6613            else
     6614            {
     6615                /* Underflow signalling as described at 7.4 section of 1985 IEEE 754*/
     6616                uint64_t uMantissa = pr80Val->s.uMantissa;
     6617                uint32_t uExponent = ASMBitLastSetU64(uMantissa);
     6618
     6619                uExponent = 64 - uExponent;
     6620                uMantissa <<= uExponent;
     6621                uExponent = RTFLOAT128U_EXP_BIAS_ADJUST - uExponent + 1;
     6622
     6623                pFpuResTwo->r80Result1.s.fSign = pr80Val->s.fSign;
     6624                pFpuResTwo->r80Result1.s.uMantissa = uMantissa;
     6625                pFpuResTwo->r80Result1.s.uExponent = uExponent;
     6626            }
    66096627
    66106628            fFsw &= ~X86_FSW_TOP_MASK | (6 << X86_FSW_TOP_SHIFT);
    66116629            fFsw |= X86_FSW_UE | X86_FSW_PE;
    66126630
    6613             if (fFcw & X86_FCW_PM)
     6631            if ((fFcw & X86_FCW_UM) && (fFcw & X86_FCW_PM))
    66146632            {
    6615                 if (!(fFcw & X86_FCW_UM))
    6616                     fFsw |= X86_FSW_ES | X86_FSW_B;
     6633                /* All the exceptions are masked. */
    66176634            }
    66186635            else
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