Changeset 104129 in vbox for trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
- Timestamp:
- Apr 2, 2024 12:37:36 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r104051 r104129 5 5 6 6 /* 7 * Copyright (C) 2022-202 3Oracle and/or its affiliates.7 * Copyright (C) 2022-2024 Oracle and/or its affiliates. 8 8 * 9 9 * This file is part of VirtualBox base platform packages, as … … 5594 5594 }; 5595 5595 5596 X86FXSTATE State;5597 RT_ZERO(State);5598 5596 uint32_t cMinNormalPairs = (cTests - 144) / 4; 5599 5597 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR32); iFn++) … … 5635 5633 for (uint8_t iFz = 0; iFz < 2; iFz++) 5636 5634 { 5637 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)5638 | (iRounding << X86_MXCSR_RC_SHIFT)5639 | (iDaz ? X86_MXCSR_DAZ : 0)5640 | (iFz ? X86_MXCSR_FZ : 0)5641 | X86_MXCSR_XCPT_MASK;5642 IEMSSERESULTResM; RT_ZERO(ResM);5643 pfn(&State, &ResM, &TestData.InVal1, &TestData.InVal2);5644 TestData.fMxcsrIn = State.MXCSR;5645 TestData.fMxcsrOut = ResM.MXCSR;5646 TestData.OutVal = ResM .uResult;5635 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 5636 | (iRounding << X86_MXCSR_RC_SHIFT) 5637 | (iDaz ? X86_MXCSR_DAZ : 0) 5638 | (iFz ? X86_MXCSR_FZ : 0) 5639 | X86_MXCSR_XCPT_MASK; 5640 X86XMMREG ResM; RT_ZERO(ResM); 5641 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &ResM, &TestData.InVal1, &TestData.InVal2); 5642 TestData.fMxcsrIn = uMxCsrIn; 5643 TestData.fMxcsrOut = uMxCsrOutM; 5644 TestData.OutVal = ResM; 5647 5645 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5648 5646 5649 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;5650 IEMSSERESULTResU; RT_ZERO(ResU);5651 pfn(&State, &ResU, &TestData.InVal1, &TestData.InVal2);5652 TestData.fMxcsrIn = State.MXCSR;5653 TestData.fMxcsrOut = ResU.MXCSR;5654 TestData.OutVal = ResU .uResult;5647 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 5648 X86XMMREG ResU; RT_ZERO(ResU); 5649 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &ResU, &TestData.InVal1, &TestData.InVal2); 5650 TestData.fMxcsrIn = uMxCsrIn; 5651 TestData.fMxcsrOut = uMxCsrOutU; 5652 TestData.OutVal = ResU; 5655 5653 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5656 5654 5657 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;5655 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 5658 5656 if (fXcpt) 5659 5657 { 5660 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;5661 IEMSSERESULTRes1; RT_ZERO(Res1);5662 pfn(&State, &Res1, &TestData.InVal1, &TestData.InVal2);5663 TestData.fMxcsrIn = State.MXCSR;5664 TestData.fMxcsrOut = Res1.MXCSR;5665 TestData.OutVal = Res1 .uResult;5658 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 5659 X86XMMREG Res1; RT_ZERO(Res1); 5660 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &Res1, &TestData.InVal1, &TestData.InVal2); 5661 TestData.fMxcsrIn = uMxCsrIn; 5662 TestData.fMxcsrOut = uMxCsrOut1; 5663 TestData.OutVal = Res1; 5666 5664 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5667 5665 5668 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))5666 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 5669 5667 { 5670 fXcpt |= Res1.MXCSR& X86_MXCSR_XCPT_FLAGS;5671 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);5672 IEMSSERESULTRes2; RT_ZERO(Res2);5673 pfn(&State, &Res2, &TestData.InVal1, &TestData.InVal2);5674 TestData.fMxcsrIn = State.MXCSR;5675 TestData.fMxcsrOut = Res2.MXCSR;5676 TestData.OutVal = Res2 .uResult;5668 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 5669 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 5670 X86XMMREG Res2; RT_ZERO(Res2); 5671 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &Res2, &TestData.InVal1, &TestData.InVal2); 5672 TestData.fMxcsrIn = uMxCsrIn; 5673 TestData.fMxcsrOut = uMxCsrOut2; 5674 TestData.OutVal = Res2; 5677 5675 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5678 5676 } … … 5681 5679 if (fUnmasked & fXcpt) 5682 5680 { 5683 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);5684 IEMSSERESULTRes3; RT_ZERO(Res3);5685 pfn(&State, &Res3, &TestData.InVal1, &TestData.InVal2);5686 TestData.fMxcsrIn = State.MXCSR;5687 TestData.fMxcsrOut = Res3.MXCSR;5688 TestData.OutVal = Res3 .uResult;5681 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 5682 X86XMMREG Res3; RT_ZERO(Res3); 5683 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &Res3, &TestData.InVal1, &TestData.InVal2); 5684 TestData.fMxcsrIn = uMxCsrIn; 5685 TestData.fMxcsrOut = uMxCsrOut3; 5686 TestData.OutVal = Res3; 5689 5687 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5690 5688 } … … 5701 5699 static void SseBinaryR32Test(void) 5702 5700 { 5703 X86FXSTATE State;5704 RT_ZERO(State);5705 5701 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR32); iFn++) 5706 5702 { … … 5717 5713 for (uint32_t iTest = 0; iTest < cbTests / sizeof(paTests[0]); iTest++) 5718 5714 { 5719 IEMSSERESULT Res; RT_ZERO(Res); 5720 5721 State.MXCSR = paTests[iTest].fMxcsrIn; 5722 pfn(&State, &Res, &paTests[iTest].InVal1, &paTests[iTest].InVal2); 5723 bool fValsIdentical = RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[0], &paTests[iTest].OutVal.ar32[0]) 5724 && RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[1], &paTests[iTest].OutVal.ar32[1]) 5725 && RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[2], &paTests[iTest].OutVal.ar32[2]) 5726 && RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[3], &paTests[iTest].OutVal.ar32[3]); 5727 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 5715 X86XMMREG Res; RT_ZERO(Res); 5716 5717 uint32_t uMxCsrOut = pfn(paTests[iTest].fMxcsrIn, &Res, &paTests[iTest].InVal1, &paTests[iTest].InVal2); 5718 bool fValsIdentical = RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[0], &paTests[iTest].OutVal.ar32[0]) 5719 && RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[1], &paTests[iTest].OutVal.ar32[1]) 5720 && RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[2], &paTests[iTest].OutVal.ar32[2]) 5721 && RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[3], &paTests[iTest].OutVal.ar32[3]); 5722 if ( uMxCsrOut != paTests[iTest].fMxcsrOut 5728 5723 || !fValsIdentical) 5729 5724 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s'%s'%s in2=%s'%s'%s'%s\n" … … 5735 5730 FormatR32(&paTests[iTest].InVal2.ar32[0]), FormatR32(&paTests[iTest].InVal2.ar32[1]), 5736 5731 FormatR32(&paTests[iTest].InVal2.ar32[2]), FormatR32(&paTests[iTest].InVal2.ar32[3]), 5737 iVar ? " " : "", Res.MXCSR,5738 FormatR32(&Res. uResult.ar32[0]), FormatR32(&Res.uResult.ar32[1]),5739 FormatR32(&Res. uResult.ar32[2]), FormatR32(&Res.uResult.ar32[3]),5732 iVar ? " " : "", uMxCsrOut, 5733 FormatR32(&Res.ar32[0]), FormatR32(&Res.ar32[1]), 5734 FormatR32(&Res.ar32[2]), FormatR32(&Res.ar32[3]), 5740 5735 iVar ? " " : "", paTests[iTest].fMxcsrOut, 5741 5736 FormatR32(&paTests[iTest].OutVal.ar32[0]), FormatR32(&paTests[iTest].OutVal.ar32[1]), 5742 5737 FormatR32(&paTests[iTest].OutVal.ar32[2]), FormatR32(&paTests[iTest].OutVal.ar32[3]), 5743 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),5738 MxcsrDiff(uMxCsrOut, paTests[iTest].fMxcsrOut), 5744 5739 !fValsIdentical ? " - val" : "", 5745 5740 FormatMxcsr(paTests[iTest].fMxcsrIn) ); … … 5786 5781 }; 5787 5782 5788 X86FXSTATE State;5789 RT_ZERO(State);5790 5783 uint32_t cMinNormalPairs = (cTests - 144) / 4; 5791 5784 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR64); iFn++) … … 5820 5813 for (uint8_t iFz = 0; iFz < 2; iFz++) 5821 5814 { 5822 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)5823 | (iRounding << X86_MXCSR_RC_SHIFT)5824 | (iDaz ? X86_MXCSR_DAZ : 0)5825 | (iFz ? X86_MXCSR_FZ : 0)5826 | X86_MXCSR_XCPT_MASK;5827 IEMSSERESULTResM; RT_ZERO(ResM);5828 pfn(&State, &ResM, &TestData.InVal1, &TestData.InVal2);5829 TestData.fMxcsrIn = State.MXCSR;5830 TestData.fMxcsrOut = ResM.MXCSR;5831 TestData.OutVal = ResM .uResult;5815 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 5816 | (iRounding << X86_MXCSR_RC_SHIFT) 5817 | (iDaz ? X86_MXCSR_DAZ : 0) 5818 | (iFz ? X86_MXCSR_FZ : 0) 5819 | X86_MXCSR_XCPT_MASK; 5820 X86XMMREG ResM; RT_ZERO(ResM); 5821 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &ResM, &TestData.InVal1, &TestData.InVal2); 5822 TestData.fMxcsrIn = uMxCsrIn; 5823 TestData.fMxcsrOut = uMxCsrOutM; 5824 TestData.OutVal = ResM; 5832 5825 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5833 5826 5834 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;5835 IEMSSERESULTResU; RT_ZERO(ResU);5836 pfn(&State, &ResU, &TestData.InVal1, &TestData.InVal2);5837 TestData.fMxcsrIn = State.MXCSR;5838 TestData.fMxcsrOut = ResU.MXCSR;5839 TestData.OutVal = ResU .uResult;5827 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 5828 X86XMMREG ResU; RT_ZERO(ResU); 5829 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &ResU, &TestData.InVal1, &TestData.InVal2); 5830 TestData.fMxcsrIn = uMxCsrIn; 5831 TestData.fMxcsrOut = uMxCsrOutU; 5832 TestData.OutVal = ResU; 5840 5833 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5841 5834 5842 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;5835 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 5843 5836 if (fXcpt) 5844 5837 { 5845 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;5846 IEMSSERESULTRes1; RT_ZERO(Res1);5847 pfn(&State, &Res1, &TestData.InVal1, &TestData.InVal2);5848 TestData.fMxcsrIn = State.MXCSR;5849 TestData.fMxcsrOut = Res1.MXCSR;5850 TestData.OutVal = Res1 .uResult;5838 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 5839 X86XMMREG Res1; RT_ZERO(Res1); 5840 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &Res1, &TestData.InVal1, &TestData.InVal2); 5841 TestData.fMxcsrIn = uMxCsrIn; 5842 TestData.fMxcsrOut = uMxCsrOut1; 5843 TestData.OutVal = Res1; 5851 5844 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5852 5845 5853 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))5846 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 5854 5847 { 5855 fXcpt |= Res1.MXCSR& X86_MXCSR_XCPT_FLAGS;5856 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);5857 IEMSSERESULTRes2; RT_ZERO(Res2);5858 pfn(&State, &Res2, &TestData.InVal1, &TestData.InVal2);5859 TestData.fMxcsrIn = State.MXCSR;5860 TestData.fMxcsrOut = Res2.MXCSR;5861 TestData.OutVal = Res2 .uResult;5848 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 5849 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 5850 X86XMMREG Res2; RT_ZERO(Res2); 5851 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &Res2, &TestData.InVal1, &TestData.InVal2); 5852 TestData.fMxcsrIn = uMxCsrIn; 5853 TestData.fMxcsrOut = uMxCsrOut2; 5854 TestData.OutVal = Res2; 5862 5855 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5863 5856 } … … 5866 5859 if (fUnmasked & fXcpt) 5867 5860 { 5868 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);5869 IEMSSERESULTRes3; RT_ZERO(Res3);5870 pfn(&State, &Res3, &TestData.InVal1, &TestData.InVal2);5871 TestData.fMxcsrIn = State.MXCSR;5872 TestData.fMxcsrOut = Res3.MXCSR;5873 TestData.OutVal = Res3 .uResult;5861 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 5862 X86XMMREG Res3; RT_ZERO(Res3); 5863 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &Res3, &TestData.InVal1, &TestData.InVal2); 5864 TestData.fMxcsrIn = uMxCsrIn; 5865 TestData.fMxcsrOut = uMxCsrOut3; 5866 TestData.OutVal = Res3; 5874 5867 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 5875 5868 } … … 5887 5880 static void SseBinaryR64Test(void) 5888 5881 { 5889 X86FXSTATE State;5890 RT_ZERO(State);5891 5882 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR64); iFn++) 5892 5883 { … … 5903 5894 for (uint32_t iTest = 0; iTest < cTests; iTest++) 5904 5895 { 5905 IEMSSERESULTRes; RT_ZERO(Res);5906 5907 State.MXCSR= paTests[iTest].fMxcsrIn;5908 pfn(&State, &Res, &paTests[iTest].InVal1, &paTests[iTest].InVal2);5909 if ( Res.MXCSR!= paTests[iTest].fMxcsrOut5910 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[0], &paTests[iTest].OutVal.ar64[0])5911 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[1], &paTests[iTest].OutVal.ar64[1]))5896 X86XMMREG Res; RT_ZERO(Res); 5897 5898 uint32_t uMxCsrIn = paTests[iTest].fMxcsrIn; 5899 uint32_t uMxCsrOut = pfn(uMxCsrIn, &Res, &paTests[iTest].InVal1, &paTests[iTest].InVal2); 5900 if ( uMxCsrOut != paTests[iTest].fMxcsrOut 5901 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[0], &paTests[iTest].OutVal.ar64[0]) 5902 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[1], &paTests[iTest].OutVal.ar64[1])) 5912 5903 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s in2=%s'%s\n" 5913 5904 "%s -> mxcsr=%#08x %s'%s\n" … … 5916 5907 FormatR64(&paTests[iTest].InVal1.ar64[0]), FormatR64(&paTests[iTest].InVal1.ar64[1]), 5917 5908 FormatR64(&paTests[iTest].InVal2.ar64[0]), FormatR64(&paTests[iTest].InVal2.ar64[1]), 5918 iVar ? " " : "", Res.MXCSR,5919 FormatR64(&Res. uResult.ar64[0]), FormatR64(&Res.uResult.ar64[1]),5909 iVar ? " " : "", uMxCsrOut, 5910 FormatR64(&Res.ar64[0]), FormatR64(&Res.ar64[1]), 5920 5911 iVar ? " " : "", paTests[iTest].fMxcsrOut, 5921 5912 FormatR64(&paTests[iTest].OutVal.ar64[0]), FormatR64(&paTests[iTest].OutVal.ar64[1]), 5922 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),5923 ( !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[0], &paTests[iTest].OutVal.ar64[0])5924 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[1], &paTests[iTest].OutVal.ar64[1]))5913 MxcsrDiff(uMxCsrOut, paTests[iTest].fMxcsrOut), 5914 ( !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[0], &paTests[iTest].OutVal.ar64[0]) 5915 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[1], &paTests[iTest].OutVal.ar64[1])) 5925 5916 ? " - val" : "", 5926 5917 FormatMxcsr(paTests[iTest].fMxcsrIn) ); … … 5963 5954 }; 5964 5955 5965 X86FXSTATE State;5966 RT_ZERO(State);5967 5956 uint32_t cMinNormalPairs = (cTests - 144) / 4; 5968 5957 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryU128R32); iFn++) … … 6002 5991 for (uint8_t iFz = 0; iFz < 2; iFz++) 6003 5992 { 6004 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)6005 | (iRounding << X86_MXCSR_RC_SHIFT)6006 | (iDaz ? X86_MXCSR_DAZ : 0)6007 | (iFz ? X86_MXCSR_FZ : 0)6008 | X86_MXCSR_XCPT_MASK;6009 IEMSSERESULTResM; RT_ZERO(ResM);6010 pfn(&State, &ResM, &TestData.InVal1, &TestData.r32Val2);6011 TestData.fMxcsrIn = State.MXCSR;6012 TestData.fMxcsrOut = ResM.MXCSR;6013 TestData.OutVal = ResM .uResult;5993 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 5994 | (iRounding << X86_MXCSR_RC_SHIFT) 5995 | (iDaz ? X86_MXCSR_DAZ : 0) 5996 | (iFz ? X86_MXCSR_FZ : 0) 5997 | X86_MXCSR_XCPT_MASK; 5998 X86XMMREG ResM; RT_ZERO(ResM); 5999 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &ResM, &TestData.InVal1, &TestData.r32Val2); 6000 TestData.fMxcsrIn = uMxCsrIn; 6001 TestData.fMxcsrOut = uMxCsrOutM; 6002 TestData.OutVal = ResM; 6014 6003 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6015 6004 6016 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;6017 IEMSSERESULTResU; RT_ZERO(ResU);6018 pfn(&State, &ResU, &TestData.InVal1, &TestData.r32Val2);6019 TestData.fMxcsrIn = State.MXCSR;6020 TestData.fMxcsrOut = ResU.MXCSR;6021 TestData.OutVal = ResU .uResult;6005 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6006 X86XMMREG ResU; RT_ZERO(ResU); 6007 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &ResU, &TestData.InVal1, &TestData.r32Val2); 6008 TestData.fMxcsrIn = uMxCsrIn; 6009 TestData.fMxcsrOut = uMxCsrOutU; 6010 TestData.OutVal = ResU; 6022 6011 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6023 6012 6024 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;6013 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 6025 6014 if (fXcpt) 6026 6015 { 6027 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;6028 IEMSSERESULTRes1; RT_ZERO(Res1);6029 pfn(&State, &Res1, &TestData.InVal1, &TestData.r32Val2);6030 TestData.fMxcsrIn = State.MXCSR;6031 TestData.fMxcsrOut = Res1.MXCSR;6032 TestData.OutVal = Res1 .uResult;6016 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6017 X86XMMREG Res1; RT_ZERO(Res1); 6018 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &Res1, &TestData.InVal1, &TestData.r32Val2); 6019 TestData.fMxcsrIn = uMxCsrIn; 6020 TestData.fMxcsrOut = uMxCsrOut1; 6021 TestData.OutVal = Res1; 6033 6022 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6034 6023 6035 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))6024 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 6036 6025 { 6037 fXcpt |= Res1.MXCSR& X86_MXCSR_XCPT_FLAGS;6038 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);6039 IEMSSERESULTRes2; RT_ZERO(Res2);6040 pfn(&State, &Res2, &TestData.InVal1, &TestData.r32Val2);6041 TestData.fMxcsrIn = State.MXCSR;6042 TestData.fMxcsrOut = Res2.MXCSR;6043 TestData.OutVal = Res2 .uResult;6026 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 6027 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6028 X86XMMREG Res2; RT_ZERO(Res2); 6029 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &Res2, &TestData.InVal1, &TestData.r32Val2); 6030 TestData.fMxcsrIn = uMxCsrIn; 6031 TestData.fMxcsrOut = uMxCsrOut2; 6032 TestData.OutVal = Res2; 6044 6033 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6045 6034 } … … 6048 6037 if (fUnmasked & fXcpt) 6049 6038 { 6050 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);6051 IEMSSERESULTRes3; RT_ZERO(Res3);6052 pfn(&State, &Res3, &TestData.InVal1, &TestData.r32Val2);6053 TestData.fMxcsrIn = State.MXCSR;6054 TestData.fMxcsrOut = Res3.MXCSR;6055 TestData.OutVal = Res3 .uResult;6039 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6040 X86XMMREG Res3; RT_ZERO(Res3); 6041 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &Res3, &TestData.InVal1, &TestData.r32Val2); 6042 TestData.fMxcsrIn = uMxCsrIn; 6043 TestData.fMxcsrOut = uMxCsrOut3; 6044 TestData.OutVal = Res3; 6056 6045 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6057 6046 } … … 6068 6057 static void SseBinaryU128R32Test(void) 6069 6058 { 6070 X86FXSTATE State;6071 RT_ZERO(State);6072 6059 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryU128R32); iFn++) 6073 6060 { … … 6084 6071 for (uint32_t iTest = 0; iTest < cTests; iTest++) 6085 6072 { 6086 IEMSSERESULTRes; RT_ZERO(Res);6087 6088 State.MXCSR= paTests[iTest].fMxcsrIn;6089 pfn(&State, &Res, &paTests[iTest].InVal1, &paTests[iTest].r32Val2);6090 bool fValsIdentical = RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[0], &paTests[iTest].OutVal.ar32[0])6091 && RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[1], &paTests[iTest].OutVal.ar32[1])6092 && RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[2], &paTests[iTest].OutVal.ar32[2])6093 && RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[3], &paTests[iTest].OutVal.ar32[3]);6094 if ( Res.MXCSR!= paTests[iTest].fMxcsrOut6073 X86XMMREG Res; RT_ZERO(Res); 6074 6075 uint32_t uMxCsrIn = paTests[iTest].fMxcsrIn; 6076 uint32_t uMxCsrOut = pfn(uMxCsrIn, &Res, &paTests[iTest].InVal1, &paTests[iTest].r32Val2); 6077 bool fValsIdentical = RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[0], &paTests[iTest].OutVal.ar32[0]) 6078 && RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[1], &paTests[iTest].OutVal.ar32[1]) 6079 && RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[2], &paTests[iTest].OutVal.ar32[2]) 6080 && RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[3], &paTests[iTest].OutVal.ar32[3]); 6081 if ( uMxCsrOut != paTests[iTest].fMxcsrOut 6095 6082 || !fValsIdentical) 6096 6083 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s'%s'%s in2=%s\n" … … 6101 6088 FormatR32(&paTests[iTest].InVal1.ar32[2]), FormatR32(&paTests[iTest].InVal1.ar32[3]), 6102 6089 FormatR32(&paTests[iTest].r32Val2), 6103 iVar ? " " : "", Res.MXCSR,6104 FormatR32(&Res. uResult.ar32[0]), FormatR32(&Res.uResult.ar32[1]),6105 FormatR32(&Res. uResult.ar32[2]), FormatR32(&Res.uResult.ar32[3]),6090 iVar ? " " : "", uMxCsrOut, 6091 FormatR32(&Res.ar32[0]), FormatR32(&Res.ar32[1]), 6092 FormatR32(&Res.ar32[2]), FormatR32(&Res.ar32[3]), 6106 6093 iVar ? " " : "", paTests[iTest].fMxcsrOut, 6107 6094 FormatR32(&paTests[iTest].OutVal.ar32[0]), FormatR32(&paTests[iTest].OutVal.ar32[1]), 6108 6095 FormatR32(&paTests[iTest].OutVal.ar32[2]), FormatR32(&paTests[iTest].OutVal.ar32[3]), 6109 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),6096 MxcsrDiff(uMxCsrOut, paTests[iTest].fMxcsrOut), 6110 6097 !fValsIdentical ? " - val" : "", 6111 6098 FormatMxcsr(paTests[iTest].fMxcsrIn) ); … … 6147 6134 }; 6148 6135 6149 X86FXSTATE State;6150 RT_ZERO(State);6151 6136 uint32_t cMinNormalPairs = (cTests - 144) / 4; 6152 6137 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryU128R64); iFn++) … … 6180 6165 for (uint8_t iFz = 0; iFz < 2; iFz++) 6181 6166 { 6182 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 6183 | (iRounding << X86_MXCSR_RC_SHIFT) 6184 | (iDaz ? X86_MXCSR_DAZ : 0) 6185 | (iFz ? X86_MXCSR_FZ : 0) 6186 | X86_MXCSR_XCPT_MASK; 6187 IEMSSERESULT ResM; RT_ZERO(ResM); 6188 pfn(&State, &ResM, &TestData.InVal1, &TestData.r64Val2); 6189 TestData.fMxcsrIn = State.MXCSR; 6190 TestData.fMxcsrOut = ResM.MXCSR; 6191 TestData.OutVal = ResM.uResult; 6167 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 6168 | (iRounding << X86_MXCSR_RC_SHIFT) 6169 | (iDaz ? X86_MXCSR_DAZ : 0) 6170 | (iFz ? X86_MXCSR_FZ : 0) 6171 | X86_MXCSR_XCPT_MASK; 6172 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &TestData.OutVal, &TestData.InVal1, &TestData.r64Val2); 6173 TestData.fMxcsrIn = uMxCsrIn; 6174 TestData.fMxcsrOut = uMxCsrOutM; 6192 6175 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6193 6176 6194 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 6195 IEMSSERESULT ResU; RT_ZERO(ResU); 6196 pfn(&State, &ResU, &TestData.InVal1, &TestData.r64Val2); 6197 TestData.fMxcsrIn = State.MXCSR; 6198 TestData.fMxcsrOut = ResU.MXCSR; 6199 TestData.OutVal = ResU.uResult; 6177 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6178 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &TestData.OutVal, &TestData.InVal1, &TestData.r64Val2); 6179 TestData.fMxcsrIn = uMxCsrIn; 6180 TestData.fMxcsrOut = uMxCsrOutU; 6200 6181 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6201 6182 6202 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;6183 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 6203 6184 if (fXcpt) 6204 6185 { 6205 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6206 IEMSSERESULT Res1; RT_ZERO(Res1); 6207 pfn(&State, &Res1, &TestData.InVal1, &TestData.r64Val2); 6208 TestData.fMxcsrIn = State.MXCSR; 6209 TestData.fMxcsrOut = Res1.MXCSR; 6210 TestData.OutVal = Res1.uResult; 6186 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6187 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.InVal1, &TestData.r64Val2); 6188 TestData.fMxcsrIn = uMxCsrIn; 6189 TestData.fMxcsrOut = uMxCsrOut1; 6211 6190 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6212 6191 6213 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))6192 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 6214 6193 { 6215 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 6216 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6217 IEMSSERESULT Res2; RT_ZERO(Res2); 6218 pfn(&State, &Res2, &TestData.InVal1, &TestData.r64Val2); 6219 TestData.fMxcsrIn = State.MXCSR; 6220 TestData.fMxcsrOut = Res2.MXCSR; 6221 TestData.OutVal = Res2.uResult; 6194 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 6195 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6196 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.InVal1, &TestData.r64Val2); 6197 TestData.fMxcsrIn = uMxCsrIn; 6198 TestData.fMxcsrOut = uMxCsrOut2; 6222 6199 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6223 6200 } … … 6226 6203 if (fUnmasked & fXcpt) 6227 6204 { 6228 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6229 IEMSSERESULT Res3; RT_ZERO(Res3); 6230 pfn(&State, &Res3, &TestData.InVal1, &TestData.r64Val2); 6231 TestData.fMxcsrIn = State.MXCSR; 6232 TestData.fMxcsrOut = Res3.MXCSR; 6233 TestData.OutVal = Res3.uResult; 6205 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6206 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.InVal1, &TestData.r64Val2); 6207 TestData.fMxcsrIn = uMxCsrIn; 6208 TestData.fMxcsrOut = uMxCsrOut3; 6234 6209 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6235 6210 } … … 6247 6222 static void SseBinaryU128R64Test(void) 6248 6223 { 6249 X86FXSTATE State;6250 RT_ZERO(State);6251 6224 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryU128R64); iFn++) 6252 6225 { … … 6263 6236 for (uint32_t iTest = 0; iTest < cTests; iTest++) 6264 6237 { 6265 IEMSSERESULTRes; RT_ZERO(Res);6266 6267 State.MXCSR= paTests[iTest].fMxcsrIn;6268 pfn(&State, &Res, &paTests[iTest].InVal1, &paTests[iTest].r64Val2);6269 if ( Res.MXCSR!= paTests[iTest].fMxcsrOut6270 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[0], &paTests[iTest].OutVal.ar64[0])6271 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[1], &paTests[iTest].OutVal.ar64[1]))6238 X86XMMREG Res; RT_ZERO(Res); 6239 6240 uint32_t uMxCsrIn = paTests[iTest].fMxcsrIn; 6241 uint32_t uMxCsrOut = pfn(uMxCsrIn, &Res, &paTests[iTest].InVal1, &paTests[iTest].r64Val2); 6242 if ( uMxCsrOut != paTests[iTest].fMxcsrOut 6243 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[0], &paTests[iTest].OutVal.ar64[0]) 6244 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[1], &paTests[iTest].OutVal.ar64[1])) 6272 6245 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s in2=%s\n" 6273 6246 "%s -> mxcsr=%#08x %s'%s\n" … … 6276 6249 FormatR64(&paTests[iTest].InVal1.ar64[0]), FormatR64(&paTests[iTest].InVal1.ar64[1]), 6277 6250 FormatR64(&paTests[iTest].r64Val2), 6278 iVar ? " " : "", Res.MXCSR,6279 FormatR64(&Res. uResult.ar64[0]), FormatR64(&Res.uResult.ar64[1]),6251 iVar ? " " : "", uMxCsrOut, 6252 FormatR64(&Res.ar64[0]), FormatR64(&Res.ar64[1]), 6280 6253 iVar ? " " : "", paTests[iTest].fMxcsrOut, 6281 6254 FormatR64(&paTests[iTest].OutVal.ar64[0]), FormatR64(&paTests[iTest].OutVal.ar64[1]), 6282 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),6283 ( !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[0], &paTests[iTest].OutVal.ar64[0])6284 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[1], &paTests[iTest].OutVal.ar64[1]))6255 MxcsrDiff(uMxCsrOut, paTests[iTest].fMxcsrOut), 6256 ( !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[0], &paTests[iTest].OutVal.ar64[0]) 6257 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[1], &paTests[iTest].OutVal.ar64[1])) 6285 6258 ? " - val" : "", 6286 6259 FormatMxcsr(paTests[iTest].fMxcsrIn) ); … … 6316 6289 }; 6317 6290 6318 X86FXSTATE State;6319 RT_ZERO(State);6320 6291 uint32_t cMinNormalPairs = (cTests - 144) / 4; 6321 6292 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryI32R64); iFn++) … … 6346 6317 for (uint8_t iFz = 0; iFz < 2; iFz++) 6347 6318 { 6348 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)6349 | (iRounding << X86_MXCSR_RC_SHIFT)6350 | (iDaz ? X86_MXCSR_DAZ : 0)6351 | (iFz ? X86_MXCSR_FZ : 0)6352 | X86_MXCSR_XCPT_MASK;6319 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 6320 | (iRounding << X86_MXCSR_RC_SHIFT) 6321 | (iDaz ? X86_MXCSR_DAZ : 0) 6322 | (iFz ? X86_MXCSR_FZ : 0) 6323 | X86_MXCSR_XCPT_MASK; 6353 6324 uint32_t fMxcsrM; int32_t i32OutM; 6354 pfn(&State, &fMxcsrM, &i32OutM, &TestData.r64ValIn.u);6355 TestData.fMxcsrIn = State.MXCSR;6325 fMxcsrM = pfn(uMxCsrIn, &i32OutM, &TestData.r64ValIn.u); 6326 TestData.fMxcsrIn = uMxCsrIn; 6356 6327 TestData.fMxcsrOut = fMxcsrM; 6357 6328 TestData.i32ValOut = i32OutM; 6358 6329 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6359 6330 6360 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;6331 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6361 6332 uint32_t fMxcsrU; int32_t i32OutU; 6362 pfn(&State, &fMxcsrU, &i32OutU, &TestData.r64ValIn.u);6363 TestData.fMxcsrIn = State.MXCSR;6333 fMxcsrU = pfn(uMxCsrIn, &i32OutU, &TestData.r64ValIn.u); 6334 TestData.fMxcsrIn = uMxCsrIn; 6364 6335 TestData.fMxcsrOut = fMxcsrU; 6365 6336 TestData.i32ValOut = i32OutU; … … 6369 6340 if (fXcpt) 6370 6341 { 6371 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;6342 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6372 6343 uint32_t fMxcsr1; int32_t i32Out1; 6373 pfn(&State, &fMxcsr1, &i32Out1, &TestData.r64ValIn.u);6374 TestData.fMxcsrIn = State.MXCSR;6344 fMxcsr1 = pfn(uMxCsrIn, &i32Out1, &TestData.r64ValIn.u); 6345 TestData.fMxcsrIn = uMxCsrIn; 6375 6346 TestData.fMxcsrOut = fMxcsr1; 6376 6347 TestData.i32ValOut = i32Out1; … … 6380 6351 { 6381 6352 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 6382 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);6353 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6383 6354 uint32_t fMxcsr2; int32_t i32Out2; 6384 pfn(&State, &fMxcsr2, &i32Out2, &TestData.r64ValIn.u);6385 TestData.fMxcsrIn = State.MXCSR;6355 fMxcsr2 = pfn(uMxCsrIn, &i32Out2, &TestData.r64ValIn.u); 6356 TestData.fMxcsrIn = uMxCsrIn; 6386 6357 TestData.fMxcsrOut = fMxcsr2; 6387 6358 TestData.i32ValOut = i32Out2; … … 6392 6363 if (fUnmasked & fXcpt) 6393 6364 { 6394 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);6365 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6395 6366 uint32_t fMxcsr3; int32_t i32Out3; 6396 pfn(&State, &fMxcsr3, &i32Out3, &TestData.r64ValIn.u);6397 TestData.fMxcsrIn = State.MXCSR;6367 fMxcsr3 = pfn(uMxCsrIn, &i32Out3, &TestData.r64ValIn.u); 6368 TestData.fMxcsrIn = uMxCsrIn; 6398 6369 TestData.fMxcsrOut = fMxcsr3; 6399 6370 TestData.i32ValOut = i32Out3; … … 6429 6400 for (uint32_t iTest = 0; iTest < cTests; iTest++) 6430 6401 { 6431 uint32_t fMxcsr = 0;6432 6402 int32_t i32Dst = 0; 6433 6403 6434 State.MXCSR = paTests[iTest].fMxcsrIn; 6435 pfn(&State, &fMxcsr, &i32Dst, &paTests[iTest].r64ValIn.u); 6404 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &i32Dst, &paTests[iTest].r64ValIn.u); 6436 6405 if ( fMxcsr != paTests[iTest].fMxcsrOut 6437 6406 || i32Dst != paTests[iTest].i32ValOut) … … 6478 6447 }; 6479 6448 6480 X86FXSTATE State;6481 RT_ZERO(State);6482 6449 uint32_t cMinNormalPairs = (cTests - 144) / 4; 6483 6450 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryI64R64); iFn++) … … 6508 6475 for (uint8_t iFz = 0; iFz < 2; iFz++) 6509 6476 { 6510 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)6511 | (iRounding << X86_MXCSR_RC_SHIFT)6512 | (iDaz ? X86_MXCSR_DAZ : 0)6513 | (iFz ? X86_MXCSR_FZ : 0)6514 | X86_MXCSR_XCPT_MASK;6477 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 6478 | (iRounding << X86_MXCSR_RC_SHIFT) 6479 | (iDaz ? X86_MXCSR_DAZ : 0) 6480 | (iFz ? X86_MXCSR_FZ : 0) 6481 | X86_MXCSR_XCPT_MASK; 6515 6482 uint32_t fMxcsrM; int64_t i64OutM; 6516 pfn(&State, &fMxcsrM, &i64OutM, &TestData.r64ValIn.u);6517 TestData.fMxcsrIn = State.MXCSR;6483 fMxcsrM = pfn(uMxCsrIn, &i64OutM, &TestData.r64ValIn.u); 6484 TestData.fMxcsrIn = uMxCsrIn; 6518 6485 TestData.fMxcsrOut = fMxcsrM; 6519 6486 TestData.i64ValOut = i64OutM; 6520 6487 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6521 6488 6522 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;6489 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6523 6490 uint32_t fMxcsrU; int64_t i64OutU; 6524 pfn(&State, &fMxcsrU, &i64OutU, &TestData.r64ValIn.u);6525 TestData.fMxcsrIn = State.MXCSR;6491 fMxcsrU =pfn(uMxCsrIn, &i64OutU, &TestData.r64ValIn.u); 6492 TestData.fMxcsrIn = uMxCsrIn; 6526 6493 TestData.fMxcsrOut = fMxcsrU; 6527 6494 TestData.i64ValOut = i64OutU; … … 6531 6498 if (fXcpt) 6532 6499 { 6533 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;6500 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6534 6501 uint32_t fMxcsr1; int64_t i64Out1; 6535 pfn(&State, &fMxcsr1, &i64Out1, &TestData.r64ValIn.u);6536 TestData.fMxcsrIn = State.MXCSR;6502 fMxcsr1 = pfn(uMxCsrIn, &i64Out1, &TestData.r64ValIn.u); 6503 TestData.fMxcsrIn = uMxCsrIn; 6537 6504 TestData.fMxcsrOut = fMxcsr1; 6538 6505 TestData.i64ValOut = i64Out1; … … 6542 6509 { 6543 6510 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 6544 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);6511 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6545 6512 uint32_t fMxcsr2; int64_t i64Out2; 6546 pfn(&State, &fMxcsr2, &i64Out2, &TestData.r64ValIn.u);6547 TestData.fMxcsrIn = State.MXCSR;6513 fMxcsr2 = pfn(uMxCsrIn, &i64Out2, &TestData.r64ValIn.u); 6514 TestData.fMxcsrIn = uMxCsrIn; 6548 6515 TestData.fMxcsrOut = fMxcsr2; 6549 6516 TestData.i64ValOut = i64Out2; … … 6554 6521 if (fUnmasked & fXcpt) 6555 6522 { 6556 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);6523 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6557 6524 uint32_t fMxcsr3; int64_t i64Out3; 6558 pfn(&State, &fMxcsr3, &i64Out3, &TestData.r64ValIn.u);6559 TestData.fMxcsrIn = State.MXCSR;6525 fMxcsr3 = pfn(uMxCsrIn, &i64Out3, &TestData.r64ValIn.u); 6526 TestData.fMxcsrIn = uMxCsrIn; 6560 6527 TestData.fMxcsrOut = fMxcsr3; 6561 6528 TestData.i64ValOut = i64Out3; … … 6591 6558 for (uint32_t iTest = 0; iTest < cTests; iTest++) 6592 6559 { 6593 uint32_t fMxcsr = 0;6594 6560 int64_t i64Dst = 0; 6595 6596 State.MXCSR = paTests[iTest].fMxcsrIn; 6597 pfn(&State, &fMxcsr, &i64Dst, &paTests[iTest].r64ValIn.u); 6561 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &i64Dst, &paTests[iTest].r64ValIn.u); 6598 6562 if ( fMxcsr != paTests[iTest].fMxcsrOut 6599 6563 || i64Dst != paTests[iTest].i64ValOut) … … 6640 6604 }; 6641 6605 6642 X86FXSTATE State;6643 RT_ZERO(State);6644 6606 uint32_t cMinNormalPairs = (cTests - 144) / 4; 6645 6607 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryI32R32); iFn++) … … 6670 6632 for (uint8_t iFz = 0; iFz < 2; iFz++) 6671 6633 { 6672 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)6673 | (iRounding << X86_MXCSR_RC_SHIFT)6674 | (iDaz ? X86_MXCSR_DAZ : 0)6675 | (iFz ? X86_MXCSR_FZ : 0)6676 | X86_MXCSR_XCPT_MASK;6634 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 6635 | (iRounding << X86_MXCSR_RC_SHIFT) 6636 | (iDaz ? X86_MXCSR_DAZ : 0) 6637 | (iFz ? X86_MXCSR_FZ : 0) 6638 | X86_MXCSR_XCPT_MASK; 6677 6639 uint32_t fMxcsrM; int32_t i32OutM; 6678 pfn(&State, &fMxcsrM, &i32OutM, &TestData.r32ValIn.u);6679 TestData.fMxcsrIn = State.MXCSR;6640 fMxcsrM = pfn(uMxCsrIn, &i32OutM, &TestData.r32ValIn.u); 6641 TestData.fMxcsrIn = uMxCsrIn; 6680 6642 TestData.fMxcsrOut = fMxcsrM; 6681 6643 TestData.i32ValOut = i32OutM; 6682 6644 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6683 6645 6684 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;6646 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6685 6647 uint32_t fMxcsrU; int32_t i32OutU; 6686 pfn(&State, &fMxcsrU, &i32OutU, &TestData.r32ValIn.u);6687 TestData.fMxcsrIn = State.MXCSR;6648 fMxcsrU = pfn(uMxCsrIn, &i32OutU, &TestData.r32ValIn.u); 6649 TestData.fMxcsrIn = uMxCsrIn; 6688 6650 TestData.fMxcsrOut = fMxcsrU; 6689 6651 TestData.i32ValOut = i32OutU; … … 6693 6655 if (fXcpt) 6694 6656 { 6695 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;6657 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6696 6658 uint32_t fMxcsr1; int32_t i32Out1; 6697 pfn(&State, &fMxcsr1, &i32Out1, &TestData.r32ValIn.u);6698 TestData.fMxcsrIn = State.MXCSR;6659 fMxcsr1 = pfn(uMxCsrIn, &i32Out1, &TestData.r32ValIn.u); 6660 TestData.fMxcsrIn = uMxCsrIn; 6699 6661 TestData.fMxcsrOut = fMxcsr1; 6700 6662 TestData.i32ValOut = i32Out1; … … 6704 6666 { 6705 6667 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 6706 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);6668 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6707 6669 uint32_t fMxcsr2; int32_t i32Out2; 6708 pfn(&State, &fMxcsr2, &i32Out2, &TestData.r32ValIn.u);6709 TestData.fMxcsrIn = State.MXCSR;6670 fMxcsr2 = pfn(uMxCsrIn, &i32Out2, &TestData.r32ValIn.u); 6671 TestData.fMxcsrIn = uMxCsrIn; 6710 6672 TestData.fMxcsrOut = fMxcsr2; 6711 6673 TestData.i32ValOut = i32Out2; … … 6716 6678 if (fUnmasked & fXcpt) 6717 6679 { 6718 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);6680 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6719 6681 uint32_t fMxcsr3; int32_t i32Out3; 6720 pfn(&State, &fMxcsr3, &i32Out3, &TestData.r32ValIn.u);6721 TestData.fMxcsrIn = State.MXCSR;6682 fMxcsr3 = pfn(uMxCsrIn, &i32Out3, &TestData.r32ValIn.u); 6683 TestData.fMxcsrIn = uMxCsrIn; 6722 6684 TestData.fMxcsrOut = fMxcsr3; 6723 6685 TestData.i32ValOut = i32Out3; … … 6753 6715 for (uint32_t iTest = 0; iTest < cTests; iTest++) 6754 6716 { 6755 uint32_t fMxcsr = 0;6756 6717 int32_t i32Dst = 0; 6757 6718 6758 State.MXCSR = paTests[iTest].fMxcsrIn; 6759 pfn(&State, &fMxcsr, &i32Dst, &paTests[iTest].r32ValIn.u); 6719 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &i32Dst, &paTests[iTest].r32ValIn.u); 6760 6720 if ( fMxcsr != paTests[iTest].fMxcsrOut 6761 6721 || i32Dst != paTests[iTest].i32ValOut) … … 6832 6792 for (uint8_t iFz = 0; iFz < 2; iFz++) 6833 6793 { 6834 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)6835 | (iRounding << X86_MXCSR_RC_SHIFT)6836 | (iDaz ? X86_MXCSR_DAZ : 0)6837 | (iFz ? X86_MXCSR_FZ : 0)6838 | X86_MXCSR_XCPT_MASK;6794 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 6795 | (iRounding << X86_MXCSR_RC_SHIFT) 6796 | (iDaz ? X86_MXCSR_DAZ : 0) 6797 | (iFz ? X86_MXCSR_FZ : 0) 6798 | X86_MXCSR_XCPT_MASK; 6839 6799 uint32_t fMxcsrM; int64_t i64OutM; 6840 pfn(&State, &fMxcsrM, &i64OutM, &TestData.r32ValIn.u);6800 fMxcsrM = pfn(uMxCsrIn, &i64OutM, &TestData.r32ValIn.u); 6841 6801 TestData.fMxcsrIn = State.MXCSR; 6842 6802 TestData.fMxcsrOut = fMxcsrM; … … 6844 6804 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6845 6805 6846 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;6806 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6847 6807 uint32_t fMxcsrU; int64_t i64OutU; 6848 pfn(&State, &fMxcsrU, &i64OutU, &TestData.r32ValIn.u);6808 fMxcsrU = pfn(uMxCsrIn, &i64OutU, &TestData.r32ValIn.u); 6849 6809 TestData.fMxcsrIn = State.MXCSR; 6850 6810 TestData.fMxcsrOut = fMxcsrU; … … 6855 6815 if (fXcpt) 6856 6816 { 6857 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;6817 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 6858 6818 uint32_t fMxcsr1; int64_t i64Out1; 6859 pfn(&State, &fMxcsr1, &i64Out1, &TestData.r32ValIn.u);6819 fMxcsr1 = pfn(uMxCsrIn, &i64Out1, &TestData.r32ValIn.u); 6860 6820 TestData.fMxcsrIn = State.MXCSR; 6861 6821 TestData.fMxcsrOut = fMxcsr1; … … 6866 6826 { 6867 6827 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 6868 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);6828 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 6869 6829 uint32_t fMxcsr2; int64_t i64Out2; 6870 pfn(&State, &fMxcsr2, &i64Out2, &TestData.r32ValIn.u);6830 fMxcsr2 = pfn(uMxCsrIn, &i64Out2, &TestData.r32ValIn.u); 6871 6831 TestData.fMxcsrIn = State.MXCSR; 6872 6832 TestData.fMxcsrOut = fMxcsr2; … … 6878 6838 if (fUnmasked & fXcpt) 6879 6839 { 6880 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);6840 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 6881 6841 uint32_t fMxcsr3; int64_t i64Out3; 6882 pfn(&State, &fMxcsr3, &i64Out3, &TestData.r32ValIn.u);6842 fMxcsr3 = pfn(uMxCsrIn, &i64Out3, &TestData.r32ValIn.u); 6883 6843 TestData.fMxcsrIn = State.MXCSR; 6884 6844 TestData.fMxcsrOut = fMxcsr3; … … 6915 6875 for (uint32_t iTest = 0; iTest < cTests; iTest++) 6916 6876 { 6917 uint32_t fMxcsr = 0;6918 6877 int64_t i64Dst = 0; 6919 6878 6920 State.MXCSR = paTests[iTest].fMxcsrIn; 6921 pfn(&State, &fMxcsr, &i64Dst, &paTests[iTest].r32ValIn.u); 6879 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &i64Dst, &paTests[iTest].r32ValIn.u); 6922 6880 if ( fMxcsr != paTests[iTest].fMxcsrOut 6923 6881 || i64Dst != paTests[iTest].i64ValOut) … … 6964 6922 }; 6965 6923 6966 X86FXSTATE State;6967 RT_ZERO(State);6968 6924 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR64I32); iFn++) 6969 6925 { … … 6984 6940 for (uint8_t iFz = 0; iFz < 2; iFz++) 6985 6941 { 6986 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)6987 | (iRounding << X86_MXCSR_RC_SHIFT)6988 | (iDaz ? X86_MXCSR_DAZ : 0)6989 | (iFz ? X86_MXCSR_FZ : 0)6990 | X86_MXCSR_XCPT_MASK;6942 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 6943 | (iRounding << X86_MXCSR_RC_SHIFT) 6944 | (iDaz ? X86_MXCSR_DAZ : 0) 6945 | (iFz ? X86_MXCSR_FZ : 0) 6946 | X86_MXCSR_XCPT_MASK; 6991 6947 uint32_t fMxcsrM; RTFLOAT64U r64OutM; 6992 pfn(&State, &fMxcsrM, &r64OutM, &TestData.i32ValIn);6993 TestData.fMxcsrIn = State.MXCSR;6948 fMxcsrM = pfn(uMxCsrIn, &r64OutM, &TestData.i32ValIn); 6949 TestData.fMxcsrIn = uMxCsrIn; 6994 6950 TestData.fMxcsrOut = fMxcsrM; 6995 6951 TestData.r64ValOut = r64OutM; 6996 6952 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 6997 6953 6998 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;6954 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 6999 6955 uint32_t fMxcsrU; RTFLOAT64U r64OutU; 7000 pfn(&State, &fMxcsrU, &r64OutU, &TestData.i32ValIn);7001 TestData.fMxcsrIn = State.MXCSR;6956 fMxcsrU = pfn(uMxCsrIn, &r64OutU, &TestData.i32ValIn); 6957 TestData.fMxcsrIn = uMxCsrIn; 7002 6958 TestData.fMxcsrOut = fMxcsrU; 7003 6959 TestData.r64ValOut = r64OutU; … … 7007 6963 if (fXcpt) 7008 6964 { 7009 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;6965 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7010 6966 uint32_t fMxcsr1; RTFLOAT64U r64Out1; 7011 pfn(&State, &fMxcsr1, &r64Out1, &TestData.i32ValIn);7012 TestData.fMxcsrIn = State.MXCSR;6967 fMxcsr1 = pfn(uMxCsrIn, &r64Out1, &TestData.i32ValIn); 6968 TestData.fMxcsrIn = uMxCsrIn; 7013 6969 TestData.fMxcsrOut = fMxcsr1; 7014 6970 TestData.r64ValOut = r64Out1; … … 7018 6974 { 7019 6975 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 7020 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);6976 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7021 6977 uint32_t fMxcsr2; RTFLOAT64U r64Out2; 7022 pfn(&State, &fMxcsr2, &r64Out2, &TestData.i32ValIn);7023 TestData.fMxcsrIn = State.MXCSR;6978 fMxcsr2 = pfn(uMxCsrIn, &r64Out2, &TestData.i32ValIn); 6979 TestData.fMxcsrIn = uMxCsrIn; 7024 6980 TestData.fMxcsrOut = fMxcsr2; 7025 6981 TestData.r64ValOut = r64Out2; … … 7030 6986 if (fUnmasked & fXcpt) 7031 6987 { 7032 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);6988 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7033 6989 uint32_t fMxcsr3; RTFLOAT64U r64Out3; 7034 pfn(&State, &fMxcsr3, &r64Out3, &TestData.i32ValIn);7035 TestData.fMxcsrIn = State.MXCSR;6990 fMxcsr3 = pfn(uMxCsrIn, &r64Out3, &TestData.i32ValIn); 6991 TestData.fMxcsrIn = uMxCsrIn; 7036 6992 TestData.fMxcsrOut = fMxcsr3; 7037 6993 TestData.r64ValOut = r64Out3; … … 7051 7007 static void SseBinaryR64I32Test(void) 7052 7008 { 7053 X86FXSTATE State;7054 RT_ZERO(State);7055 7009 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR64I32); iFn++) 7056 7010 { … … 7067 7021 for (uint32_t iTest = 0; iTest < cTests; iTest++) 7068 7022 { 7069 uint32_t fMxcsr = 0;7070 7023 RTFLOAT64U r64Dst; RT_ZERO(r64Dst); 7071 7024 7072 State.MXCSR = paTests[iTest].fMxcsrIn; 7073 pfn(&State, &fMxcsr, &r64Dst, &paTests[iTest].i32ValIn); 7025 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &r64Dst, &paTests[iTest].i32ValIn); 7074 7026 if ( fMxcsr != paTests[iTest].fMxcsrOut 7075 7027 || !RTFLOAT64U_ARE_IDENTICAL(&r64Dst, &paTests[iTest].r64ValOut)) … … 7116 7068 }; 7117 7069 7118 X86FXSTATE State;7119 RT_ZERO(State);7120 7070 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR64I64); iFn++) 7121 7071 { … … 7136 7086 for (uint8_t iFz = 0; iFz < 2; iFz++) 7137 7087 { 7138 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)7139 | (iRounding << X86_MXCSR_RC_SHIFT)7140 | (iDaz ? X86_MXCSR_DAZ : 0)7141 | (iFz ? X86_MXCSR_FZ : 0)7142 | X86_MXCSR_XCPT_MASK;7088 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 7089 | (iRounding << X86_MXCSR_RC_SHIFT) 7090 | (iDaz ? X86_MXCSR_DAZ : 0) 7091 | (iFz ? X86_MXCSR_FZ : 0) 7092 | X86_MXCSR_XCPT_MASK; 7143 7093 uint32_t fMxcsrM; RTFLOAT64U r64OutM; 7144 pfn(&State, &fMxcsrM, &r64OutM, &TestData.i64ValIn);7145 TestData.fMxcsrIn = State.MXCSR;7094 fMxcsrM = pfn(uMxCsrIn, &r64OutM, &TestData.i64ValIn); 7095 TestData.fMxcsrIn = uMxCsrIn; 7146 7096 TestData.fMxcsrOut = fMxcsrM; 7147 7097 TestData.r64ValOut = r64OutM; 7148 7098 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 7149 7099 7150 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;7100 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 7151 7101 uint32_t fMxcsrU; RTFLOAT64U r64OutU; 7152 pfn(&State, &fMxcsrU, &r64OutU, &TestData.i64ValIn);7153 TestData.fMxcsrIn = State.MXCSR;7102 fMxcsrU = pfn(uMxCsrIn, &r64OutU, &TestData.i64ValIn); 7103 TestData.fMxcsrIn = uMxCsrIn; 7154 7104 TestData.fMxcsrOut = fMxcsrU; 7155 7105 TestData.r64ValOut = r64OutU; … … 7159 7109 if (fXcpt) 7160 7110 { 7161 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;7111 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7162 7112 uint32_t fMxcsr1; RTFLOAT64U r64Out1; 7163 pfn(&State, &fMxcsr1, &r64Out1, &TestData.i64ValIn);7164 TestData.fMxcsrIn = State.MXCSR;7113 fMxcsr1 = pfn(uMxCsrIn, &r64Out1, &TestData.i64ValIn); 7114 TestData.fMxcsrIn = uMxCsrIn; 7165 7115 TestData.fMxcsrOut = fMxcsr1; 7166 7116 TestData.r64ValOut = r64Out1; … … 7170 7120 { 7171 7121 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 7172 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);7122 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7173 7123 uint32_t fMxcsr2; RTFLOAT64U r64Out2; 7174 pfn(&State, &fMxcsr2, &r64Out2, &TestData.i64ValIn);7175 TestData.fMxcsrIn = State.MXCSR;7124 fMxcsr2 = pfn(uMxCsrIn, &r64Out2, &TestData.i64ValIn); 7125 TestData.fMxcsrIn = uMxCsrIn; 7176 7126 TestData.fMxcsrOut = fMxcsr2; 7177 7127 TestData.r64ValOut = r64Out2; … … 7182 7132 if (fUnmasked & fXcpt) 7183 7133 { 7184 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);7134 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7185 7135 uint32_t fMxcsr3; RTFLOAT64U r64Out3; 7186 pfn(&State, &fMxcsr3, &r64Out3, &TestData.i64ValIn);7187 TestData.fMxcsrIn = State.MXCSR;7136 fMxcsr3 = pfn(uMxCsrIn, &r64Out3, &TestData.i64ValIn); 7137 TestData.fMxcsrIn = uMxCsrIn; 7188 7138 TestData.fMxcsrOut = fMxcsr3; 7189 7139 TestData.r64ValOut = r64Out3; … … 7203 7153 static void SseBinaryR64I64Test(void) 7204 7154 { 7205 X86FXSTATE State;7206 RT_ZERO(State);7207 7155 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR64I64); iFn++) 7208 7156 { … … 7219 7167 for (uint32_t iTest = 0; iTest < cTests; iTest++) 7220 7168 { 7221 uint32_t fMxcsr = 0;7222 7169 RTFLOAT64U r64Dst; RT_ZERO(r64Dst); 7223 7170 7224 State.MXCSR = paTests[iTest].fMxcsrIn; 7225 pfn(&State, &fMxcsr, &r64Dst, &paTests[iTest].i64ValIn); 7171 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &r64Dst, &paTests[iTest].i64ValIn); 7226 7172 if ( fMxcsr != paTests[iTest].fMxcsrOut 7227 7173 || !RTFLOAT64U_ARE_IDENTICAL(&r64Dst, &paTests[iTest].r64ValOut)) … … 7268 7214 }; 7269 7215 7270 X86FXSTATE State;7271 RT_ZERO(State);7272 7216 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR32I32); iFn++) 7273 7217 { … … 7288 7232 for (uint8_t iFz = 0; iFz < 2; iFz++) 7289 7233 { 7290 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)7291 | (iRounding << X86_MXCSR_RC_SHIFT)7292 | (iDaz ? X86_MXCSR_DAZ : 0)7293 | (iFz ? X86_MXCSR_FZ : 0)7294 | X86_MXCSR_XCPT_MASK;7234 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 7235 | (iRounding << X86_MXCSR_RC_SHIFT) 7236 | (iDaz ? X86_MXCSR_DAZ : 0) 7237 | (iFz ? X86_MXCSR_FZ : 0) 7238 | X86_MXCSR_XCPT_MASK; 7295 7239 uint32_t fMxcsrM; RTFLOAT32U r32OutM; 7296 pfn(&State, &fMxcsrM, &r32OutM, &TestData.i32ValIn);7297 TestData.fMxcsrIn = State.MXCSR;7240 fMxcsrM = pfn(uMxCsrIn, &r32OutM, &TestData.i32ValIn); 7241 TestData.fMxcsrIn = uMxCsrIn; 7298 7242 TestData.fMxcsrOut = fMxcsrM; 7299 7243 TestData.r32ValOut = r32OutM; 7300 7244 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 7301 7245 7302 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;7246 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 7303 7247 uint32_t fMxcsrU; RTFLOAT32U r32OutU; 7304 pfn(&State, &fMxcsrU, &r32OutU, &TestData.i32ValIn);7305 TestData.fMxcsrIn = State.MXCSR;7248 fMxcsrU = pfn(uMxCsrIn, &r32OutU, &TestData.i32ValIn); 7249 TestData.fMxcsrIn = uMxCsrIn; 7306 7250 TestData.fMxcsrOut = fMxcsrU; 7307 7251 TestData.r32ValOut = r32OutU; … … 7311 7255 if (fXcpt) 7312 7256 { 7313 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;7257 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7314 7258 uint32_t fMxcsr1; RTFLOAT32U r32Out1; 7315 pfn(&State, &fMxcsr1, &r32Out1, &TestData.i32ValIn);7316 TestData.fMxcsrIn = State.MXCSR;7259 fMxcsr1 = pfn(uMxCsrIn, &r32Out1, &TestData.i32ValIn); 7260 TestData.fMxcsrIn = uMxCsrIn; 7317 7261 TestData.fMxcsrOut = fMxcsr1; 7318 7262 TestData.r32ValOut = r32Out1; … … 7322 7266 { 7323 7267 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 7324 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);7268 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7325 7269 uint32_t fMxcsr2; RTFLOAT32U r32Out2; 7326 pfn(&State, &fMxcsr2, &r32Out2, &TestData.i32ValIn);7327 TestData.fMxcsrIn = State.MXCSR;7270 fMxcsr2 = pfn(uMxCsrIn, &r32Out2, &TestData.i32ValIn); 7271 TestData.fMxcsrIn = uMxCsrIn; 7328 7272 TestData.fMxcsrOut = fMxcsr2; 7329 7273 TestData.r32ValOut = r32Out2; … … 7334 7278 if (fUnmasked & fXcpt) 7335 7279 { 7336 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);7280 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7337 7281 uint32_t fMxcsr3; RTFLOAT32U r32Out3; 7338 pfn(&State, &fMxcsr3, &r32Out3, &TestData.i32ValIn);7339 TestData.fMxcsrIn = State.MXCSR;7282 fMxcsr3 = pfn(uMxCsrIn, &r32Out3, &TestData.i32ValIn); 7283 TestData.fMxcsrIn = uMxCsrIn; 7340 7284 TestData.fMxcsrOut = fMxcsr3; 7341 7285 TestData.r32ValOut = r32Out3; … … 7355 7299 static void SseBinaryR32I32Test(void) 7356 7300 { 7357 X86FXSTATE State;7358 RT_ZERO(State);7359 7301 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR32I32); iFn++) 7360 7302 { … … 7371 7313 for (uint32_t iTest = 0; iTest < cTests; iTest++) 7372 7314 { 7373 uint32_t fMxcsr = 0;7374 7315 RTFLOAT32U r32Dst; RT_ZERO(r32Dst); 7375 7316 7376 State.MXCSR = paTests[iTest].fMxcsrIn; 7377 pfn(&State, &fMxcsr, &r32Dst, &paTests[iTest].i32ValIn); 7317 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &r32Dst, &paTests[iTest].i32ValIn); 7378 7318 if ( fMxcsr != paTests[iTest].fMxcsrOut 7379 7319 || !RTFLOAT32U_ARE_IDENTICAL(&r32Dst, &paTests[iTest].r32ValOut)) … … 7420 7360 }; 7421 7361 7422 X86FXSTATE State;7423 RT_ZERO(State);7424 7362 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR32I64); iFn++) 7425 7363 { … … 7440 7378 for (uint8_t iFz = 0; iFz < 2; iFz++) 7441 7379 { 7442 State.MXCSR= (fMxcsr & ~X86_MXCSR_RC_MASK)7443 | (iRounding << X86_MXCSR_RC_SHIFT)7444 | (iDaz ? X86_MXCSR_DAZ : 0)7445 | (iFz ? X86_MXCSR_FZ : 0)7446 | X86_MXCSR_XCPT_MASK;7380 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 7381 | (iRounding << X86_MXCSR_RC_SHIFT) 7382 | (iDaz ? X86_MXCSR_DAZ : 0) 7383 | (iFz ? X86_MXCSR_FZ : 0) 7384 | X86_MXCSR_XCPT_MASK; 7447 7385 uint32_t fMxcsrM; RTFLOAT32U r32OutM; 7448 pfn(&State, &fMxcsrM, &r32OutM, &TestData.i64ValIn);7449 TestData.fMxcsrIn = State.MXCSR;7386 fMxcsrM = pfn(uMxCsrIn, &r32OutM, &TestData.i64ValIn); 7387 TestData.fMxcsrIn = uMxCsrIn; 7450 7388 TestData.fMxcsrOut = fMxcsrM; 7451 7389 TestData.r32ValOut = r32OutM; 7452 7390 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 7453 7391 7454 State.MXCSR = State.MXCSR& ~X86_MXCSR_XCPT_MASK;7392 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 7455 7393 uint32_t fMxcsrU; RTFLOAT32U r32OutU; 7456 pfn(&State, &fMxcsrU, &r32OutU, &TestData.i64ValIn);7457 TestData.fMxcsrIn = State.MXCSR;7394 fMxcsrU = pfn(uMxCsrIn, &r32OutU, &TestData.i64ValIn); 7395 TestData.fMxcsrIn = uMxCsrIn; 7458 7396 TestData.fMxcsrOut = fMxcsrU; 7459 7397 TestData.r32ValOut = r32OutU; … … 7463 7401 if (fXcpt) 7464 7402 { 7465 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | fXcpt;7403 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7466 7404 uint32_t fMxcsr1; RTFLOAT32U r32Out1; 7467 pfn(&State, &fMxcsr1, &r32Out1, &TestData.i64ValIn);7468 TestData.fMxcsrIn = State.MXCSR;7405 fMxcsr1 = pfn(uMxCsrIn, &r32Out1, &TestData.i64ValIn); 7406 TestData.fMxcsrIn = uMxCsrIn; 7469 7407 TestData.fMxcsrOut = fMxcsr1; 7470 7408 TestData.r32ValOut = r32Out1; … … 7474 7412 { 7475 7413 fXcpt |= fMxcsr1 & X86_MXCSR_XCPT_FLAGS; 7476 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT);7414 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7477 7415 uint32_t fMxcsr2; RTFLOAT32U r32Out2; 7478 pfn(&State, &fMxcsr2, &r32Out2, &TestData.i64ValIn);7479 TestData.fMxcsrIn = State.MXCSR;7416 fMxcsr2 = pfn(uMxCsrIn, &r32Out2, &TestData.i64ValIn); 7417 TestData.fMxcsrIn = uMxCsrIn; 7480 7418 TestData.fMxcsrOut = fMxcsr2; 7481 7419 TestData.r32ValOut = r32Out2; … … 7486 7424 if (fUnmasked & fXcpt) 7487 7425 { 7488 State.MXCSR = (State.MXCSR& ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT);7426 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7489 7427 uint32_t fMxcsr3; RTFLOAT32U r32Out3; 7490 pfn(&State, &fMxcsr3, &r32Out3, &TestData.i64ValIn);7491 TestData.fMxcsrIn = State.MXCSR;7428 fMxcsr3 = pfn(uMxCsrIn, &r32Out3, &TestData.i64ValIn); 7429 TestData.fMxcsrIn = uMxCsrIn; 7492 7430 TestData.fMxcsrOut = fMxcsr3; 7493 7431 TestData.r32ValOut = r32Out3; … … 7507 7445 static void SseBinaryR32I64Test(void) 7508 7446 { 7509 X86FXSTATE State;7510 RT_ZERO(State);7511 7447 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseBinaryR32I64); iFn++) 7512 7448 { … … 7523 7459 for (uint32_t iTest = 0; iTest < cTests; iTest++) 7524 7460 { 7525 uint32_t fMxcsr = 0;7526 7461 RTFLOAT32U r32Dst; RT_ZERO(r32Dst); 7527 7462 7528 State.MXCSR = paTests[iTest].fMxcsrIn; 7529 pfn(&State, &fMxcsr, &r32Dst, &paTests[iTest].i64ValIn); 7463 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &r32Dst, &paTests[iTest].i64ValIn); 7530 7464 if ( fMxcsr != paTests[iTest].fMxcsrOut 7531 7465 || !RTFLOAT32U_ARE_IDENTICAL(&r32Dst, &paTests[iTest].r32ValOut)) … … 7624 7558 uint32_t fMxcsrM = fMxcsrIn; 7625 7559 uint32_t fEFlagsM = fEFlags; 7626 pfn(&fMxcsrM, &fEFlagsM, &ValIn1, &ValIn2);7560 fMxcsrM = pfn(fMxcsrIn, &fEFlagsM, &ValIn1, &ValIn2); 7627 7561 TestData.fMxcsrIn = fMxcsrIn; 7628 7562 TestData.fMxcsrOut = fMxcsrM; … … 7634 7568 uint32_t fMxcsrU = fMxcsrIn; 7635 7569 uint32_t fEFlagsU = fEFlags; 7636 pfn(&fMxcsrU, &fEFlagsU, &ValIn1, &ValIn2);7570 fMxcsrU = pfn(fMxcsrIn, &fEFlagsU, &ValIn1, &ValIn2); 7637 7571 TestData.fMxcsrIn = fMxcsrIn; 7638 7572 TestData.fMxcsrOut = fMxcsrU; … … 7647 7581 uint32_t fMxcsr1 = fMxcsrIn; 7648 7582 uint32_t fEFlags1 = fEFlags; 7649 pfn(&fMxcsr1, &fEFlags1, &ValIn1, &ValIn2);7583 fMxcsr1 = pfn(fMxcsrIn, &fEFlags1, &ValIn1, &ValIn2); 7650 7584 TestData.fMxcsrIn = fMxcsrIn; 7651 7585 TestData.fMxcsrOut = fMxcsr1; … … 7660 7594 uint32_t fMxcsr2 = fMxcsrIn; 7661 7595 uint32_t fEFlags2 = fEFlags; 7662 pfn(&fMxcsr2, &fEFlags2, &ValIn1, &ValIn2);7596 fMxcsr2 = pfn(fMxcsrIn, &fEFlags2, &ValIn1, &ValIn2); 7663 7597 TestData.fMxcsrIn = fMxcsrIn; 7664 7598 TestData.fMxcsrOut = fMxcsr2; … … 7674 7608 uint32_t fMxcsr3 = fMxcsrIn; 7675 7609 uint32_t fEFlags3 = fEFlags; 7676 pfn(&fMxcsr3, &fEFlags3, &ValIn1, &ValIn2);7610 fMxcsr3 = pfn(fMxcsrIn, &fEFlags3, &ValIn1, &ValIn2); 7677 7611 TestData.fMxcsrIn = fMxcsrIn; 7678 7612 TestData.fMxcsrOut = fMxcsr3; … … 7712 7646 ValIn1.ar32[0] = paTests[iTest].r32ValIn1; 7713 7647 ValIn2.ar32[0] = paTests[iTest].r32ValIn2; 7714 uint32_t fMxcsr = paTests[iTest].fMxcsrIn;7715 7648 uint32_t fEFlags = paTests[iTest].fEflIn; 7716 pfn(&fMxcsr, &fEFlags, &ValIn1, &ValIn2);7649 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &fEFlags, &ValIn1, &ValIn2); 7717 7650 if ( fMxcsr != paTests[iTest].fMxcsrOut 7718 7651 || fEFlags != paTests[iTest].fEflOut) … … 7810 7743 uint32_t fMxcsrM = fMxcsrIn; 7811 7744 uint32_t fEFlagsM = fEFlags; 7812 pfn(&fMxcsrM, &fEFlagsM, &ValIn1, &ValIn2);7745 fMxcsrM = pfn(fMxcsrIn, &fEFlagsM, &ValIn1, &ValIn2); 7813 7746 TestData.fMxcsrIn = fMxcsrIn; 7814 7747 TestData.fMxcsrOut = fMxcsrM; … … 7820 7753 uint32_t fMxcsrU = fMxcsrIn; 7821 7754 uint32_t fEFlagsU = fEFlags; 7822 pfn(&fMxcsrU, &fEFlagsU, &ValIn1, &ValIn2);7755 fMxcsrU = pfn(fMxcsrIn, &fEFlagsU, &ValIn1, &ValIn2); 7823 7756 TestData.fMxcsrIn = fMxcsrIn; 7824 7757 TestData.fMxcsrOut = fMxcsrU; … … 7833 7766 uint32_t fMxcsr1 = fMxcsrIn; 7834 7767 uint32_t fEFlags1 = fEFlags; 7835 pfn(&fMxcsr1, &fEFlags1, &ValIn1, &ValIn2);7768 fMxcsr1 = pfn(fMxcsrIn, &fEFlags1, &ValIn1, &ValIn2); 7836 7769 TestData.fMxcsrIn = fMxcsrIn; 7837 7770 TestData.fMxcsrOut = fMxcsr1; … … 7846 7779 uint32_t fMxcsr2 = fMxcsrIn; 7847 7780 uint32_t fEFlags2 = fEFlags; 7848 pfn(&fMxcsr2, &fEFlags2, &ValIn1, &ValIn2);7781 fMxcsr2 = pfn(fMxcsrIn, &fEFlags2, &ValIn1, &ValIn2); 7849 7782 TestData.fMxcsrIn = fMxcsrIn; 7850 7783 TestData.fMxcsrOut = fMxcsr2; … … 7860 7793 uint32_t fMxcsr3 = fMxcsrIn; 7861 7794 uint32_t fEFlags3 = fEFlags; 7862 pfn(&fMxcsr3, &fEFlags3, &ValIn1, &ValIn2);7795 fMxcsr3 = pfn(fMxcsrIn, &fEFlags3, &ValIn1, &ValIn2); 7863 7796 TestData.fMxcsrIn = fMxcsrIn; 7864 7797 TestData.fMxcsrOut = fMxcsr3; … … 7898 7831 ValIn1.ar64[0] = paTests[iTest].r64ValIn1; 7899 7832 ValIn2.ar64[0] = paTests[iTest].r64ValIn2; 7900 uint32_t fMxcsr = paTests[iTest].fMxcsrIn;7901 7833 uint32_t fEFlags = paTests[iTest].fEflIn; 7902 pfn(&fMxcsr, &fEFlags, &ValIn1, &ValIn2);7834 uint32_t fMxcsr = pfn(paTests[iTest].fMxcsrIn, &fEFlags, &ValIn1, &ValIn2); 7903 7835 if ( fMxcsr != paTests[iTest].fMxcsrOut 7904 7836 || fEFlags != paTests[iTest].fEflOut) … … 8355 8287 AssertReturn(GENERATE_BINARY_OPEN(&BinOut, papszNameFmts, g_aSseConvertXmmI32R32[iFn]), RTEXITCODE_FAILURE); 8356 8288 8357 X86FXSTATE State;8358 RT_ZERO(State);8359 8289 for (uint32_t iTest = 0; iTest < cTests + RT_ELEMENTS(s_aSpecials); iTest += 1) 8360 8290 { … … 8371 8301 for (uint8_t iFz = 0; iFz < 2; iFz++) 8372 8302 { 8373 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 8374 | (iRounding << X86_MXCSR_RC_SHIFT) 8375 | (iDaz ? X86_MXCSR_DAZ : 0) 8376 | (iFz ? X86_MXCSR_FZ : 0) 8377 | X86_MXCSR_XCPT_MASK; 8378 IEMSSERESULT ResM; RT_ZERO(ResM); 8379 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 8380 TestData.fMxcsrIn = State.MXCSR; 8381 TestData.fMxcsrOut = ResM.MXCSR; 8382 TestData.OutVal = ResM.uResult; 8303 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 8304 | (iRounding << X86_MXCSR_RC_SHIFT) 8305 | (iDaz ? X86_MXCSR_DAZ : 0) 8306 | (iFz ? X86_MXCSR_FZ : 0) 8307 | X86_MXCSR_XCPT_MASK; 8308 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8309 TestData.fMxcsrIn = uMxCsrIn; 8310 TestData.fMxcsrOut = uMxCsrOutM; 8383 8311 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8384 8312 8385 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 8386 IEMSSERESULT ResU; RT_ZERO(ResU); 8387 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 8388 TestData.fMxcsrIn = State.MXCSR; 8389 TestData.fMxcsrOut = ResU.MXCSR; 8390 TestData.OutVal = ResU.uResult; 8313 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 8314 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8315 TestData.fMxcsrIn = uMxCsrIn; 8316 TestData.fMxcsrOut = uMxCsrOutU; 8391 8317 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8392 8318 8393 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;8319 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 8394 8320 if (fXcpt) 8395 8321 { 8396 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8397 IEMSSERESULT Res1; RT_ZERO(Res1); 8398 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 8399 TestData.fMxcsrIn = State.MXCSR; 8400 TestData.fMxcsrOut = Res1.MXCSR; 8401 TestData.OutVal = Res1.uResult; 8322 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8323 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8324 TestData.fMxcsrIn = uMxCsrIn; 8325 TestData.fMxcsrOut = uMxCsrOut1; 8402 8326 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8403 8327 8404 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))8328 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 8405 8329 { 8406 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 8407 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8408 IEMSSERESULT Res2; RT_ZERO(Res2); 8409 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 8410 TestData.fMxcsrIn = State.MXCSR; 8411 TestData.fMxcsrOut = Res2.MXCSR; 8412 TestData.OutVal = Res2.uResult; 8330 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 8331 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8332 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8333 TestData.fMxcsrIn = uMxCsrIn; 8334 TestData.fMxcsrOut = uMxCsrOut2; 8413 8335 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8414 8336 } … … 8417 8339 if (fUnmasked & fXcpt) 8418 8340 { 8419 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8420 IEMSSERESULT Res3; RT_ZERO(Res3); 8421 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 8422 TestData.fMxcsrIn = State.MXCSR; 8423 TestData.fMxcsrOut = Res3.MXCSR; 8424 TestData.OutVal = Res3.uResult; 8341 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8342 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8343 TestData.fMxcsrIn = uMxCsrIn; 8344 TestData.fMxcsrOut = uMxCsrOut3; 8425 8345 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8426 8346 } … … 8437 8357 static void SseConvertXmmI32R32Test(void) 8438 8358 { 8439 X86FXSTATE State;8440 RT_ZERO(State);8441 8442 8359 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmI32R32); iFn++) 8443 8360 { … … 8454 8371 for (uint32_t iTest = 0; iTest < cTests; iTest++) 8455 8372 { 8456 IEMSSERESULT Res; RT_ZERO(Res); 8457 8458 State.MXCSR = paTests[iTest].fMxcsrIn; 8459 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 8460 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 8461 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[0], &paTests[iTest].OutVal.ar32[0]) 8462 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[1], &paTests[iTest].OutVal.ar32[1]) 8463 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[2], &paTests[iTest].OutVal.ar32[2]) 8464 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[3], &paTests[iTest].OutVal.ar32[3])) 8373 X86XMMREG Res; RT_ZERO(Res); 8374 8375 uint32_t fMxCsr = pfn(paTests[iTest].fMxcsrIn, &Res, &Res, &paTests[iTest].InVal); 8376 if ( fMxCsr != paTests[iTest].fMxcsrOut 8377 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[0], &paTests[iTest].OutVal.ar32[0]) 8378 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[1], &paTests[iTest].OutVal.ar32[1]) 8379 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[2], &paTests[iTest].OutVal.ar32[2]) 8380 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[3], &paTests[iTest].OutVal.ar32[3])) 8465 8381 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%RI32'%RI32'%RI32'%RI32 \n" 8466 8382 "%s -> mxcsr=%#08x %s'%s'%s'%s\n" … … 8469 8385 paTests[iTest].InVal.ai32[0], paTests[iTest].InVal.ai32[1], 8470 8386 paTests[iTest].InVal.ai32[2], paTests[iTest].InVal.ai32[3], 8471 iVar ? " " : "", Res.MXCSR,8472 FormatR32(&Res. uResult.ar32[0]), FormatR32(&Res.uResult.ar32[1]),8473 FormatR32(&Res. uResult.ar32[2]), FormatR32(&Res.uResult.ar32[3]),8387 iVar ? " " : "", fMxCsr, 8388 FormatR32(&Res.ar32[0]), FormatR32(&Res.ar32[1]), 8389 FormatR32(&Res.ar32[2]), FormatR32(&Res.ar32[3]), 8474 8390 iVar ? " " : "", paTests[iTest].fMxcsrOut, 8475 8391 FormatR32(&paTests[iTest].OutVal.ar32[0]), FormatR32(&paTests[iTest].OutVal.ar32[1]), 8476 8392 FormatR32(&paTests[iTest].OutVal.ar32[2]), FormatR32(&paTests[iTest].OutVal.ar32[3]), 8477 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),8478 ( !RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[0], &paTests[iTest].OutVal.ar32[0])8479 || !RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[1], &paTests[iTest].OutVal.ar32[1])8480 || !RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[2], &paTests[iTest].OutVal.ar32[2])8481 || !RTFLOAT32U_ARE_IDENTICAL(&Res. uResult.ar32[3], &paTests[iTest].OutVal.ar32[3]))8393 MxcsrDiff(fMxCsr, paTests[iTest].fMxcsrOut), 8394 ( !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[0], &paTests[iTest].OutVal.ar32[0]) 8395 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[1], &paTests[iTest].OutVal.ar32[1]) 8396 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[2], &paTests[iTest].OutVal.ar32[2]) 8397 || !RTFLOAT32U_ARE_IDENTICAL(&Res.ar32[3], &paTests[iTest].OutVal.ar32[3])) 8482 8398 ? " - val" : "", 8483 8399 FormatMxcsr(paTests[iTest].fMxcsrIn)); … … 8514 8430 }; 8515 8431 8516 X86FXSTATE State;8517 RT_ZERO(State);8518 8432 uint32_t cMinNormalPairs = (cTests - 144) / 4; 8519 8433 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR32I32); iFn++) … … 8550 8464 for (uint8_t iFz = 0; iFz < 2; iFz++) 8551 8465 { 8552 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 8553 | (iRounding << X86_MXCSR_RC_SHIFT) 8554 | (iDaz ? X86_MXCSR_DAZ : 0) 8555 | (iFz ? X86_MXCSR_FZ : 0) 8556 | X86_MXCSR_XCPT_MASK; 8557 IEMSSERESULT ResM; RT_ZERO(ResM); 8558 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 8559 TestData.fMxcsrIn = State.MXCSR; 8560 TestData.fMxcsrOut = ResM.MXCSR; 8561 TestData.OutVal = ResM.uResult; 8466 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 8467 | (iRounding << X86_MXCSR_RC_SHIFT) 8468 | (iDaz ? X86_MXCSR_DAZ : 0) 8469 | (iFz ? X86_MXCSR_FZ : 0) 8470 | X86_MXCSR_XCPT_MASK; 8471 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8472 TestData.fMxcsrIn = uMxCsrIn; 8473 TestData.fMxcsrOut = uMxCsrOutM; 8562 8474 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8563 8475 8564 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 8565 IEMSSERESULT ResU; RT_ZERO(ResU); 8566 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 8567 TestData.fMxcsrIn = State.MXCSR; 8568 TestData.fMxcsrOut = ResU.MXCSR; 8569 TestData.OutVal = ResU.uResult; 8476 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 8477 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8478 TestData.fMxcsrIn = uMxCsrIn; 8479 TestData.fMxcsrOut = uMxCsrOutU; 8570 8480 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8571 8481 8572 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;8482 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 8573 8483 if (fXcpt) 8574 8484 { 8575 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8576 IEMSSERESULT Res1; RT_ZERO(Res1); 8577 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 8578 TestData.fMxcsrIn = State.MXCSR; 8579 TestData.fMxcsrOut = Res1.MXCSR; 8580 TestData.OutVal = Res1.uResult; 8485 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8486 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8487 TestData.fMxcsrIn = uMxCsrIn; 8488 TestData.fMxcsrOut = uMxCsrOut1; 8581 8489 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8582 8490 8583 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))8491 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 8584 8492 { 8585 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 8586 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8587 IEMSSERESULT Res2; RT_ZERO(Res2); 8588 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 8589 TestData.fMxcsrIn = State.MXCSR; 8590 TestData.fMxcsrOut = Res2.MXCSR; 8591 TestData.OutVal = Res2.uResult; 8493 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 8494 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8495 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8496 TestData.fMxcsrIn = uMxCsrIn; 8497 TestData.fMxcsrOut = uMxCsrOut2; 8592 8498 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8593 8499 } … … 8596 8502 if (fUnmasked & fXcpt) 8597 8503 { 8598 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8599 IEMSSERESULT Res3; RT_ZERO(Res3); 8600 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 8601 TestData.fMxcsrIn = State.MXCSR; 8602 TestData.fMxcsrOut = Res3.MXCSR; 8603 TestData.OutVal = Res3.uResult; 8504 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8505 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8506 TestData.fMxcsrIn = uMxCsrIn; 8507 TestData.fMxcsrOut = uMxCsrOut3; 8604 8508 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8605 8509 } … … 8616 8520 static void SseConvertXmmR32I32Test(void) 8617 8521 { 8618 X86FXSTATE State;8619 RT_ZERO(State);8620 8621 8522 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR32I32); iFn++) 8622 8523 { … … 8633 8534 for (uint32_t iTest = 0; iTest < cTests; iTest++) 8634 8535 { 8635 IEMSSERESULT Res; RT_ZERO(Res); 8636 8637 State.MXCSR = paTests[iTest].fMxcsrIn; 8638 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 8639 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 8640 || Res.uResult.ai32[0] != paTests[iTest].OutVal.ai32[0] 8641 || Res.uResult.ai32[1] != paTests[iTest].OutVal.ai32[1] 8642 || Res.uResult.ai32[2] != paTests[iTest].OutVal.ai32[2] 8643 || Res.uResult.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8536 X86XMMREG Res; RT_ZERO(Res); 8537 8538 uint32_t fMxCsr = pfn(paTests[iTest].fMxcsrIn, &Res, &Res, &paTests[iTest].InVal); 8539 if ( fMxCsr != paTests[iTest].fMxcsrOut 8540 || Res.ai32[0] != paTests[iTest].OutVal.ai32[0] 8541 || Res.ai32[1] != paTests[iTest].OutVal.ai32[1] 8542 || Res.ai32[2] != paTests[iTest].OutVal.ai32[2] 8543 || Res.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8644 8544 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s'%s'%s \n" 8645 8545 "%s -> mxcsr=%#08x %RI32'%RI32'%RI32'%RI32\n" … … 8648 8548 FormatR32(&paTests[iTest].InVal.ar32[0]), FormatR32(&paTests[iTest].InVal.ar32[1]), 8649 8549 FormatR32(&paTests[iTest].InVal.ar32[2]), FormatR32(&paTests[iTest].InVal.ar32[3]), 8650 iVar ? " " : "", Res.MXCSR,8651 Res. uResult.ai32[0], Res.uResult.ai32[1],8652 Res. uResult.ai32[2], Res.uResult.ai32[3],8550 iVar ? " " : "", fMxCsr, 8551 Res.ai32[0], Res.ai32[1], 8552 Res.ai32[2], Res.ai32[3], 8653 8553 iVar ? " " : "", paTests[iTest].fMxcsrOut, 8654 8554 paTests[iTest].OutVal.ai32[0], paTests[iTest].OutVal.ai32[1], 8655 8555 paTests[iTest].OutVal.ai32[2], paTests[iTest].OutVal.ai32[3], 8656 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),8657 ( Res. uResult.ai32[0] != paTests[iTest].OutVal.ai32[0]8658 || Res. uResult.ai32[1] != paTests[iTest].OutVal.ai32[1]8659 || Res. uResult.ai32[2] != paTests[iTest].OutVal.ai32[2]8660 || Res. uResult.ai32[3] != paTests[iTest].OutVal.ai32[3])8556 MxcsrDiff(fMxCsr, paTests[iTest].fMxcsrOut), 8557 ( Res.ai32[0] != paTests[iTest].OutVal.ai32[0] 8558 || Res.ai32[1] != paTests[iTest].OutVal.ai32[1] 8559 || Res.ai32[2] != paTests[iTest].OutVal.ai32[2] 8560 || Res.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8661 8561 ? " - val" : "", 8662 8562 FormatMxcsr(paTests[iTest].fMxcsrIn)); … … 8701 8601 AssertReturn(GENERATE_BINARY_OPEN(&BinOut, papszNameFmts, g_aSseConvertXmmI32R64[iFn]), RTEXITCODE_FAILURE); 8702 8602 8703 X86FXSTATE State;8704 RT_ZERO(State);8705 8603 for (uint32_t iTest = 0; iTest < cTests + RT_ELEMENTS(s_aSpecials); iTest += 1) 8706 8604 { … … 8717 8615 for (uint8_t iFz = 0; iFz < 2; iFz++) 8718 8616 { 8719 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 8720 | (iRounding << X86_MXCSR_RC_SHIFT) 8721 | (iDaz ? X86_MXCSR_DAZ : 0) 8722 | (iFz ? X86_MXCSR_FZ : 0) 8723 | X86_MXCSR_XCPT_MASK; 8724 IEMSSERESULT ResM; RT_ZERO(ResM); 8725 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 8726 TestData.fMxcsrIn = State.MXCSR; 8727 TestData.fMxcsrOut = ResM.MXCSR; 8728 TestData.OutVal = ResM.uResult; 8617 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 8618 | (iRounding << X86_MXCSR_RC_SHIFT) 8619 | (iDaz ? X86_MXCSR_DAZ : 0) 8620 | (iFz ? X86_MXCSR_FZ : 0) 8621 | X86_MXCSR_XCPT_MASK; 8622 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8623 TestData.fMxcsrIn = uMxCsrIn; 8624 TestData.fMxcsrOut = uMxCsrOutM; 8729 8625 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8730 8626 8731 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 8732 IEMSSERESULT ResU; RT_ZERO(ResU); 8733 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 8734 TestData.fMxcsrIn = State.MXCSR; 8735 TestData.fMxcsrOut = ResU.MXCSR; 8736 TestData.OutVal = ResU.uResult; 8627 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 8628 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8629 TestData.fMxcsrIn = uMxCsrIn; 8630 TestData.fMxcsrOut = uMxCsrOutU; 8737 8631 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8738 8632 8739 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;8633 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 8740 8634 if (fXcpt) 8741 8635 { 8742 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8743 IEMSSERESULT Res1; RT_ZERO(Res1); 8744 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 8745 TestData.fMxcsrIn = State.MXCSR; 8746 TestData.fMxcsrOut = Res1.MXCSR; 8747 TestData.OutVal = Res1.uResult; 8636 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8637 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8638 TestData.fMxcsrIn = uMxCsrIn; 8639 TestData.fMxcsrOut = uMxCsrOut1; 8748 8640 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8749 8641 8750 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))8642 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 8751 8643 { 8752 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 8753 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8754 IEMSSERESULT Res2; RT_ZERO(Res2); 8755 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 8756 TestData.fMxcsrIn = State.MXCSR; 8757 TestData.fMxcsrOut = Res2.MXCSR; 8758 TestData.OutVal = Res2.uResult; 8644 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 8645 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8646 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8647 TestData.fMxcsrIn = uMxCsrIn; 8648 TestData.fMxcsrOut = uMxCsrOut2; 8759 8649 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8760 8650 } … … 8763 8653 if (fUnmasked & fXcpt) 8764 8654 { 8765 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8766 IEMSSERESULT Res3; RT_ZERO(Res3); 8767 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 8768 TestData.fMxcsrIn = State.MXCSR; 8769 TestData.fMxcsrOut = Res3.MXCSR; 8770 TestData.OutVal = Res3.uResult; 8655 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8656 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8657 TestData.fMxcsrIn = uMxCsrIn; 8658 TestData.fMxcsrOut = uMxCsrOut3; 8771 8659 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8772 8660 } … … 8783 8671 static void SseConvertXmmI32R64Test(void) 8784 8672 { 8785 X86FXSTATE State;8786 RT_ZERO(State);8787 8788 8673 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmI32R64); iFn++) 8789 8674 { … … 8800 8685 for (uint32_t iTest = 0; iTest < cTests; iTest++) 8801 8686 { 8802 IEMSSERESULT Res; RT_ZERO(Res); 8803 8804 State.MXCSR = paTests[iTest].fMxcsrIn; 8805 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 8806 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 8807 || !RTFLOAT64U_ARE_IDENTICAL(&Res.uResult.ar64[0], &paTests[iTest].OutVal.ar64[0]) 8808 || !RTFLOAT64U_ARE_IDENTICAL(&Res.uResult.ar64[1], &paTests[iTest].OutVal.ar64[1])) 8687 X86XMMREG Res; RT_ZERO(Res); 8688 8689 uint32_t fMxCsr = pfn(paTests[iTest].fMxcsrIn, &Res, &Res, &paTests[iTest].InVal); 8690 if ( fMxCsr != paTests[iTest].fMxcsrOut 8691 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[0], &paTests[iTest].OutVal.ar64[0]) 8692 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[1], &paTests[iTest].OutVal.ar64[1])) 8809 8693 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%RI32'%RI32'%RI32'%RI32 \n" 8810 8694 "%s -> mxcsr=%#08x %s'%s\n" … … 8813 8697 paTests[iTest].InVal.ai32[0], paTests[iTest].InVal.ai32[1], 8814 8698 paTests[iTest].InVal.ai32[2], paTests[iTest].InVal.ai32[3], 8815 iVar ? " " : "", Res.MXCSR,8816 FormatR64(&Res. uResult.ar64[0]), FormatR64(&Res.uResult.ar64[1]),8699 iVar ? " " : "", fMxCsr, 8700 FormatR64(&Res.ar64[0]), FormatR64(&Res.ar64[1]), 8817 8701 iVar ? " " : "", paTests[iTest].fMxcsrOut, 8818 8702 FormatR64(&paTests[iTest].OutVal.ar64[0]), FormatR64(&paTests[iTest].OutVal.ar64[1]), 8819 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),8820 ( !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[0], &paTests[iTest].OutVal.ar64[0])8821 || !RTFLOAT64U_ARE_IDENTICAL(&Res. uResult.ar64[1], &paTests[iTest].OutVal.ar64[1]))8703 MxcsrDiff(fMxCsr, paTests[iTest].fMxcsrOut), 8704 ( !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[0], &paTests[iTest].OutVal.ar64[0]) 8705 || !RTFLOAT64U_ARE_IDENTICAL(&Res.ar64[1], &paTests[iTest].OutVal.ar64[1])) 8822 8706 ? " - val" : "", 8823 8707 FormatMxcsr(paTests[iTest].fMxcsrIn)); … … 8854 8738 }; 8855 8739 8856 X86FXSTATE State;8857 RT_ZERO(State);8858 8740 uint32_t cMinNormalPairs = (cTests - 144) / 4; 8859 8741 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR64I32); iFn++) … … 8886 8768 for (uint8_t iFz = 0; iFz < 2; iFz++) 8887 8769 { 8888 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 8889 | (iRounding << X86_MXCSR_RC_SHIFT) 8890 | (iDaz ? X86_MXCSR_DAZ : 0) 8891 | (iFz ? X86_MXCSR_FZ : 0) 8892 | X86_MXCSR_XCPT_MASK; 8893 IEMSSERESULT ResM; RT_ZERO(ResM); 8894 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 8895 TestData.fMxcsrIn = State.MXCSR; 8896 TestData.fMxcsrOut = ResM.MXCSR; 8897 TestData.OutVal = ResM.uResult; 8770 uint32_t uMxCsrIn = (fMxcsr & ~X86_MXCSR_RC_MASK) 8771 | (iRounding << X86_MXCSR_RC_SHIFT) 8772 | (iDaz ? X86_MXCSR_DAZ : 0) 8773 | (iFz ? X86_MXCSR_FZ : 0) 8774 | X86_MXCSR_XCPT_MASK; 8775 uint32_t uMxCsrOutM = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8776 TestData.fMxcsrIn = uMxCsrIn; 8777 TestData.fMxcsrOut = uMxCsrOutM; 8898 8778 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8899 8779 8900 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 8901 IEMSSERESULT ResU; RT_ZERO(ResU); 8902 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 8903 TestData.fMxcsrIn = State.MXCSR; 8904 TestData.fMxcsrOut = ResU.MXCSR; 8905 TestData.OutVal = ResU.uResult; 8780 uMxCsrIn = uMxCsrIn & ~X86_MXCSR_XCPT_MASK; 8781 uint32_t uMxCsrOutU = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8782 TestData.fMxcsrIn = uMxCsrIn; 8783 TestData.fMxcsrOut = uMxCsrOutU; 8906 8784 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8907 8785 8908 uint16_t fXcpt = ( ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS;8786 uint16_t fXcpt = (uMxCsrOutM | uMxCsrOutU) & X86_MXCSR_XCPT_FLAGS; 8909 8787 if (fXcpt) 8910 8788 { 8911 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8912 IEMSSERESULT Res1; RT_ZERO(Res1); 8913 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 8914 TestData.fMxcsrIn = State.MXCSR; 8915 TestData.fMxcsrOut = Res1.MXCSR; 8916 TestData.OutVal = Res1.uResult; 8789 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | fXcpt; 8790 uint32_t uMxCsrOut1 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8791 TestData.fMxcsrIn = uMxCsrIn; 8792 TestData.fMxcsrOut = uMxCsrOut1; 8917 8793 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8918 8794 8919 if ((( Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR& X86_MXCSR_XCPT_FLAGS))8795 if (((uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS)) 8920 8796 { 8921 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 8922 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8923 IEMSSERESULT Res2; RT_ZERO(Res2); 8924 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 8925 TestData.fMxcsrIn = State.MXCSR; 8926 TestData.fMxcsrOut = Res2.MXCSR; 8927 TestData.OutVal = Res2.uResult; 8797 fXcpt |= uMxCsrOut1 & X86_MXCSR_XCPT_FLAGS; 8798 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 8799 uint32_t uMxCsrOut2 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8800 TestData.fMxcsrIn = uMxCsrIn; 8801 TestData.fMxcsrOut = uMxCsrOut2; 8928 8802 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8929 8803 } … … 8932 8806 if (fUnmasked & fXcpt) 8933 8807 { 8934 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8935 IEMSSERESULT Res3; RT_ZERO(Res3); 8936 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 8937 TestData.fMxcsrIn = State.MXCSR; 8938 TestData.fMxcsrOut = Res3.MXCSR; 8939 TestData.OutVal = Res3.uResult; 8808 uMxCsrIn = (uMxCsrIn & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8809 uint32_t uMxCsrOut3 = pfn(uMxCsrIn, &TestData.OutVal, &TestData.OutVal, &TestData.InVal); 8810 TestData.fMxcsrIn = uMxCsrIn; 8811 TestData.fMxcsrOut = uMxCsrOut3; 8940 8812 GenerateBinaryWrite(&BinOut, &TestData, sizeof(TestData)); 8941 8813 } … … 8952 8824 static void SseConvertXmmR64I32Test(void) 8953 8825 { 8954 X86FXSTATE State;8955 RT_ZERO(State);8956 8957 8826 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR64I32); iFn++) 8958 8827 { … … 8969 8838 for (uint32_t iTest = 0; iTest < cTests; iTest++) 8970 8839 { 8971 IEMSSERESULT Res; RT_ZERO(Res); 8972 8973 State.MXCSR = paTests[iTest].fMxcsrIn; 8974 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 8975 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 8976 || Res.uResult.ai32[0] != paTests[iTest].OutVal.ai32[0] 8977 || Res.uResult.ai32[1] != paTests[iTest].OutVal.ai32[1] 8978 || Res.uResult.ai32[2] != paTests[iTest].OutVal.ai32[2] 8979 || Res.uResult.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8840 X86XMMREG Res; RT_ZERO(Res); 8841 8842 uint32_t fMxCsr = pfn(paTests[iTest].fMxcsrIn, &Res, &Res, &paTests[iTest].InVal); 8843 if ( fMxCsr != paTests[iTest].fMxcsrOut 8844 || Res.ai32[0] != paTests[iTest].OutVal.ai32[0] 8845 || Res.ai32[1] != paTests[iTest].OutVal.ai32[1] 8846 || Res.ai32[2] != paTests[iTest].OutVal.ai32[2] 8847 || Res.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8980 8848 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s \n" 8981 8849 "%s -> mxcsr=%#08x %RI32'%RI32'%RI32'%RI32\n" … … 8983 8851 iTest, iVar ? "/n" : "", paTests[iTest].fMxcsrIn, 8984 8852 FormatR64(&paTests[iTest].InVal.ar64[0]), FormatR64(&paTests[iTest].InVal.ar64[1]), 8985 iVar ? " " : "", Res.MXCSR,8986 Res. uResult.ai32[0], Res.uResult.ai32[1],8987 Res. uResult.ai32[2], Res.uResult.ai32[3],8853 iVar ? " " : "", fMxCsr, 8854 Res.ai32[0], Res.ai32[1], 8855 Res.ai32[2], Res.ai32[3], 8988 8856 iVar ? " " : "", paTests[iTest].fMxcsrOut, 8989 8857 paTests[iTest].OutVal.ai32[0], paTests[iTest].OutVal.ai32[1], 8990 8858 paTests[iTest].OutVal.ai32[2], paTests[iTest].OutVal.ai32[3], 8991 MxcsrDiff( Res.MXCSR, paTests[iTest].fMxcsrOut),8992 ( Res. uResult.ai32[0] != paTests[iTest].OutVal.ai32[0]8993 || Res. uResult.ai32[1] != paTests[iTest].OutVal.ai32[1]8994 || Res. uResult.ai32[2] != paTests[iTest].OutVal.ai32[2]8995 || Res. uResult.ai32[3] != paTests[iTest].OutVal.ai32[3])8859 MxcsrDiff(fMxCsr, paTests[iTest].fMxcsrOut), 8860 ( Res.ai32[0] != paTests[iTest].OutVal.ai32[0] 8861 || Res.ai32[1] != paTests[iTest].OutVal.ai32[1] 8862 || Res.ai32[2] != paTests[iTest].OutVal.ai32[2] 8863 || Res.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8996 8864 ? " - val" : "", 8997 8865 FormatMxcsr(paTests[iTest].fMxcsrIn)); … … 9131 8999 static void SseConvertMmXmmTest(void) 9132 9000 { 9133 X86FXSTATE State;9134 RT_ZERO(State);9135 9136 9001 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertMmXmm); iFn++) 9137 9002 {
Note:
See TracChangeset
for help on using the changeset viewer.