Changeset 103084 in vbox
- Timestamp:
- Jan 26, 2024 3:22:06 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r103075 r103084 120 120 g_abTests_ ## a_Name ## _amd, &g_cbTests_ ## a_Name ## _amd, \ 121 121 a_uExtra, IEMTARGETCPU_EFL_BEHAVIOR_AMD } 122 123 #define ENTRY_BIN_FIX_INTEL(a_Name, a_fEflUndef) ENTRY_BIN_FIX_INTEL_EX(a_Name, a_fEflUndef, 0) 124 #ifdef TSTIEMAIMPL_WITH_GENERATOR 125 # define ENTRY_BIN_FIX_INTEL_EX(a_Name, a_fEflUndef, a_uExtra) \ 126 { RT_XSTR(a_Name) "_intel", iemAImpl_ ## a_Name ## _intel, iemAImpl_ ## a_Name, \ 127 g_abTests_ ## a_Name ## _intel, &g_cbTests_ ## a_Name ## _intel, \ 128 a_uExtra, IEMTARGETCPU_EFL_BEHAVIOR_INTEL, \ 129 RT_ELEMENTS(g_aFixedTests_ ## a_Name), g_aFixedTests_ ## a_Name } 130 #else 131 # define ENTRY_BIN_FIX_INTEL_EX(a_Name, a_fEflUndef, a_uExtra) ENTRY_BIN_INTEL_EX(a_Name, a_fEflUndef, a_uExtra) 132 #endif 133 134 #define ENTRY_BIN_FIX_AMD(a_Name, a_fEflUndef) ENTRY_BIN_FIX_AMD_EX(a_Name, a_fEflUndef, 0) 135 #ifdef TSTIEMAIMPL_WITH_GENERATOR 136 # define ENTRY_BIN_FIX_AMD_EX(a_Name, a_fEflUndef, a_uExtra) \ 137 { RT_XSTR(a_Name) "_amd", iemAImpl_ ## a_Name ## _amd, iemAImpl_ ## a_Name, \ 138 g_abTests_ ## a_Name ## _amd, &g_cbTests_ ## a_Name ## _amd, \ 139 a_uExtra, IEMTARGETCPU_EFL_BEHAVIOR_AMD, \ 140 RT_ELEMENTS(g_aFixedTests_ ## a_Name), g_aFixedTests_ ## a_Name } 141 #else 142 # define ENTRY_BIN_FIX_AMD_EX(a_Name, a_fEflUndef, a_uExtra) ENTRY_BIN_AMD_EX(a_Name, a_fEflUndef, a_uExtra) 143 #endif 144 122 145 123 146 #define TYPEDEF_SUBTEST_TYPE(a_TypeName, a_TestType, a_FunctionPtrType) \ … … 2713 2736 2714 2737 /* U8 */ 2738 #ifdef TSTIEMAIMPL_WITH_GENERATOR 2739 static const MULDIVU8_TEST_T g_aFixedTests_idiv_u8[] = 2740 { 2741 /* efl in, efl out, uDstIn, uDstOut, uSrcIn, rc */ 2742 { UINT32_MAX, 0, 0x8000, 0 , 0xc7, -1 }, /* -32768 / -57 = #DE (574.8771929824...) */ 2743 { UINT32_MAX, 0, 0x8000, 0 , 0xdd, -1 }, /* -32768 / -35 = #DE (936.2285714285...) */ 2744 }; 2745 #endif 2715 2746 TYPEDEF_SUBTEST_TYPE(INT_MULDIV_U8_T, MULDIVU8_TEST_T, PFNIEMAIMPLMULDIVU8); 2716 2747 static INT_MULDIV_U8_T g_aMulDivU8[] = 2717 2748 { 2718 ENTRY_BIN_AMD_EX(mul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF,2719 X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF),2720 ENTRY_BIN_INTEL_EX(mul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0),2721 ENTRY_BIN_AMD_EX(imul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF,2722 X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF),2723 ENTRY_BIN_INTEL_EX(imul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0),2724 ENTRY_BIN_AMD_EX(div_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0),2725 ENTRY_BIN_INTEL_EX(div_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0),2726 ENTRY_BIN_ AMD_EX(idiv_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0),2727 ENTRY_BIN_ INTEL_EX(idiv_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0),2749 ENTRY_BIN_AMD_EX(mul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 2750 X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF), 2751 ENTRY_BIN_INTEL_EX(mul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), 2752 ENTRY_BIN_AMD_EX(imul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 2753 X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF), 2754 ENTRY_BIN_INTEL_EX(imul_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), 2755 ENTRY_BIN_AMD_EX(div_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), 2756 ENTRY_BIN_INTEL_EX(div_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), 2757 ENTRY_BIN_FIX_AMD_EX(idiv_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), 2758 ENTRY_BIN_FIX_INTEL_EX(idiv_u8, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), 2728 2759 }; 2729 2760 … … 2747 2778 Test.uDstOut = Test.uDstIn; 2748 2779 Test.uSrcIn = RandU8Src(iTest); 2780 Test.rc = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); 2781 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); 2782 } 2783 for (uint32_t iTest = 0; iTest < g_aMulDivU8[iFn].cFixedTests; iTest++) 2784 { 2785 MULDIVU8_TEST_T Test; 2786 Test.fEflIn = g_aMulDivU8[iFn].paFixedTests[iTest].fEflIn == UINT32_MAX ? RandEFlags() 2787 : g_aMulDivU8[iFn].paFixedTests[iTest].fEflIn; 2788 Test.fEflOut = Test.fEflIn; 2789 Test.uDstIn = g_aMulDivU8[iFn].paFixedTests[iTest].uDstIn; 2790 Test.uDstOut = Test.uDstIn; 2791 Test.uSrcIn = g_aMulDivU8[iFn].paFixedTests[iTest].uSrcIn; 2749 2792 Test.rc = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); 2750 2793 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); … … 2835 2878 2836 2879 #define TEST_MULDIV(a_cBits, a_Type, a_Fmt, a_TestType, a_SubTestType, a_aSubTests) \ 2880 /** @todo fixed tests like u8 with INT16_MIN, INT32_MIN & INT64_MIN and \ 2881 * divisors. */ \ 2837 2882 TYPEDEF_SUBTEST_TYPE(a_SubTestType, a_TestType, PFNIEMAIMPLMULDIVU ## a_cBits); \ 2838 2883 static a_SubTestType a_aSubTests [] = \
Note:
See TracChangeset
for help on using the changeset viewer.