Changeset 106231 in vbox
- Timestamp:
- Oct 8, 2024 9:58:52 AM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4.c32
r106230 r106231 2666 2666 2667 2667 /** 2668 * Worker for bs3CpuInstr4_WorkerTestType1. 2669 */ 2670 static uint16_t bs3CpuInstr4_WorkerTestType1_Inner(uint8_t bMode, PBS3CPUINSTR4_TEST1_CTX_T pTestCtx, 2671 PCBS3CPUINSTRX_CONFIG_SAVED_T pSavedCfg) 2672 { 2673 BS3CPUINSTR4_TEST1_T const BS3_FAR *pTest = pTestCtx->pTest; 2674 BS3CPUINSTR4_TEST1_VALUES_T const BS3_FAR *pValues = &pTestCtx->pTest->paValues[pTestCtx->iVal]; 2675 PBS3TRAPFRAME pTrapFrame = pTestCtx->pTrapFrame; 2676 PBS3REGCTX pCtx = pTestCtx->pCtx; 2677 PBS3EXTCTX pExtCtx = pTestCtx->pExtCtx; 2678 PBS3EXTCTX pExtCtxOut = pTestCtx->pExtCtxOut; 2679 uint8_t BS3_FAR *puMemOp = pTestCtx->puMemOp; 2680 uint8_t BS3_FAR *puMemOpAlias = pTestCtx->puMemOpAlias; 2681 uint8_t cbMemOp = pTestCtx->cbMemOp; 2682 uint8_t const cbOperand = pTestCtx->cbOperand; 2683 uint8_t const cbInstr = ((uint8_t const BS3_FAR *)(uintptr_t)pTestCtx->pTest->pfnWorker)[-1]; 2684 uint8_t bXcptExpect = pTestCtx->bXcptExpect; 2685 uint8_t const bFpXcpt = pTestCtx->pConfig->fCr4OsXmmExcpt ? X86_XCPT_XF : X86_XCPT_UD; 2686 bool const fSseInstr = bs3CpuInstr4IsSse(pTest->enmType); 2687 uint32_t uMxCsr; 2688 X86YMMREG MemOpExpect; 2689 uint16_t cErrors; 2690 uint32_t uExpectedMxCsr; 2691 bool fFpXcptExpected; 2692 2693 /* 2694 * An exception may be raised based on the test value (128 vs 256 bits). 2695 * In addition, we allow setting the exception flags (and mask) prior to 2696 * executing the instruction, so we cannot use the exception flags to figure 2697 * out if an exception will be raised. Hence, the input values provide us 2698 * explicitly whether an exception is expected for 128 and 256-bit variants. 2699 */ 2700 if (pTestCtx->cbOperand > 16) 2701 { 2702 uExpectedMxCsr = pValues->u256ExpectedMxCsr; 2703 fFpXcptExpected = pValues->f256FpXcptExpected; 2704 } 2705 else 2706 { 2707 uExpectedMxCsr = pValues->u128ExpectedMxCsr; 2708 fFpXcptExpected = pValues->f128FpXcptExpected; 2709 } 2710 2711 /* 2712 * Set up the context and some expectations. 2713 */ 2714 /* Destination. */ 2715 Bs3MemZero(&MemOpExpect, sizeof(MemOpExpect)); 2716 if (pTest->iRegDst == UINT8_MAX) 2717 { 2718 BS3_ASSERT(pTest->enmRm >= RM_MEM); 2719 Bs3MemSet(puMemOpAlias, 0xcc, cbMemOp); 2720 if (bXcptExpect == X86_XCPT_DB) 2721 MemOpExpect.ymm = pValues->uDstOut.ymm; 2722 else 2723 Bs3MemSet(&MemOpExpect, 0xcc, sizeof(MemOpExpect)); 2724 } 2725 2726 /* Source #1 (/ destination for SSE). */ 2727 if (pTest->iRegSrc1 == UINT8_MAX) 2728 { 2729 BS3_ASSERT(pTest->enmRm >= RM_MEM); 2730 Bs3MemCpy(puMemOpAlias, &pValues->uSrc1, cbMemOp); 2731 if (pTest->iRegDst == UINT8_MAX) 2732 BS3_ASSERT(fSseInstr); 2733 else 2734 MemOpExpect.ymm = pValues->uSrc1.ymm; 2735 } 2736 else if (fSseInstr) 2737 Bs3ExtCtxSetXmm(pExtCtx, pTest->iRegSrc1, &pValues->uSrc1.ymm.DQWords.dqw0); 2738 else 2739 Bs3ExtCtxSetYmm(pExtCtx, pTest->iRegSrc1, &pValues->uSrc1.ymm, 32); 2740 2741 /* Source #2. */ 2742 if (pTest->iRegSrc2 == UINT8_MAX) 2743 { 2744 BS3_ASSERT(pTest->enmRm >= RM_MEM); 2745 BS3_ASSERT(pTest->iRegDst != UINT8_MAX && pTest->iRegSrc1 != UINT8_MAX); 2746 Bs3MemCpy(puMemOpAlias, &pValues->uSrc2, cbMemOp); 2747 MemOpExpect.ymm = pValues->uSrc2.ymm; 2748 } 2749 else if (fSseInstr) 2750 Bs3ExtCtxSetXmm(pExtCtx, pTest->iRegSrc2, &pValues->uSrc2.ymm.DQWords.dqw0); 2751 else 2752 Bs3ExtCtxSetYmm(pExtCtx, pTest->iRegSrc2, &pValues->uSrc2.ymm, 32); 2753 2754 /* Memory pointer. */ 2755 if (pTest->enmRm >= RM_MEM) 2756 { 2757 BS3_ASSERT( pTest->iRegDst == UINT8_MAX 2758 || pTest->iRegSrc1 == UINT8_MAX 2759 || pTest->iRegSrc2 == UINT8_MAX); 2760 Bs3RegCtxSetGrpSegFromCurPtr(pCtx, &pCtx->rbx, &pCtx->fs, puMemOp); 2761 } 2762 2763 /* Setup MXCSR for the current test. */ 2764 uMxCsr = (pSavedCfg->uMxCsr & X86_MXCSR_MM) | pValues->uMxCsr; 2765 BS3_ASSERT(!(uMxCsr & X86_MXCSR_MM)); 2766 BS3_ASSERT(!(uMxCsr & X86_MXCSR_DAZ) || g_fMxCsrDazSupported); 2767 Bs3ExtCtxSetMxCsr(pExtCtx, uMxCsr); 2768 2769 /* 2770 * Prepare globals and execute. 2771 */ 2772 g_uBs3TrapEipHint = pCtx->rip.u32; 2773 if ( bXcptExpect == X86_XCPT_DB 2774 && !fFpXcptExpected) 2775 g_uBs3TrapEipHint += cbInstr + 1; 2776 Bs3TrapSetJmpAndRestoreWithExtCtxAndRm(pCtx, pExtCtx, pTrapFrame, pExtCtxOut); 2777 2778 /* 2779 * Check the result. 2780 * 2781 * If a floating-point exception is expected, the destination is not updated by the instruction. 2782 * In the case of SSE instructions, updating the destination here will work because it is the same 2783 * as the source, but for AVX++ it won't because the destination is different and would contain 0s. 2784 */ 2785 cErrors = Bs3TestSubErrorCount(); 2786 if ( bXcptExpect == X86_XCPT_DB 2787 && !fFpXcptExpected 2788 && pTest->iRegDst != UINT8_MAX) 2789 { 2790 if (fSseInstr) 2791 Bs3ExtCtxSetXmm(pExtCtx, pTest->iRegDst, &pValues->uDstOut.ymm.DQWords.dqw0); 2792 else 2793 Bs3ExtCtxSetYmm(pExtCtx, pTest->iRegDst, &pValues->uDstOut.ymm, cbOperand); 2794 } 2795 #if defined(DEBUG_aeichner) /** @todo Necessary kludge on a i7-1068NG7. */ 2796 if ( pExtCtx->enmMethod == BS3EXTCTXMETHOD_XSAVE 2797 && pExtCtx->Ctx.x.Hdr.bmXState == 0x7 2798 && pExtCtxOut->Ctx.x.Hdr.bmXState == 0x3) 2799 pExtCtxOut->Ctx.x.Hdr.bmXState = 0x7; 2800 #endif 2801 if (bXcptExpect == X86_XCPT_DB) 2802 Bs3ExtCtxSetMxCsr(pExtCtx, uExpectedMxCsr | (pSavedCfg->uMxCsr & X86_MXCSR_MM)); 2803 Bs3TestCheckExtCtx(pExtCtxOut, pExtCtx, 0 /*fFlags*/, pTestCtx->pszMode, pTestCtx->idTestStep); 2804 2805 if (bXcptExpect == X86_XCPT_DB) 2806 { 2807 uint32_t const uGotMxCsr = Bs3ExtCtxGetMxCsr(pExtCtxOut) & ~X86_MXCSR_MM; 2808 2809 /* Check if the SIMD FP exception flags and mask (or lack of) are as expected. */ 2810 if (uGotMxCsr != uExpectedMxCsr) 2811 { 2812 char szExpectFlags[FP_XCPT_FLAGS_NAMES_MAXLEN]; 2813 char szExpectMasks[FP_XCPT_MASKS_NAMES_MAXLEN]; 2814 char szExpectOthers[FP_XCPT_OTHERS_NAMES_MAXLEN]; 2815 char szGotFlags[FP_XCPT_FLAGS_NAMES_MAXLEN]; 2816 char szGotMasks[FP_XCPT_MASKS_NAMES_MAXLEN]; 2817 char szGotOthers[FP_XCPT_OTHERS_NAMES_MAXLEN]; 2818 bs3CpuInstr4GetXcptFlags(&szExpectFlags[0], sizeof(szExpectFlags), uExpectedMxCsr); 2819 bs3CpuInstr4GetXcptMasks(&szExpectMasks[0], sizeof(szExpectMasks), uExpectedMxCsr); 2820 bs3CpuInstr4GetXcptOthers(&szExpectOthers[0], sizeof(szExpectOthers), uExpectedMxCsr); 2821 bs3CpuInstr4GetXcptFlags(&szGotFlags[0], sizeof(szGotFlags), uGotMxCsr); 2822 bs3CpuInstr4GetXcptMasks(&szGotMasks[0], sizeof(szGotMasks), uGotMxCsr); 2823 bs3CpuInstr4GetXcptOthers(&szGotOthers[0], sizeof(szGotOthers), uGotMxCsr); 2824 Bs3TestFailedF("Expected MXCSR %#RX32 (%s%s%s ) got MXCSR %#RX32 (%s%s%s )", uExpectedMxCsr, 2825 szExpectFlags, szExpectMasks, szExpectOthers, uGotMxCsr, szGotFlags, szGotMasks, szGotOthers); 2826 } 2827 2828 /* Check if the SIMD FP exception (or lack of) is as expected. */ 2829 if (fFpXcptExpected) 2830 { 2831 if (pTrapFrame->bXcpt == bFpXcpt) 2832 { /* likely */ } 2833 else 2834 Bs3TestFailedF("Expected floating-point xcpt %s, got %s", bs3CpuInstr4XcptName(bFpXcpt), 2835 bs3CpuInstr4XcptName(pTrapFrame->bXcpt)); 2836 } 2837 else if (pTrapFrame->bXcpt == X86_XCPT_DB) 2838 { /* likely */ } 2839 else 2840 Bs3TestFailedF("Expected no xcpt, got %s", bs3CpuInstr4XcptName(pTrapFrame->bXcpt)); 2841 } 2842 /* Check if non-FP exception is as expected. */ 2843 else if (pTrapFrame->bXcpt != bXcptExpect) 2844 Bs3TestFailedF("Expected xcpt %s, got %s", bs3CpuInstr4XcptName(bXcptExpect), bs3CpuInstr4XcptName(pTrapFrame->bXcpt)); 2845 2846 /* Kludge! Looks like EFLAGS.AC is cleared when raising #GP in real mode on the 10980XE. WEIRD! */ 2847 if (bMode == BS3_MODE_RM && (pCtx->rflags.u32 & X86_EFL_AC)) 2848 { 2849 if (pTrapFrame->Ctx.rflags.u32 & X86_EFL_AC) 2850 Bs3TestFailedF("Expected EFLAGS.AC to be cleared (bXcpt=%d)", pTrapFrame->bXcpt); 2851 pTrapFrame->Ctx.rflags.u32 |= X86_EFL_AC; 2852 } 2853 if (bXcptExpect == X86_XCPT_PF) 2854 pCtx->cr2.u = (uintptr_t)puMemOp; 2855 Bs3TestCheckRegCtxEx(&pTrapFrame->Ctx, pCtx, bXcptExpect == X86_XCPT_DB && !fFpXcptExpected ? cbInstr + 1 : 0, 0 /*cbSpAdjust*/, 2856 (bXcptExpect == X86_XCPT_DB && !fFpXcptExpected) || BS3_MODE_IS_16BIT_SYS(bMode) ? 0 : X86_EFL_RF, 2857 pTestCtx->pszMode, pTestCtx->idTestStep); 2858 pCtx->cr2.u = 0; 2859 2860 if ( pTest->enmRm >= RM_MEM 2861 && Bs3MemCmp(puMemOpAlias, &MemOpExpect, cbMemOp) != 0) 2862 Bs3TestFailedF("Expected uMemOp %.*Rhxs, got %.*Rhxs", cbMemOp, &MemOpExpect, cbMemOp, puMemOpAlias); 2863 2864 return cErrors; 2865 } 2866 2867 2868 /** 2869 * Test type #1 worker. 2870 */ 2871 static uint8_t bs3CpuInstr4_WorkerTestType1(uint8_t bMode, BS3CPUINSTR4_TEST1_T const BS3_FAR *paTests, unsigned cTests, 2872 PCBS3CPUINSTR4_CONFIG_T paConfigs, unsigned cConfigs) 2873 { 2874 BS3REGCTX Ctx; 2875 BS3TRAPFRAME TrapFrame; 2876 const char BS3_FAR * const pszMode = Bs3GetModeName(bMode); 2877 uint8_t bRing = BS3_MODE_IS_V86(bMode) ? 3 : 0; 2878 uint8_t BS3_FAR *pbBuf = g_pbBuf; 2879 uint32_t cbBuf = g_cbBuf; 2880 PBS3EXTCTX pExtCtxOut; 2881 PBS3EXTCTX pExtCtx = bs3CpuInstrXAllocExtCtxs(&pExtCtxOut); 2882 if (pExtCtx) 2883 { /* likely */ } 2884 else 2885 return 0; 2886 if (pExtCtx->enmMethod != BS3EXTCTXMETHOD_ANCIENT) 2887 { /* likely */ } 2888 else 2889 { 2890 Bs3TestPrintf("Skipped due to ancient FPU state format\n"); 2891 return 0; 2892 } 2893 2894 /* Ensure the structures are allocated before we sample the stack pointer. */ 2895 Bs3MemSet(&Ctx, 0, sizeof(Ctx)); 2896 Bs3MemSet(&TrapFrame, 0, sizeof(TrapFrame)); 2897 2898 /* 2899 * Create test context. 2900 */ 2901 pbBuf = bs3CpuInstrXBufSetup(pbBuf, &cbBuf, bMode); 2902 Bs3RegCtxSaveForMode(&Ctx, bMode, 1024); 2903 bs3CpuInstr4SetupSseAndAvx(&Ctx, pExtCtx); 2904 2905 /* 2906 * Run the tests in all rings since alignment issues may behave 2907 * differently in ring-3 compared to ring-0. 2908 */ 2909 for (;;) 2910 { 2911 unsigned fPf = 0; 2912 do 2913 { 2914 unsigned iCfg; 2915 for (iCfg = 0; iCfg < cConfigs; iCfg++) 2916 { 2917 unsigned iTest; 2918 BS3CPUINSTRX_CONFIG_SAVED_T SavedCfg; 2919 if (!bs3CpuInstr4ConfigReconfigure(&SavedCfg, &Ctx, pExtCtx, &paConfigs[iCfg], bMode)) 2920 continue; /* unsupported config */ 2921 2922 /* 2923 * Iterate the tests. 2924 */ 2925 for (iTest = 0; iTest < cTests; iTest++) 2926 { 2927 BS3CPUINSTR4_TEST1_T const BS3_FAR *pTest = &paTests[iTest]; 2928 unsigned const cValues = pTest->cValues; 2929 bool const fSseInstr = bs3CpuInstr4IsSse(pTest->enmType); 2930 bool const fAvxInstr = bs3CpuInstr4IsAvx(pTest->enmType); 2931 uint8_t const cbOperand = bs3CpuInstr4GetOperandSize(pTest->enmType); 2932 uint8_t const cbMemOp = bs3CpuInstrXMemOpSize(cbOperand, pTest->enmRm); 2933 uint8_t const cbAlign = cbMemOp; 2934 uint8_t BS3_FAR *puMemOp = bs3CpuInstrXBufForOperand(pbBuf, cbBuf, cbMemOp, cbAlign, &paConfigs[iCfg], fPf); 2935 uint8_t *puMemOpAlias = &g_pbBufAlias[(uintptr_t)puMemOp - (uintptr_t)pbBuf]; 2936 uint8_t bXcptExpect = !g_afTypeSupports[pTest->enmType] ? X86_XCPT_UD 2937 : fSseInstr ? paConfigs[iCfg].bXcptSse 2938 : BS3_MODE_IS_RM_OR_V86(bMode) ? X86_XCPT_UD : paConfigs[iCfg].bXcptAvx; 2939 uint16_t idTestStep = bRing * 10000 + iCfg * 100 + iTest * 10; 2940 unsigned cRecompRuns = 0; 2941 unsigned const cMaxRecompRuns = g_cBs3ThresholdNativeRecompiler + cValues; 2942 unsigned iVal; 2943 2944 /* If testing unaligned memory accesses (or #PF), skip register-only tests. This 2945 allows setting bXcptSse and bXcptAvx to reflect the misaligned exceptions. */ 2946 if ( (pTest->enmRm == RM_REG || pTest->enmRm == RM_MEM8) 2947 && (!paConfigs[iCfg].fAligned || paConfigs[iCfg].fAlignCheck || fPf)) 2948 continue; 2949 2950 /* #AC is only raised in ring-3. */ 2951 if (bXcptExpect == X86_XCPT_AC) 2952 { 2953 if (bRing != 3) 2954 bXcptExpect = X86_XCPT_DB; 2955 else if (fAvxInstr) 2956 bXcptExpect = pTest->bAvxMisalignXcpt; /* they generally don't raise #AC */ 2957 } 2958 2959 if (fPf && bXcptExpect == X86_XCPT_DB) 2960 bXcptExpect = X86_XCPT_PF; 2961 2962 Bs3RegCtxSetRipCsFromCurPtr(&Ctx, pTest->pfnWorker); 2963 2964 /* 2965 * Iterate the test values and do the actual testing. 2966 */ 2967 while (cRecompRuns < cMaxRecompRuns) 2968 { 2969 for (iVal = 0; iVal < cValues; iVal++, idTestStep++, cRecompRuns++) 2970 { 2971 uint16_t cErrors; 2972 BS3CPUINSTR4_TEST1_CTX_T TestCtx; 2973 2974 if (BS3_SKIPIT(bRing, iCfg, iTest, iVal, 0)) 2975 continue; 2976 2977 /* 2978 * If the hardware does not support DAZ bit skip test values that set it. 2979 */ 2980 if ( !g_fMxCsrDazSupported 2981 && (pTest->paValues[iVal].uMxCsr & X86_MXCSR_DAZ)) 2982 continue; 2983 2984 /* 2985 * Setup the test instruction context and pass it to the worker. 2986 * A few of these can be figured out by the worker but initializing 2987 * it outside the inner most loop is more optimal. 2988 */ 2989 TestCtx.pConfig = &paConfigs[iCfg]; 2990 TestCtx.pTest = pTest; 2991 TestCtx.iVal = iVal; 2992 TestCtx.pszMode = pszMode; 2993 TestCtx.pTrapFrame = &TrapFrame; 2994 TestCtx.pCtx = &Ctx; 2995 TestCtx.pExtCtx = pExtCtx; 2996 TestCtx.pExtCtxOut = pExtCtxOut; 2997 TestCtx.puMemOp = (uint8_t *)puMemOp; 2998 TestCtx.puMemOpAlias = puMemOpAlias; 2999 TestCtx.cbMemOp = cbMemOp; 3000 TestCtx.cbOperand = cbOperand; 3001 TestCtx.bXcptExpect = bXcptExpect; 3002 TestCtx.idTestStep = idTestStep; 3003 cErrors = bs3CpuInstr4_WorkerTestType1_Inner(bMode, &TestCtx, &SavedCfg); 3004 if (cErrors != Bs3TestSubErrorCount()) 3005 { 3006 if (paConfigs[iCfg].fAligned) 3007 Bs3TestFailedF("%s: ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%u %s, %s %u-bit)", 3008 Bs3GetModeName(bMode), bRing, iCfg, iTest, iVal, 3009 bXcptExpect, bs3CpuInstr4XcptName(bXcptExpect), fSseInstr ? "SSE" : "AVX", cbOperand * 8); 3010 else 3011 Bs3TestFailedF("%s: ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%u %s, puMemOp=%p, EFLAGS=%#RX32, %s %u-bit)", 3012 Bs3GetModeName(bMode), bRing, iCfg, iTest, iVal, 3013 bXcptExpect, bs3CpuInstr4XcptName(bXcptExpect), puMemOp, 3014 TrapFrame.Ctx.rflags.u32, fSseInstr ? "SSE" : "AVX", cbOperand * 8); 3015 Bs3TestPrintf("\n"); 3016 } 3017 } 3018 } 3019 } 3020 bs3CpuInstrXConfigRestore(&SavedCfg, &Ctx, pExtCtx); 3021 } 3022 } while (fPf++ == 0 && BS3_MODE_IS_PAGED(bMode)); 3023 3024 /* 3025 * Next ring. 3026 */ 3027 bRing++; 3028 if (bRing > 3 || bMode == BS3_MODE_RM) 3029 break; 3030 Bs3RegCtxConvertToRingX(&Ctx, bRing); 3031 } 3032 3033 /* 3034 * Cleanup. 3035 */ 3036 bs3CpuInstrXBufCleanup(pbBuf, cbBuf, bMode); 3037 bs3CpuInstrXFreeExtCtxs(pExtCtx, pExtCtxOut); 3038 return 0; 3039 } 3040 3041 3042 /** 3043 * Constants used in the 'Worker 1A' test value definitions. These are 3044 * extra bits which can be set in the ':out' fields of a test value. 3045 * They are described below in the corresponding code. 2668 * Constants used in test value definitions. These are extra bits which 2669 * can be set in the ':out' fields of a test value; stored in 'stolen' 2670 * bits from the real x86 MXCSR CPU register definition. 2671 * 2672 * 'BS3_MXCSR_?M_FIXED' bits prevent the mask randomizer from changing 2673 * the corresponding bit of the mask. These can be used to 'split' an 2674 * entry which produces different results under different masks, 2675 * allowing both sets of results to be properly tested. 2676 * 2677 * 'BS3_MXCSR_PE_FUZZY' marks test value entries which are considered 2678 * to have passed the test regardless of the value of X86_MXCSR_PE in 2679 * the result. Many, most, or possibly all instances of this represent 2680 * bugs in the test value definitions and/or the CPU emulator IEM; all 2681 * need further investigation. 3046 2682 */ 3047 2683 #define BS3_MXCSR_FIXED_SHIFT 11 … … 3063 2699 3064 2700 /** 3065 * Worker for bs3CpuInstr4_WorkerTestType1 [new WIP version]2701 * Worker for bs3CpuInstr4_WorkerTestType1. 3066 2702 */ 3067 static uint16_t bs3CpuInstr4_WorkerTestType1 A_Inner(uint8_t bMode, PBS3CPUINSTR4_TEST1_CTX_T pTestCtx,2703 static uint16_t bs3CpuInstr4_WorkerTestType1_Inner(uint8_t bMode, PBS3CPUINSTR4_TEST1_CTX_T pTestCtx, 3068 2704 PCBS3CPUINSTRX_CONFIG_SAVED_T pSavedCfg) 3069 2705 { … … 3428 3064 3429 3065 /** 3430 * Test type #1 worker [new WIP version].3066 * Test type #1 worker. 3431 3067 */ 3432 static uint8_t bs3CpuInstr4_WorkerTestType1 A(uint8_t bMode, BS3CPUINSTR4_TEST1_T const BS3_FAR *paTests, unsigned cTests,3068 static uint8_t bs3CpuInstr4_WorkerTestType1(uint8_t bMode, BS3CPUINSTR4_TEST1_T const BS3_FAR *paTests, unsigned cTests, 3433 3069 PCBS3CPUINSTR4_CONFIG_T paConfigs, unsigned cConfigs) 3434 3070 { … … 3559 3195 TestCtx.bXcptExpect = bXcptExpect; 3560 3196 TestCtx.idTestStep = idTestStep; 3561 cErrors = bs3CpuInstr4_WorkerTestType1 A_Inner(bMode, &TestCtx, &SavedCfg);3197 cErrors = bs3CpuInstr4_WorkerTestType1_Inner(bMode, &TestCtx, &SavedCfg); 3562 3198 if (cErrors != Bs3TestSubErrorCount()) 3563 3199 { … … 3596 3232 return 0; 3597 3233 } 3234 3235 3236 /** @todo 'master switch' turns on all IEM misbehaviors documented below */ 3237 #ifdef TODO_EXPOSE_IEM_ERRATA 3238 # define TODO_X86_MXCSR_PE_IEM 3239 # define TODO_X86_MXCSR_PE_IEM_SSE 3240 # define TODO_X86_MXCSR_UE_IEM 3241 #endif /* TODO_EXPOSE_IEM_ERRATA */ 3598 3242 3599 3243 … … 3983 3627 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 3984 3628 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 3985 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,3629 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 3986 3630 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 3987 3631 } … … 4185 3829 /*256:out */ BS3_MXCSR_DM_FIXED | X86_MXCSR_DE, 4186 3830 /*xcpt? */ true, true }, 4187 #ifdef TODO_X86_MXCSR_UE_HW /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 4188 /* this is what works on HW (i7-10700) (same as below, plus out:_UE) */ 3831 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 4189 3832 /*--|25*/{ { /*src2 */ { FP64_DENORM_MAX(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, 4190 3833 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, … … 4193 3836 /*128:out */ X86_MXCSR_DM | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED | X86_MXCSR_DE | X86_MXCSR_UE, 4194 3837 /*256:out */ X86_MXCSR_DM | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED | X86_MXCSR_DE | X86_MXCSR_UE, 4195 /*xcpt? */ true, true },4196 #endif /* TODO_X86_MXCSR_UE_HW */4197 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON HW: X86_MXCSR_UE not set in 128:out or 256:out */4198 /* for comparison, this is what works on IEM (same as above, minus out:_UE) */4199 /*--|25*/{ { /*src2 */ { FP64_DENORM_MAX(0), FP64_0(0), FP64_0(0), FP64_0(0) } },4200 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } },4201 { /* => */ { FP64_DENORM_MAX(0), FP64_0(0), FP64_0(0), FP64_0(0) } },4202 /*mxcsr:in */ X86_MXCSR_DM, /* DM on, UM off */4203 /*128:out */ X86_MXCSR_DM | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED | X86_MXCSR_DE,4204 /*256:out */ X86_MXCSR_DM | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED | X86_MXCSR_DE,4205 3838 /*xcpt? */ true, true }, 4206 3839 #endif /* TODO_X86_MXCSR_UE_IEM */ … … 4219 3852 /*256:out */ BS3_MXCSR_DM_FIXED | X86_MXCSR_DE, 4220 3853 /*xcpt? */ false, false }, 4221 #ifdef TODO_X86_MXCSR_UE_HW /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 4222 /* this is what works on HW (i7-10700) (same as below, plus 256:out:_UE) */ 3854 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 4223 3855 /*--|28*/{ { /*src2 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, 4224 3856 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_DENORM_MAX(0), FP64_0(0) } }, … … 4227 3859 /*128:out */ X86_MXCSR_DM, 4228 3860 /*256:out */ X86_MXCSR_DM | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED | X86_MXCSR_DE | X86_MXCSR_UE, 4229 /*xcpt? */ true, true },4230 #endif /* TODO_X86_MXCSR_UE_HW */4231 #ifdef TODO_X86_MXCSR_UE_IEM4232 /* for comparison, this is what works on IEM (same as above, minus 256:out:_UE) */4233 /*--|28*/{ { /*src2 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } },4234 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_DENORM_MAX(0), FP64_0(0) } },4235 { /* => */ { FP64_0(0), FP64_0(0), FP64_DENORM_MAX(0), FP64_0(0) } },4236 /*mxcsr:in */ X86_MXCSR_DM, /* DM on, UM off */4237 /*128:out */ X86_MXCSR_DM,4238 /*256:out */ X86_MXCSR_DM | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED | X86_MXCSR_DE,4239 3861 /*xcpt? */ true, true }, 4240 3862 #endif /* TODO_X86_MXCSR_UE_IEM */ … … 4257 3879 * Invalids. 4258 3880 */ 4259 /*27*/ FP64_TABLE_D1_PD_INVALIDS3881 /*29|31*/ FP64_TABLE_D1_PD_INVALIDS 4260 3882 /** @todo Underflow, Precision; Rounding; FZ etc. */ 4261 3883 }; … … 4307 3929 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 4308 3930 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 4309 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,3931 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 4310 3932 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 4311 3933 } … … 4554 4176 /*--|31*/{ { /*src2 */ { FP32_DENORM_MAX(0), FP32_RAND_x7_V5 } }, 4555 4177 { /*src1 */ { FP32_0(0), FP32_RAND_x7_V4 } }, 4556 { /* => */ { FP32_0(0), FP32_RAND_x7_V4 } } ,4178 { /* => */ { FP32_0(0), FP32_RAND_x7_V4 } } /* result on HW (i7-10700) */, 4557 4179 // IEM: { /* => */ { FP32_DENORM_MAX(0), FP32_RAND_x7_V4 } } /* result on IEM */, 4558 4180 /*mxcsr:in */ X86_MXCSR_DM, … … 4639 4261 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 4640 4262 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 4641 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,4263 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 4642 4264 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 4643 4265 } … … 4987 4609 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 4988 4610 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 4989 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,4611 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 4990 4612 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 4991 4613 } … … 5361 4983 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 5362 4984 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 5363 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,4985 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 5364 4986 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 5365 4987 } … … 5700 5322 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 5701 5323 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 5702 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,5324 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 5703 5325 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 5704 5326 } … … 6123 5745 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 6124 5746 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 6125 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,5747 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 6126 5748 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 6127 5749 } … … 6360 5982 /*256:out */ X86_MXCSR_DE | BS3_MXCSR_DM_FIXED, 6361 5983 /*xcpt? */ true, true }, 6362 #ifdef TODO_X86_MXCSR_UE_HW /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 6363 /* this is what works on HW (i7-10700) (same as below, plus 256:out:_UE) */ 5984 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 6364 5985 /*--|30*/{ { /*src2 */ { FP64_DENORM_MAX(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, 6365 5986 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, … … 6368 5989 /*128:out */ X86_MXCSR_DE | X86_MXCSR_UE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED, 6369 5990 /*256:out */ X86_MXCSR_DE | X86_MXCSR_UE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED, 6370 /*xcpt? */ true, true },6371 #endif /* TODO_X86_MXCSR_UE_HW */6372 #ifdef TODO_X86_MXCSR_UE_IEM6373 /* for comparison, this is what works on IEM (same as above, minus 256:out:_UE) */6374 /*--|30*/{ { /*src2 */ { FP64_DENORM_MAX(0), FP64_0(0), FP64_0(0), FP64_0(0) } },6375 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } },6376 { /* => */ { FP64_DENORM_MAX(1), FP64_0(0), FP64_0(0), FP64_0(0) } },6377 /*mxcsr:in */ X86_MXCSR_DM,6378 /*128:out */ X86_MXCSR_DE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED,6379 /*256:out */ X86_MXCSR_DE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED,6380 5991 /*xcpt? */ true, true }, 6381 5992 #endif /* TODO_X86_MXCSR_UE_IEM */ … … 6387 5998 /*256:out */ X86_MXCSR_DE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED, 6388 5999 /*xcpt? */ true, true }, 6389 /*31|32*/{ { /*src2 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } },6000 { { /*src2 */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, 6390 6001 { /*src1 */ { FP64_0(0), FP64_DENORM_MAX(0), FP64_0(0), FP64_0(0) } }, 6391 6002 { /* => */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, … … 6394 6005 /*256:out */ X86_MXCSR_DAZ | X86_MXCSR_XCPT_MASK, 6395 6006 /*xcpt? */ false, false }, 6396 /*32|33*/{ { /*src2 */ { FP64_DENORM_MIN(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0), FP64_DENORM_MAX(0) } },6007 { { /*src2 */ { FP64_DENORM_MIN(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0), FP64_DENORM_MAX(0) } }, 6397 6008 { /*src1 */ { FP64_DENORM_MAX(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0), FP64_DENORM_MIN(0) } }, 6398 6009 { /* => */ { FP64_0(0), FP64_0(0), FP64_0(0), FP64_0(0) } }, … … 6455 6066 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 6456 6067 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 6457 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,6068 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 6458 6069 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 6459 6070 } … … 6794 6405 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 6795 6406 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 6796 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,6407 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 6797 6408 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 6798 6409 } … … 7167 6778 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 7168 6779 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 7169 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,6780 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 7170 6781 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 7171 6782 } … … 7541 7152 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 7542 7153 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 7543 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,7154 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 7544 7155 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 7545 7156 } … … 7848 7459 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 7849 7460 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 7850 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,7461 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 7851 7462 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 7852 7463 } … … 8298 7909 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 8299 7910 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 8300 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,7911 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 8301 7912 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 8302 7913 } … … 8610 8221 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 8611 8222 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 8612 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,8223 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 8613 8224 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 8614 8225 } … … 8867 8478 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 8868 8479 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 8869 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,8480 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 8870 8481 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 8871 8482 } … … 9201 8812 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 9202 8813 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 9203 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,8814 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 9204 8815 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 9205 8816 } … … 9330 8941 /*256:out */ X86_MXCSR_UM | X86_MXCSR_UE | X86_MXCSR_PE | BS3_MXCSR_UM_FIXED, 9331 8942 /*xcpt? */ false, true }, 9332 #ifdef TODO_X86_MXCSR_PE /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 256:out */8943 #ifdef TODO_X86_MXCSR_PE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 256:out */ 9333 8944 /*--|15*/{ { /*src2 */ { FP32_V(0,0,0x7e)/*0.50*/, FP32_1(1), FP32_1(0), FP32_1(0), FP32_NORM_MAX(1), FP32_1(0), FP32_NORM_MAX(1), FP32_NORM_MAX(0) } }, 9334 8945 { /*src1 */ { FP32_NORM_MAX(0), FP32_1(0), FP32_0(0), FP32_1(0), FP32_0(0), FP32_1(0), FP32_1(0), FP32_0(0) } }, … … 9338 8949 /*256:out */ X86_MXCSR_OE | X86_MXCSR_PE | X86_MXCSR_UE | BS3_MXCSR_OM_FIXED | BS3_MXCSR_UM_FIXED, 9339 8950 /*xcpt? */ false, false }, 9340 #endif /* TODO_X86_MXCSR_PE */8951 #endif /* TODO_X86_MXCSR_PE_IEM */ 9341 8952 /*14|16*/{ { /*src2 */ { FP32_V(0,0,0x7e)/*0.50*/, FP32_1(1), FP32_1(0), FP32_1(0), FP32_NORM_MAX(1), FP32_1(0), FP32_NORM_MAX(1), FP32_NORM_MAX(0) } }, 9342 8953 { /*src1 */ { FP32_NORM_MAX(0), FP32_1(0), FP32_0(0), FP32_1(0), FP32_0(0), FP32_1(0), FP32_1(0), FP32_0(0) } }, … … 9353 8964 /*256:out */ X86_MXCSR_OM | X86_MXCSR_OE | X86_MXCSR_PE | X86_MXCSR_UE | BS3_MXCSR_OM_FIXED, 9354 8965 /*xcpt? */ false, false }, 9355 #ifdef TODO_X86_MXCSR_PE /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 128:out or 256:out */8966 #ifdef TODO_X86_MXCSR_PE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 128:out or 256:out */ 9356 8967 /*--|18*/{ { /*src2 */ { FP32_NORM_MAX(0), FP32_NORM_MIN(0), FP32_1(0), FP32_1(0), FP32_NORM_MAX(0), FP32_1(1), FP32_1(0), FP32_NORM_MIN(0) } }, 9357 8968 { /*src1 */ { FP32_NORM_MIN(0), FP32_NORM_MAX(1), FP32_1(0), FP32_1(0), FP32_NORM_MIN(1), FP32_1(0), FP32_1(1), FP32_NORM_MAX(0) } }, … … 9361 8972 /*256:out */ X86_MXCSR_RC_ZERO | X86_MXCSR_OE | X86_MXCSR_PE | X86_MXCSR_UE | BS3_MXCSR_OM_FIXED | BS3_MXCSR_UM_FIXED, 9362 8973 /*xcpt? */ false, false }, 9363 #endif /* TODO_X86_MXCSR_PE */8974 #endif /* TODO_X86_MXCSR_PE_IEM */ 9364 8975 /*16|19*/{ { /*src2 */ { FP32_NORM_MAX(0), FP32_NORM_MIN(0), FP32_1(0), FP32_1(0), FP32_NORM_MAX(0), FP32_1(1), FP32_1(0), FP32_NORM_MIN(0) } }, 9365 8976 { /*src1 */ { FP32_NORM_MIN(0), FP32_NORM_MAX(1), FP32_1(0), FP32_1(0), FP32_NORM_MIN(1), FP32_1(0), FP32_1(1), FP32_NORM_MAX(0) } }, … … 9603 9214 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 9604 9215 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 9605 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,9216 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 9606 9217 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 9607 9218 } … … 9775 9386 /*256:out */ X86_MXCSR_FZ | X86_MXCSR_DE | X86_MXCSR_UE | X86_MXCSR_PE | BS3_MXCSR_PE_FUZZY /* i7-10700, IEM */, 9776 9387 /*xcpt? */ false, true }, 9777 #ifdef TODO_X86_MXCSR_UE /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 256:out */9388 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 256:out */ 9778 9389 /*--|21*/{ { /*src2 */ { FP64_1(0), FP64_1(1), FP64_1(0), FP64_1(0) } }, 9779 9390 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0) } }, … … 9783 9394 /*256:out */ X86_MXCSR_DE | X86_MXCSR_UE | BS3_MXCSR_UM_FIXED, 9784 9395 /*xcpt? */ false, false }, 9785 #endif /* TODO_X86_MXCSR_UE */9396 #endif /* TODO_X86_MXCSR_UE_IEM */ 9786 9397 /*21|22*/{ { /*src2 */ { FP64_1(0), FP64_1(1), FP64_1(0), FP64_1(0) } }, 9787 9398 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0) } }, … … 9791 9402 /*256:out */ X86_MXCSR_DE | BS3_MXCSR_UM_FIXED, 9792 9403 /*xcpt? */ false, false }, 9793 #ifdef TODO_X86_MXCSR_UE /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 256:out */9404 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 256:out */ 9794 9405 /*--|23*/{ { /*src2 */ { FP64_1(0), FP64_1(1), FP64_1(0), FP64_1(0) } }, 9795 9406 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0) } }, … … 9799 9410 /*256:out */ X86_MXCSR_DM | X86_MXCSR_DE | X86_MXCSR_UE | BS3_MXCSR_UM_FIXED, 9800 9411 /*xcpt? */ false, true }, 9801 #endif /* TODO_X86_MXCSR_UE */9412 #endif /* TODO_X86_MXCSR_UE_IEM */ 9802 9413 /*22|24*/{ { /*src2 */ { FP64_1(0), FP64_1(1), FP64_1(0), FP64_1(0) } }, 9803 9414 { /*src1 */ { FP64_0(0), FP64_0(0), FP64_DENORM_MIN(0), FP64_DENORM_MAX(0) } }, … … 9982 9593 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 9983 9594 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 9984 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,9595 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 9985 9596 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 9986 9597 } … … 10241 9852 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 10242 9853 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 10243 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,9854 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 10244 9855 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 10245 9856 } … … 10569 10180 /*256:out */ -1, 10570 10181 /*xcpt? */ false, false }, 10571 #ifdef TODO_X86_MXCSR_PE /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 128:out */10182 #ifdef TODO_X86_MXCSR_PE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 128:out */ 10572 10183 /*--|41*/{ { /* DENORM_MAX / -42.0 = -5e-310 &_DE &!_PE(if DM && !UM) &_UE */ 10573 10184 /*src2 */ { FP64_V(1, 0x5000000000000, 0x404)/*-42.0*/, FP64_0(0), FP64_RAND_V2(0), FP64_RAND_V1(1) } }, … … 10578 10189 /*256:out */ -1, 10579 10190 /*xcpt? */ false, false }, 10580 #endif /* TODO_X86_MXCSR_PE */10191 #endif /* TODO_X86_MXCSR_PE_IEM */ 10581 10192 /*41|42*/{ { /* UMASKED: DENORM_MAX / 42.0 = 5e-310 &_DE &_PE(if UM) &_UE */ 10582 10193 /*src2 */ { FP64_V(0, 0x5000000000000, 0x404)/*-42.0*/, FP64_0(0), FP64_RAND_V2(0), FP64_RAND_V1(1) } }, … … 10595 10206 /*256:out */ -1, 10596 10207 /*xcpt? */ true, true }, 10597 #ifdef TODO_X86_MXCSR_PE /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 128:out */10208 #ifdef TODO_X86_MXCSR_PE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_PE not set in 128:out */ 10598 10209 /*--|44*/{ { /* D~UMASKED: DENORM_MAX / 42.0 = 5e-310 &_DE &!_PE(if DM && !UM) &_UE */ 10599 10210 /*src2 */ { FP64_V(0, 0x5000000000000, 0x404)/*-42.0*/, FP64_0(0), FP64_RAND_V2(0), FP64_RAND_V1(1) } }, … … 10604 10215 /*256:out */ -1, 10605 10216 /*xcpt? */ true, true }, 10606 #endif /* TODO_X86_MXCSR_PE */10217 #endif /* TODO_X86_MXCSR_PE_IEM */ 10607 10218 /*43|45*/{ { /* DAZ: DENORM_MAX / -42.0 = -0 &- */ 10608 10219 /*src2 */ { FP64_V(1, 0x5000000000000, 0x404)/*-42.0*/, FP64_0(0), FP64_RAND_V2(0), FP64_RAND_V1(1) } }, … … 10664 10275 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 10665 10276 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 10666 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,10277 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 10667 10278 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 10668 10279 } … … 10937 10548 /*256:out */ X86_MXCSR_DE | BS3_MXCSR_DM_FIXED, 10938 10549 /*xcpt? */ false, false }, 10939 #ifdef TODO_X86_MXCSR_UE /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */10550 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 128:out or 256:out */ 10940 10551 /*--|35*/{ { /*src2 */ { FP32_DENORM_MAX(0), FP32_0(0), FP32_DENORM_MAX(0), FP32_DENORM_MAX(0), FP32_DENORM_MAX(0), FP32_DENORM_MAX(1), FP32_0(0), FP32_0(0) } }, 10941 10552 { /*src1 */ { FP32_0(0), FP32_DENORM_MAX(1), FP32_DENORM_MAX(0), FP32_DENORM_MAX(0), FP32_0(0), FP32_DENORM_MAX(1), FP32_DENORM_MAX(0), FP32_DENORM_MAX(1) } }, … … 10945 10556 /*256:out */ X86_MXCSR_DM | X86_MXCSR_DE | X86_MXCSR_UE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED, 10946 10557 /*xcpt? */ false, false }, 10947 #endif /* TODO_X86_MXCSR_UE */10558 #endif /* TODO_X86_MXCSR_UE_IEM */ 10948 10559 /*35|36*/{ { /*src2 */ { FP32_DENORM_MAX(0), FP32_0(0), FP32_DENORM_MAX(0), FP32_DENORM_MAX(0), FP32_DENORM_MAX(0), FP32_DENORM_MAX(1), FP32_0(0), FP32_0(0) } }, 10949 10560 { /*src1 */ { FP32_0(0), FP32_DENORM_MAX(1), FP32_DENORM_MAX(0), FP32_DENORM_MAX(0), FP32_0(0), FP32_DENORM_MAX(1), FP32_DENORM_MAX(0), FP32_DENORM_MAX(1) } }, … … 10974 10585 /*256:out */ X86_MXCSR_DE | BS3_MXCSR_DM_FIXED, 10975 10586 /*xcpt? */ false, false }, 10976 #ifdef TODO_X86_MXCSR_UE /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 256:out */10587 #ifdef TODO_X86_MXCSR_UE_IEM /** @todo THIS FAILS ON IEM: X86_MXCSR_UE not set in 256:out */ 10977 10588 /*--|40*/{ { /*src2 */ { FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0)} }, 10978 10589 { /*src1 */ { FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_DENORM_MAX(0), FP32_0(0), FP32_0(0), FP32_0(0)} }, … … 10982 10593 /*256:out */ X86_MXCSR_DM | X86_MXCSR_DE | X86_MXCSR_UE | BS3_MXCSR_DM_FIXED | BS3_MXCSR_UM_FIXED, 10983 10594 /*xcpt? */ false, false }, 10984 #endif /* TODO_X86_MXCSR_UE */10595 #endif /* TODO_X86_MXCSR_UE_IEM */ 10985 10596 /*39|41*/{ { /*src2 */ { FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0)} }, 10986 10597 { /*src1 */ { FP32_0(0), FP32_0(0), FP32_0(0), FP32_0(0), FP32_DENORM_MAX(0), FP32_0(0), FP32_0(0), FP32_0(0)} }, … … 11079 10690 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 11080 10691 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 11081 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,10692 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 11082 10693 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 11083 10694 } … … 11589 11200 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 11590 11201 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 11591 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,11202 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 11592 11203 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 11593 11204 } … … 11909 11520 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 11910 11521 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 11911 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,11522 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 11912 11523 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 11913 11524 } … … 12231 11842 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 12232 11843 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 12233 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,11844 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 12234 11845 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 12235 11846 } … … 12688 12299 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 12689 12300 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 12690 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,12301 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 12691 12302 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 12692 12303 } … … 13147 12758 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 13148 12759 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 13149 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,12760 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 13150 12761 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 13151 12762 } … … 13467 13078 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 13468 13079 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 13469 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,13080 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 13470 13081 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 13471 13082 } … … 13789 13400 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 13790 13401 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 13791 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,13402 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 13792 13403 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 13793 13404 } … … 14246 13857 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 14247 13858 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 14248 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,13859 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 14249 13860 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 14250 13861 } … … 14705 14316 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 14706 14317 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 14707 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,14318 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 14708 14319 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 14709 14320 } … … 15068 14679 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 15069 14680 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 15070 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,15071 14681 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 14682 g_aXcptConfig4, RT_ELEMENTS(g_aXcptConfig4)); 15072 14683 } 15073 14684 … … 15389 15000 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 15390 15001 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 15391 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,15002 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 15392 15003 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 15393 15004 } … … 15666 15277 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 15667 15278 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 15668 return bs3CpuInstr4_WorkerTestType1 A(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests,15279 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 15669 15280 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 15670 15281 }
Note:
See TracChangeset
for help on using the changeset viewer.