Changeset 105450 in vbox
- Timestamp:
- Jul 23, 2024 2:52:34 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r105371 r105450 15587 15587 { 15588 15588 iemFpSoftF32ToIprt(pr32Result, r32Result); 15589 15590 15589 uint8_t fXcpt = pSoftState->exceptionFlags; 15591 if ( (fMxcsr & X86_MXCSR_FZ)15592 && RTFLOAT32U_IS_SUBNORMAL(pr32Result))15593 {15594 /* Underflow masked and flush to zero is set. */15595 pr32Result->s.uFraction = 0;15596 pr32Result->s.uExponent = 0;15597 fXcpt |= X86_MXCSR_UE | X86_MXCSR_PE;15598 }15599 15600 15590 /* If DAZ is set \#DE is never set. */ 15601 15591 if ( fMxcsr & X86_MXCSR_DAZ … … 15603 15593 && (RTFLOAT32U_IS_SUBNORMAL(pr32Result)))) 15604 15594 fXcpt &= ~X86_MXCSR_DE; 15595 15596 /* 15597 * Skip computing the post-computational exception flags if any of the pre-computational exception flags 15598 * are set and are unmasked in MXCSR. 15599 */ 15600 if ( ((fMxcsr | fXcpt) & (X86_MXCSR_IE | X86_MXCSR_DE | X86_MXCSR_ZE)) 15601 & ~((fMxcsr & X86_MXCSR_XCPT_MASK) >> X86_MXCSR_XCPT_MASK_SHIFT)) 15602 return fMxcsr | (fXcpt & (X86_MXCSR_IE | X86_MXCSR_DE | X86_MXCSR_ZE)); 15603 15604 if ( (fMxcsr & X86_MXCSR_FZ) 15605 && RTFLOAT32U_IS_SUBNORMAL(pr32Result)) 15606 { 15607 /* Underflow masked and flush to zero is set. */ 15608 pr32Result->s.uFraction = 0; 15609 pr32Result->s.uExponent = 0; 15610 fXcpt |= X86_MXCSR_UE | X86_MXCSR_PE; 15611 } 15612 15613 /* If OE/UE get raised PE won't be set because of the lower priority. */ 15614 if ( ( ((fXcpt & (X86_MXCSR_PE | X86_MXCSR_OE)) == (X86_MXCSR_PE | X86_MXCSR_OE)) 15615 && !(fMxcsr & X86_MXCSR_OM)) 15616 || ( ((fXcpt & (X86_MXCSR_PE | X86_MXCSR_UE)) == (X86_MXCSR_PE | X86_MXCSR_UE)) 15617 && !(fMxcsr & X86_MXCSR_UM))) 15618 fXcpt &= ~X86_MXCSR_PE; 15605 15619 15606 15620 return fMxcsr | (fXcpt & X86_MXCSR_XCPT_FLAGS); … … 15639 15653 * 15640 15654 * @returns Updated MXCSR. 15641 * @param pSoftState The SoftFloat state following the operation.15642 * @param r64Result The result of the SoftFloat operation.15643 * @param pr64Result Where to store the result for IEM.15644 * @param fMxcsr The original MXCSR value.15655 * @param pSoftState The SoftFloat state following the operation. 15656 * @param r64Result The result of the SoftFloat operation. 15657 * @param pr64Result Where to store the result for IEM. 15658 * @param fMxcsr The original MXCSR value. 15645 15659 */ 15646 15660 DECLINLINE(uint32_t) iemSseSoftStateAndR64ToMxcsrAndIprtResult(softfloat_state_t const *pSoftState, float64_t r64Result, … … 15649 15663 iemFpSoftF64ToIprt(pr64Result, r64Result); 15650 15664 uint8_t fXcpt = pSoftState->exceptionFlags; 15651 if ( (fMxcsr & X86_MXCSR_FZ)15652 && RTFLOAT64U_IS_SUBNORMAL(pr64Result))15653 {15654 /* Underflow masked and flush to zero is set. */15655 iemFpSoftF64ToIprt(pr64Result, r64Result);15656 pr64Result->s.uFractionHigh = 0;15657 pr64Result->s.uFractionLow = 0;15658 pr64Result->s.uExponent = 0;15659 fXcpt |= X86_MXCSR_UE | X86_MXCSR_PE;15660 }15661 15662 15665 /* If DAZ is set \#DE is never set. */ 15663 15666 if ( fMxcsr & X86_MXCSR_DAZ … … 15665 15668 && (RTFLOAT64U_IS_SUBNORMAL(pr64Result)))) 15666 15669 fXcpt &= ~X86_MXCSR_DE; 15670 15671 /* 15672 * Skip computing the post-computational exception flags if any of the pre-computational exception flags 15673 * are set and are unmasked in MXCSR. 15674 */ 15675 if ( ((fMxcsr | fXcpt) & (X86_MXCSR_IE | X86_MXCSR_DE | X86_MXCSR_ZE)) 15676 & ~((fMxcsr & X86_MXCSR_XCPT_MASK) >> X86_MXCSR_XCPT_MASK_SHIFT)) 15677 return fMxcsr | (fXcpt & (X86_MXCSR_IE | X86_MXCSR_DE | X86_MXCSR_ZE)); 15678 15679 if ( (fMxcsr & X86_MXCSR_FZ) 15680 && RTFLOAT64U_IS_SUBNORMAL(pr64Result)) 15681 { 15682 /* Underflow masked and flush to zero is set. */ 15683 pr64Result->s.uFractionHigh = 0; 15684 pr64Result->s.uFractionLow = 0; 15685 pr64Result->s.uExponent = 0; 15686 fXcpt |= X86_MXCSR_UE | X86_MXCSR_PE; 15687 } 15688 15689 /* If OE/UE get raised PE won't be set because of the lower priority. */ 15690 if ( ( ((fXcpt & (X86_MXCSR_PE | X86_MXCSR_OE)) == (X86_MXCSR_PE | X86_MXCSR_OE)) 15691 && !(fMxcsr & X86_MXCSR_OM)) 15692 || ( ((fXcpt & (X86_MXCSR_PE | X86_MXCSR_UE)) == (X86_MXCSR_PE | X86_MXCSR_UE)) 15693 && !(fMxcsr & X86_MXCSR_UM))) 15694 fXcpt &= ~X86_MXCSR_PE; 15667 15695 15668 15696 return fMxcsr | (fXcpt & X86_MXCSR_XCPT_FLAGS);
Note:
See TracChangeset
for help on using the changeset viewer.