Changeset 106179 in vbox for trunk/src/VBox/VMM/testcase
- Timestamp:
- Sep 29, 2024 1:14:19 AM (4 months ago)
- Location:
- trunk/src/VBox/VMM/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r105275 r106179 2991 2991 MULDIVU8_TEST_T Test; 2992 2992 Test.fEflIn = RandEFlags(); 2993 Test.fEflOut = Test.fEflIn;2994 2993 Test.uDstIn = RandU16Dst(iTest); 2995 2994 Test.uDstOut = Test.uDstIn; 2996 2995 Test.uSrcIn = RandU8Src(iTest); 2997 Test.rc = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); 2996 uint32_t const fEflRet = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, Test.fEflIn); 2997 Test.fEflOut = fEflRet ? fEflRet : Test.fEflIn; 2998 Test.rc = fEflRet ? 0 : -1; 2998 2999 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); 2999 3000 } … … 3003 3004 Test.fEflIn = g_aMulDivU8[iFn].paFixedTests[iTest].fEflIn == UINT32_MAX ? RandEFlags() 3004 3005 : g_aMulDivU8[iFn].paFixedTests[iTest].fEflIn; 3005 Test.fEflOut = Test.fEflIn;3006 3006 Test.uDstIn = g_aMulDivU8[iFn].paFixedTests[iTest].uDstIn; 3007 3007 Test.uDstOut = Test.uDstIn; 3008 3008 Test.uSrcIn = g_aMulDivU8[iFn].paFixedTests[iTest].uSrcIn; 3009 Test.rc = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); 3009 uint32_t const fEflRet = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, Test.fEflIn); 3010 Test.fEflOut = fEflRet ? fEflRet : Test.fEflIn; 3011 Test.rc = fEflRet ? 0 : -1; 3010 3012 if (g_aMulDivU8[iFn].paFixedTests[iTest].rc == 0 || g_aMulDivU8[iFn].paFixedTests[iTest].rc == -1) 3011 3013 Test.rc = g_aMulDivU8[iFn].paFixedTests[iTest].rc; … … 3022 3024 uint32_t const fEflIn = pEntry->fEflIn; 3023 3025 uint16_t const uDstIn = pEntry->uDstIn; 3024 uint8_t const uSrcIn 3026 uint8_t const uSrcIn = pEntry->uSrcIn; 3025 3027 cIterations /= 4; 3026 3028 RTThreadYield(); 3027 uint64_t const nsStart 3029 uint64_t const nsStart = RTTimeNanoTS(); 3028 3030 for (uint32_t i = 0; i < cIterations; i++) 3029 3031 { 3030 uint32_t fBenchEfl = fEflIn;3031 3032 uint16_t uBenchDst = uDstIn; 3032 pfn(&uBenchDst, uSrcIn, &fBenchEfl); 3033 3034 fBenchEfl = fEflIn; 3033 pfn(&uBenchDst, uSrcIn, fEflIn); 3034 3035 3035 uBenchDst = uDstIn; 3036 pfn(&uBenchDst, uSrcIn, &fBenchEfl); 3037 3038 fBenchEfl = fEflIn; 3036 pfn(&uBenchDst, uSrcIn, fEflIn); 3037 3039 3038 uBenchDst = uDstIn; 3040 pfn(&uBenchDst, uSrcIn, &fBenchEfl); 3041 3042 fBenchEfl = fEflIn; 3039 pfn(&uBenchDst, uSrcIn, fEflIn); 3040 3043 3041 uBenchDst = uDstIn; 3044 pfn(&uBenchDst, uSrcIn, &fBenchEfl);3042 pfn(&uBenchDst, uSrcIn, fEflIn); 3045 3043 } 3046 3044 return RTTimeNanoTS() - nsStart; … … 3063 3061 for (uint32_t iTest = 0; iTest < cTests; iTest++ ) 3064 3062 { 3065 uint32_t fEfl = paTests[iTest].fEflIn; 3066 uint16_t uDst = paTests[iTest].uDstIn; 3067 int rc = g_aMulDivU8[iFn].pfn(&uDst, paTests[iTest].uSrcIn, &fEfl); 3063 uint16_t uDst = paTests[iTest].uDstIn; 3064 uint32_t fEfl = pfn(&uDst, paTests[iTest].uSrcIn, paTests[iTest].fEflIn); 3065 int rc = fEfl ? 0 : -1; 3066 fEfl = fEfl ? fEfl : paTests[iTest].fEflIn; 3068 3067 if ( uDst != paTests[iTest].uDstOut 3069 3068 || (fEfl | fEflIgn) != (paTests[iTest].fEflOut | fEflIgn) … … 3078 3077 else 3079 3078 { 3080 *g_pu16 = paTests[iTest].uDstIn; 3081 *g_pfEfl = paTests[iTest].fEflIn; 3082 rc = g_aMulDivU8[iFn].pfn(g_pu16, paTests[iTest].uSrcIn, g_pfEfl); 3083 RTTEST_CHECK(g_hTest, *g_pu16 == paTests[iTest].uDstOut); 3084 RTTEST_CHECK(g_hTest, (*g_pfEfl | fEflIgn) == (paTests[iTest].fEflOut | fEflIgn)); 3085 RTTEST_CHECK(g_hTest, rc == paTests[iTest].rc); 3079 *g_pu16 = paTests[iTest].uDstIn; 3080 fEfl = pfn(g_pu16, paTests[iTest].uSrcIn, paTests[iTest].fEflIn); 3081 rc = fEfl ? 0 : -1; 3082 fEfl = fEfl ? fEfl : paTests[iTest].fEflIn; 3083 RTTEST_CHECK(g_hTest, *g_pu16 == paTests[iTest].uDstOut); 3084 RTTEST_CHECK(g_hTest, (fEfl | fEflIgn) == (paTests[iTest].fEflOut | fEflIgn)); 3085 RTTEST_CHECK(g_hTest, rc == paTests[iTest].rc); 3086 3086 } 3087 3087 } … … 3160 3160 { \ 3161 3161 Test.fEflIn = RandEFlags(); \ 3162 Test.fEflOut = Test.fEflIn; \3163 3162 Test.uDst1In = RandU ## a_cBits ## Dst(iTest); \ 3164 3163 Test.uDst1Out = Test.uDst1In; \ … … 3166 3165 Test.uDst2Out = Test.uDst2In; \ 3167 3166 Test.uSrcIn = RandU ## a_cBits ## Src(iTest); \ 3168 Test.rc = a_aSubTests[iFn].pfnNative(&Test.uDst1Out, &Test.uDst2Out, Test.uSrcIn, &Test.fEflOut); \ 3167 uint32_t const fEflRet = a_aSubTests[iFn].pfnNative(&Test.uDst1Out, &Test.uDst2Out, Test.uSrcIn, Test.fEflIn); \ 3168 Test.fEflOut = fEflRet ? fEflRet : Test.fEflIn; \ 3169 Test.rc = fEflRet ? 0 : -1; \ 3169 3170 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); \ 3170 3171 } \ … … 3173 3174 Test.fEflIn = a_aSubTests[iFn].paFixedTests[iTest].fEflIn == UINT32_MAX ? RandEFlags() \ 3174 3175 : a_aSubTests[iFn].paFixedTests[iTest].fEflIn; \ 3175 Test.fEflOut = Test.fEflIn; \3176 3176 Test.uDst1In = a_aSubTests[iFn].paFixedTests[iTest].uDst1In; \ 3177 3177 Test.uDst1Out = Test.uDst1In; \ … … 3179 3179 Test.uDst2Out = Test.uDst2In; \ 3180 3180 Test.uSrcIn = a_aSubTests[iFn].paFixedTests[iTest].uSrcIn; \ 3181 Test.rc = a_aSubTests[iFn].pfnNative(&Test.uDst1Out, &Test.uDst2Out, Test.uSrcIn, &Test.fEflOut); \ 3181 uint32_t const fEflRet = a_aSubTests[iFn].pfnNative(&Test.uDst1Out, &Test.uDst2Out, Test.uSrcIn, Test.fEflIn); \ 3182 Test.fEflOut = fEflRet ? fEflRet : Test.fEflIn; \ 3183 Test.rc = fEflRet ? 0 : -1; \ 3182 3184 if (a_aSubTests[iFn].paFixedTests[iTest].rc == 0 || a_aSubTests[iFn].paFixedTests[iTest].rc == -1) \ 3183 3185 Test.rc = a_aSubTests[iFn].paFixedTests[iTest].rc; \ … … 3216 3218 cIterations /= 4; \ 3217 3219 RTThreadYield(); \ 3218 uint64_t const nsStart 3220 uint64_t const nsStart = RTTimeNanoTS(); \ 3219 3221 for (uint32_t i = 0; i < cIterations; i++) \ 3220 3222 { \ 3221 uint32_t fBenchEfl = fEflIn; \3222 3223 a_uType uBenchDst1 = uDst1In; \ 3223 3224 a_uType uBenchDst2 = uDst2In; \ 3224 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, &fBenchEfl); \3225 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, fEflIn); \ 3225 3226 \ 3226 fBenchEfl = fEflIn; \3227 3227 uBenchDst1 = uDst1In; \ 3228 3228 uBenchDst2 = uDst2In; \ 3229 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, &fBenchEfl); \3229 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, fEflIn); \ 3230 3230 \ 3231 fBenchEfl = fEflIn; \3232 3231 uBenchDst1 = uDst1In; \ 3233 3232 uBenchDst2 = uDst2In; \ 3234 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, &fBenchEfl); \3233 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, fEflIn); \ 3235 3234 \ 3236 fBenchEfl = fEflIn; \3237 3235 uBenchDst1 = uDst1In; \ 3238 3236 uBenchDst2 = uDst2In; \ 3239 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, &fBenchEfl); \3237 pfn(&uBenchDst1, &uBenchDst2, uSrcIn, fEflIn); \ 3240 3238 } \ 3241 3239 return RTTimeNanoTS() - nsStart; \ … … 3258 3256 for (uint32_t iTest = 0; iTest < cTests; iTest++ ) \ 3259 3257 { \ 3260 uint32_t fEfl = paTests[iTest].fEflIn; \3261 3258 a_uType uDst1 = paTests[iTest].uDst1In; \ 3262 3259 a_uType uDst2 = paTests[iTest].uDst2In; \ 3263 int rc = pfn(&uDst1, &uDst2, paTests[iTest].uSrcIn, &fEfl); \ 3260 uint32_t fEfl = pfn(&uDst1, &uDst2, paTests[iTest].uSrcIn, paTests[iTest].fEflIn); \ 3261 int rc = fEfl ? 0 : -1; \ 3262 fEfl = fEfl ? fEfl : paTests[iTest].fEflIn; \ 3264 3263 if ( uDst1 != paTests[iTest].uDst1Out \ 3265 3264 || uDst2 != paTests[iTest].uDst2Out \ … … 3280 3279 *g_pu ## a_cBits = paTests[iTest].uDst1In; \ 3281 3280 *g_pu ## a_cBits ## Two = paTests[iTest].uDst2In; \ 3282 *g_pfEfl = paTests[iTest].fEflIn; \ 3283 rc = pfn(g_pu ## a_cBits, g_pu ## a_cBits ## Two, paTests[iTest].uSrcIn, g_pfEfl); \ 3281 fEfl = pfn(g_pu ## a_cBits, g_pu ## a_cBits ## Two, paTests[iTest].uSrcIn, paTests[iTest].fEflIn); \ 3282 rc = fEfl ? 0 : -1; \ 3283 fEfl = fEfl ? fEfl : paTests[iTest].fEflIn; \ 3284 3284 RTTEST_CHECK(g_hTest, *g_pu ## a_cBits == paTests[iTest].uDst1Out); \ 3285 3285 RTTEST_CHECK(g_hTest, *g_pu ## a_cBits ## Two == paTests[iTest].uDst2Out); \ 3286 RTTEST_CHECK(g_hTest, ( *g_pfEfl | fEflIgn)== (paTests[iTest].fEflOut | fEflIgn)); \3286 RTTEST_CHECK(g_hTest, (fEfl | fEflIgn) == (paTests[iTest].fEflOut | fEflIgn)); \ 3287 3287 RTTEST_CHECK(g_hTest, rc == paTests[iTest].rc); \ 3288 3288 } \ -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r106097 r106179 618 618 #define IEM_MC_IND_CALL_U64_AND_FINISH(a_u64NewIP) do { (void)fMcBegin; CHK_TYPE(uint64_t, a_u64NewIP); return VINF_SUCCESS; } while (0) 619 619 #define IEM_MC_RETN_AND_FINISH(a_u16Pop) do { (void)fMcBegin; return VINF_SUCCESS; } while (0) 620 #define IEM_MC_RAISE_DIVIDE_ERROR () do { (void)fMcBegin;return VERR_TRPM_ACTIVE_TRAP; } while (0)620 #define IEM_MC_RAISE_DIVIDE_ERROR_IF_LOCAL_IS_ZERO(a_uVar) do { (void)fMcBegin; CHK_VAR(a_uVar); if (a_uVar == 0) return VERR_TRPM_ACTIVE_TRAP; } while (0) 621 621 #define IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE() do { (void)fMcBegin; } while (0) 622 622 #define IEM_MC_MAYBE_RAISE_WAIT_DEVICE_NOT_AVAILABLE() do { (void)fMcBegin; } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.