Changeset 103099 in vbox
- Timestamp:
- Jan 26, 2024 11:34:32 PM (10 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 183 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r102896 r103099 2218 2218 2219 2219 ; div by chainsaw check. 2220 test A1_8, A1_82220 and A1_32, 0xff ; Ensure it's zero extended to 16-bits for the idiv range check. 2221 2221 jz .div_zero 2222 2222 … … 2227 2227 jae .div_overflow 2228 2228 %else 2229 mov T0_16, [A0] ; T0 = dividend2229 movzx T0_32, word [A0] ; T0 = dividend (zero extending to full register to simplify register aliasing) 2230 2230 mov T1, A1 ; T1 = saved divisor (because of missing T1_8 in 32-bit) 2231 2231 test A1_8, A1_8 … … 2234 2234 jns .both_positive 2235 2235 neg T0_16 2236 .one_of_each: ; OK range is 2^(result-wi th - 1) + (divisor - 1).2236 .one_of_each: ; OK range is 2^(result-width - 1) + (divisor - 1). 2237 2237 push T0 ; Start off like unsigned below. 2238 2238 shr T0_16, 7 2239 cmp T0_ 8, A1_82239 cmp T0_16, A1_16 ; 16-bit compare, since T0_16=0x8000 >> 7 --> T0_16=0x0100. (neg 0x8000 = 0x8000) 2240 2240 pop T0 2241 2241 jb .div_no_overflow … … 2253 2253 .both_positive: ; Same as unsigned shifted by sign indicator bit. 2254 2254 shr T0_16, 7 2255 cmp T0_ 8, A1_82255 cmp T0_16, A1_16 ; 16-bit compare, since T0_16=0x8000 >> 7 --> T0_16=0x0100. (neg 0x8000 = 0x8000) 2256 2256 jae .div_overflow 2257 2257 .div_no_overflow: … … 2283 2283 2284 2284 ; div by chainsaw check. 2285 test A2_16, A2_162285 and A2_16, 0xffff ; Zero extend it for simpler sign overflow checks (see below). 2286 2286 jz .div_zero 2287 2287 … … 2292 2292 jae .div_overflow 2293 2293 %else 2294 mov T0_16, [A1]2294 movzx T0_32, word [A1] ; Zero extend to simplify register aliasing by clobbing the whole register. 2295 2295 shl T0_32, 16 2296 2296 mov T0_16, [A0] ; T0 = dividend … … 2301 2301 jns .both_positive 2302 2302 neg T0_32 2303 .one_of_each: ; OK range is 2^(result-wi th - 1) + (divisor - 1).2303 .one_of_each: ; OK range is 2^(result-width - 1) + (divisor - 1). 2304 2304 push T0 ; Start off like unsigned below. 2305 2305 shr T0_32, 15 2306 cmp T0_ 16, T1_162306 cmp T0_32, T1_32 ; 32-bit compares, because 0x80000000 >> 15 = 0x10000 (65536) which doesn't fit in 16 bits. 2307 2307 pop T0 2308 2308 jb .div_no_overflow … … 2320 2320 .both_positive: ; Same as unsigned shifted by sign indicator bit. 2321 2321 shr T0_32, 15 2322 cmp T0_ 16, T1_162322 cmp T0_32, T1_32 ; 32-bit compares, because 0x80000000 >> 15 = 0x10000 (65536) which doesn't fit in 16 bits. 2323 2323 jae .div_overflow 2324 2324 .div_no_overflow: … … 2373 2373 mov T0_32, [A0] ; T0 = dividend low 2374 2374 mov T1_32, [A1] ; T1 = dividend high 2375 test A2_32, A2_322375 ;test A2_32, A2_32 - we did this 5 instructions ago. 2376 2376 js .divisor_negative 2377 2377 test T1_32, T1_32 2378 2378 jns .both_positive 2379 2379 call NAME(iemAImpl_negate_T0_T1_u32) 2380 .one_of_each: ; OK range is 2^(result-with - 1) + (divisor - 1). 2380 .one_of_each: ; OK range is 2^(result-width - 1) + (divisor - 1). 2381 test T1_32, 0x80000000 ; neg 0x8000000000000000 = 0x8000000000000000 2382 jnz .div_overflow 2381 2383 push T0 ; Start off like unsigned below. 2382 2384 shl T1_32, 1 … … 2398 2400 call NAME(iemAImpl_negate_T0_T1_u32) 2399 2401 .both_positive: ; Same as unsigned shifted by sign indicator bit. 2402 test T1_32, 0x80000000 ; neg 0x8000000000000000 = 0x8000000000000000 2403 jnz .div_overflow 2400 2404 shl T1_32, 1 2401 2405 shr T0_32, 31 … … 2456 2460 mov T0, [A0] ; T0 = dividend low 2457 2461 mov T1, [A1] ; T1 = dividend high 2458 test A2, A22462 ;test A2, A2 - we did this five instructions above. 2459 2463 js .divisor_negative 2460 2464 test T1, T1 2461 2465 jns .both_positive 2462 2466 call NAME(iemAImpl_negate_T0_T1_u64) 2463 .one_of_each: ; OK range is 2^(result-with - 1) + (divisor - 1). 2467 .one_of_each: ; OK range is 2^(result-width - 1) + (divisor - 1). 2468 bt T1, 63 ; neg 0x8000000000000000'0000000000000000 = same 2469 jc .div_overflow 2464 2470 push T0 ; Start off like unsigned below. 2465 2471 shl T1, 1 … … 2482 2488 call NAME(iemAImpl_negate_T0_T1_u64) 2483 2489 .both_positive: ; Same as unsigned shifted by sign indicator bit. 2490 bt T1, 63 ; neg 0x8000000000000000'0000000000000000 = same 2491 jc .div_overflow 2484 2492 shl T1, 1 2485 2493 shr T0, 63 … … 2533 2541 IEMIMPL_DIV_OP div, 0, 0, 0, _intel, 1 2534 2542 IEMIMPL_DIV_OP div, 0, 0, 0, _amd, 2 2543 ;; @todo overflows with AX=0x8000 DL=0xc7 IDIV DL 2535 2544 IEMIMPL_DIV_OP idiv, 0, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 1, , 0 2536 2545 IEMIMPL_DIV_OP idiv, 0, 0, 1, _intel, 1 -
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r103084 r103099 183 183 184 184 185 typedef struct IEMBINARYFOOTER 186 { 187 char szMagic[24]; 188 uint32_t cbEntry; 189 uint32_t cEntries; 190 } IEMBINARYFOOTER; 191 AssertCompileSize(IEMBINARYFOOTER, 32); 192 // 012345678901234567890123 193 #define IEMBINARYFOOTER_MAGIC "\nIEMAImpl Bin Footer v1" 194 AssertCompile(sizeof(IEMBINARYFOOTER_MAGIC) == 24); 195 196 185 197 /** Fixed part of TYPEDEF_SUBTEST_TYPE and friends. */ 186 198 typedef struct IEMTESTENTRYINFO … … 200 212 /** The stream we write uncompressed binary test data to. */ 201 213 RTVFSIOSTREAM hVfsUncompressed; 214 /** The number of bytes written (ignoring write failures). */ 215 size_t cbWritten; 216 /** The entry size. */ 217 uint32_t cbEntry; 202 218 /** Write status. */ 203 219 int rcWrite; 204 220 /** Set if NULL. */ 205 221 bool fNull; 222 /** Set if we wrote a header and should write a footer as well. */ 223 bool fWroteHeader; 206 224 /** Filename. */ 207 char szFilename[ 79];225 char szFilename[94]; 208 226 } IEMBINARYOUTPUT; 209 227 typedef IEMBINARYOUTPUT *PIEMBINARYOUTPUT; … … 1058 1076 static void GenerateBinaryWrite(PIEMBINARYOUTPUT pBinOut, const void *pvData, size_t cbData) 1059 1077 { 1078 pBinOut->cbWritten += cbData; /* ignore errors - makes entry calculation simpler */ 1060 1079 if (RT_SUCCESS_NP(pBinOut->rcWrite)) 1061 1080 { … … 1070 1089 IEMTESTENTRYINFO const *pInfoToPreserve, uint32_t cbEntry) 1071 1090 { 1091 pBinOut->cbEntry = cbEntry; 1092 pBinOut->cbWritten = 0; 1072 1093 pBinOut->hVfsFile = NIL_RTVFSFILE; 1073 1094 pBinOut->hVfsUncompressed = NIL_RTVFSIOSTREAM; … … 1090 1111 if (RT_SUCCESS(pBinOut->rcWrite)) 1091 1112 { 1092 pBinOut->rcWrite = VINF_SUCCESS; 1113 pBinOut->rcWrite = VINF_SUCCESS; 1114 pBinOut->fWroteHeader = false; 1093 1115 1094 1116 /* Write the header if applicable. */ … … 1104 1126 pInfoToPreserve ? pInfoToPreserve->pszCpuDesc : g_szCpuDesc); 1105 1127 GenerateBinaryWrite(pBinOut, &Hdr, sizeof(Hdr)); 1128 pBinOut->fWroteHeader = true; 1106 1129 } 1107 1130 … … 1132 1155 pBinOut->rcWrite = VERR_IGNORED; 1133 1156 pBinOut->fNull = true; 1157 pBinOut->fWroteHeader = false; 1134 1158 pBinOut->szFilename[0] = '\0'; 1135 1159 return true; … … 1144 1168 if (!pBinOut->fNull) 1145 1169 { 1170 /* Write footer if we've written a header. */ 1171 if (pBinOut->fWroteHeader) 1172 { 1173 IEMBINARYFOOTER Ftr; 1174 RT_ZERO(Ftr); 1175 memcpy(Ftr.szMagic, IEMBINARYFOOTER_MAGIC, sizeof(IEMBINARYFOOTER_MAGIC)); 1176 Ftr.cbEntry = pBinOut->cbEntry; 1177 Ftr.cEntries = (uint32_t)((pBinOut->cbWritten - sizeof(IEMBINARYHEADER)) / pBinOut->cbEntry); 1178 Assert(Ftr.cEntries * pBinOut->cbEntry + sizeof(IEMBINARYHEADER) == pBinOut->cbWritten); 1179 GenerateBinaryWrite(pBinOut, &Ftr, sizeof(Ftr)); 1180 } 1181 1146 1182 /* This is rather jovial about rcWrite. */ 1147 1183 int const rc1 = RTVfsIoStrmFlush(pBinOut->hVfsUncompressed); … … 1264 1300 if (RT_SUCCESS(rc)) 1265 1301 { 1266 /* Validate the header if present and subtract if from 'off'. */ 1302 size_t const cbUncompressed = off; 1303 1304 /* Validate the header and footer if present and subtract them from 'off'. */ 1267 1305 IEMBINARYHEADER const *pHdr = NULL; 1268 1306 if ( off >= sizeof(IEMTESTENTRYINFO) … … 1270 1308 { 1271 1309 pHdr = (IEMBINARYHEADER const *)pbDecompressed; 1310 IEMBINARYFOOTER const *pFtr = (IEMBINARYFOOTER const *)&pbDecompressed[off - sizeof(IEMBINARYFOOTER)]; 1311 1312 off -= sizeof(*pHdr) + sizeof(*pFtr); 1313 rc = VERR_IO_BAD_UNIT; 1272 1314 if (pHdr->cbEntry != cbEntry) 1273 {1274 1315 RTTestIFailed("Test entry size differs for '%s': %#x (header r%u), expected %#zx (uncompressed size %#zx)", 1275 pszWhat, pHdr->cbEntry, pHdr->uSvnRev, cbEntry, off); 1276 rc = VERR_IO_BAD_UNIT; 1277 } 1278 off -= sizeof(*pHdr); 1316 pszWhat, pHdr->cbEntry, pHdr->uSvnRev, cbEntry, off + sizeof(*pHdr) + sizeof(*pFtr)); 1317 else if (memcmp(pFtr->szMagic, IEMBINARYFOOTER_MAGIC, sizeof(IEMBINARYFOOTER_MAGIC)) != 0) 1318 RTTestIFailed("Wrong footer magic for '%s': %.*Rhxs\n", pszWhat, sizeof(pFtr->szMagic), pFtr->szMagic); 1319 else if (pFtr->cbEntry != cbEntry) 1320 RTTestIFailed("Wrong footer entry size for '%s': %#x, expected %#x\n", pszWhat, pFtr->cbEntry, cbEntry); 1321 else if (pFtr->cEntries != off / cbEntry) 1322 RTTestIFailed("Wrong footer entry count for '%s': %#x, expected %#x\n", 1323 pszWhat, pFtr->cEntries, off / cbEntry); 1324 else 1325 rc = VINF_SUCCESS; 1279 1326 } 1280 1327 … … 1293 1340 */ 1294 1341 /* Reallocate the block if it's way to big. */ 1295 if (cbDecompressedAlloc - off> _512K)1342 if (cbDecompressedAlloc - cbUncompressed > _512K) 1296 1343 { 1297 void * const pvNew = RTMemRealloc(pbDecompressed, off);1344 void * const pvNew = RTMemRealloc(pbDecompressed, cbUncompressed); 1298 1345 if (pvNew) 1299 1346 { … … 1306 1353 1307 1354 /* Fill in the info and other return values. */ 1308 pInfo->cbUncompressed = (uint32_t) off;1355 pInfo->cbUncompressed = (uint32_t)cbUncompressed; 1309 1356 pInfo->pvUncompressed = pbDecompressed; 1310 1357 pInfo->pszCpuDesc = pHdr ? pHdr->szCpuDesc : NULL; … … 2739 2786 static const MULDIVU8_TEST_T g_aFixedTests_idiv_u8[] = 2740 2787 { 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...) */ 2788 /* efl in, efl out, uDstIn, uDstOut, uSrcIn, rc (0 or -1 for actual; -128 for auto) */ 2789 { UINT32_MAX, 0, 0x8000, 0, 0xc7, -1 }, /* -32768 / -57 = #DE (574.8771929824...) */ 2790 { UINT32_MAX, 0, 0x8000, 0, 0xdd, -128 }, /* -32768 / -35 = #DE (936.2285714285...) */ 2791 { UINT32_MAX, 0, 0x7f00, 0, 0x7f, -1 }, /* 0x7f00 / 0x7f = #DE (0x100) */ 2792 { UINT32_MAX, 0, 0x3f80, 0, 0x7f, -1 }, /* 0x3F80 / 0x7f = #DE (0x80) */ 2793 { UINT32_MAX, 0, 0x3f7f, 0, 0x7f, 0 }, /* 0x3F7F / 0x7f = 127.992125984... */ 2794 { UINT32_MAX, 0, 0xc000, 0, 0x80, -1 }, /* -16384 / -128 = #DE (0x80) */ 2795 { UINT32_MAX, 0, 0xc001, 0, 0x80, 0 }, /* -16383 / -128 = 127.9921875 */ 2744 2796 }; 2745 2797 #endif … … 2791 2843 Test.uSrcIn = g_aMulDivU8[iFn].paFixedTests[iTest].uSrcIn; 2792 2844 Test.rc = g_aMulDivU8[iFn].pfnNative(&Test.uDstOut, Test.uSrcIn, &Test.fEflOut); 2845 if (g_aMulDivU8[iFn].paFixedTests[iTest].rc == 0 || g_aMulDivU8[iFn].paFixedTests[iTest].rc == -1) 2846 Test.rc = g_aMulDivU8[iFn].paFixedTests[iTest].rc; 2793 2847 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); 2794 2848 } … … 2845 2899 2846 2900 #ifdef TSTIEMAIMPL_WITH_GENERATOR 2901 static const MULDIVU16_TEST_T g_aFixedTests_idiv_u16[] = 2902 { 2903 /* low high */ 2904 /* --- eflags ---, -- uDst1 --, -- uDst2 --, */ 2905 /* in, out, in , out, in , out, uSrcIn, rc (0 or -1 for actual; -128 for auto) */ 2906 { UINT32_MAX, 0, 0x0000, 0, 0x8000, 0, 0xc004, -1 }, /* -2147483648 /-16380 = #DE (131104.00781...) */ 2907 { UINT32_MAX, 0, 0xffff, 0, 0x7fff, 0, 0x7fff, -1 }, /* 2147483647 / 32767 = #DE (65538.000030...) */ 2908 { UINT32_MAX, 0, 0x8000, 0, 0x3fff, 0, 0x7fff, -1 }, /* 0x3fff8000 / 0x7fff = #DE (0x8000) */ 2909 { UINT32_MAX, 0, 0x7fff, 0, 0x3fff, 0, 0x7fff, 0 }, /* 0x3fff7fff / 0x7fff = 32767.99996948... */ 2910 { UINT32_MAX, 0, 0x0000, 0, 0xc000, 0, 0x8000, -1 }, /* -1073741824 / -32768 = #DE (0x8000) */ 2911 { UINT32_MAX, 0, 0x0001, 0, 0xc000, 0, 0x8000, 0 }, /* -1073741823 / -32768 = 32767.999969482421875 */ 2912 }; 2913 2914 static const MULDIVU32_TEST_T g_aFixedTests_idiv_u32[] = 2915 { 2916 /* low high */ 2917 /* --- eflags ---, ---- uDst1 ----, ---- uDst2 ----, */ 2918 /* in, out, in , out, in , out, uSrcIn, rc (0 or -1 for actual; -128 for auto) */ 2919 { UINT32_MAX, 0, 0x00000000, 0, 0x80000000, 0, 0xc0000004, -1 }, 2920 { UINT32_MAX, 0, 0xffffffff, 0, 0x7fffffff, 0, 0x7fffffff, -1 }, 2921 { UINT32_MAX, 0, 0x80000000, 0, 0x3fffffff, 0, 0x7fffffff, -1 }, 2922 { UINT32_MAX, 0, 0x7fffffff, 0, 0x3fffffff, 0, 0x7fffffff, 0 }, 2923 { UINT32_MAX, 0, 0x00000000, 0, 0xc0000000, 0, 0x80000000, -1 }, 2924 { UINT32_MAX, 0, 0x00000001, 0, 0xc0000000, 0, 0x80000000, 0 }, 2925 }; 2926 2927 static const MULDIVU64_TEST_T g_aFixedTests_idiv_u64[] = 2928 { 2929 /* low high */ 2930 /* --- eflags ---, -------- uDst1 --------, -------- uDst2 --------, */ 2931 /* in, out, in , out, in , out, uSrcIn, rc (0 or -1 for actual; -128 for auto) */ 2932 { UINT32_MAX, 0, 0x0000000000000000, 0, 0x8000000000000000, 0, 0xc000000000000004, -1 }, 2933 { UINT32_MAX, 0, 0xffffffffffffffff, 0, 0x7fffffffffffffff, 0, 0x7fffffffffffffff, -1 }, 2934 { UINT32_MAX, 0, 0x8000000000000000, 0, 0x3fffffffffffffff, 0, 0x7fffffffffffffff, -1 }, 2935 { UINT32_MAX, 0, 0x7fffffffffffffff, 0, 0x3fffffffffffffff, 0, 0x7fffffffffffffff, 0 }, 2936 { UINT32_MAX, 0, 0x0000000000000000, 0, 0xc000000000000000, 0, 0x8000000000000000, -1 }, 2937 { UINT32_MAX, 0, 0x0000000000000001, 0, 0xc000000000000000, 0, 0x8000000000000000, 0 }, 2938 }; 2939 2847 2940 # define GEN_MULDIV(a_cBits, a_Fmt, a_TestType, a_aSubTests) \ 2848 2941 DUMP_ALL_FN(MulDivU ## a_cBits, a_aSubTests) \ … … 2855 2948 continue; \ 2856 2949 IEMBINARYOUTPUT BinOut; \ 2950 a_TestType Test; \ 2951 RT_ZERO(Test); /* 64-bit variant contains alignment padding */ \ 2857 2952 AssertReturn(GENERATE_BINARY_OPEN(&BinOut, papszNameFmts, a_aSubTests[iFn]), RTEXITCODE_FAILURE); \ 2858 2953 for (uint32_t iTest = 0; iTest < cTests; iTest++ ) \ 2859 2954 { \ 2860 a_TestType Test; \2861 2955 Test.fEflIn = RandEFlags(); \ 2862 2956 Test.fEflOut = Test.fEflIn; \ … … 2869 2963 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); \ 2870 2964 } \ 2965 for (uint32_t iTest = 0; iTest < a_aSubTests[iFn].cFixedTests; iTest++ ) \ 2966 { \ 2967 Test.fEflIn = a_aSubTests[iFn].paFixedTests[iTest].fEflIn == UINT32_MAX ? RandEFlags() \ 2968 : a_aSubTests[iFn].paFixedTests[iTest].fEflIn; \ 2969 Test.fEflOut = Test.fEflIn; \ 2970 Test.uDst1In = a_aSubTests[iFn].paFixedTests[iTest].uDst1In; \ 2971 Test.uDst1Out = Test.uDst1In; \ 2972 Test.uDst2In = a_aSubTests[iFn].paFixedTests[iTest].uDst2In; \ 2973 Test.uDst2Out = Test.uDst2In; \ 2974 Test.uSrcIn = a_aSubTests[iFn].paFixedTests[iTest].uSrcIn; \ 2975 Test.rc = a_aSubTests[iFn].pfnNative(&Test.uDst1Out, &Test.uDst2Out, Test.uSrcIn, &Test.fEflOut); \ 2976 if (a_aSubTests[iFn].paFixedTests[iTest].rc == 0 || a_aSubTests[iFn].paFixedTests[iTest].rc == -1) \ 2977 Test.rc = a_aSubTests[iFn].paFixedTests[iTest].rc; \ 2978 GenerateBinaryWrite(&BinOut, &Test, sizeof(Test)); \ 2979 } \ 2871 2980 AssertReturn(GenerateBinaryClose(&BinOut), RTEXITCODE_FAILURE); \ 2872 2981 } \ … … 2878 2987 2879 2988 #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. */ \2882 2989 TYPEDEF_SUBTEST_TYPE(a_SubTestType, a_TestType, PFNIEMAIMPLMULDIVU ## a_cBits); \ 2883 2990 static a_SubTestType a_aSubTests [] = \ 2884 2991 { \ 2885 ENTRY_BIN_AMD_EX(mul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \2886 ENTRY_BIN_INTEL_EX(mul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \2887 ENTRY_BIN_AMD_EX(imul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \2888 ENTRY_BIN_INTEL_EX(imul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \2889 ENTRY_BIN_AMD_EX(div_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \2890 ENTRY_BIN_INTEL_EX(div_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \2891 ENTRY_BIN_ AMD_EX(idiv_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \2892 ENTRY_BIN_ INTEL_EX(idiv_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \2992 ENTRY_BIN_AMD_EX(mul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \ 2993 ENTRY_BIN_INTEL_EX(mul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \ 2994 ENTRY_BIN_AMD_EX(imul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \ 2995 ENTRY_BIN_INTEL_EX(imul_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF, 0), \ 2996 ENTRY_BIN_AMD_EX(div_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \ 2997 ENTRY_BIN_INTEL_EX(div_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \ 2998 ENTRY_BIN_FIX_AMD_EX(idiv_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \ 2999 ENTRY_BIN_FIX_INTEL_EX(idiv_u ## a_cBits, X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF | X86_EFL_OF, 0), \ 2893 3000 }; \ 2894 3001 \ … … 2919 3026 || (fEfl | fEflIgn) != (paTests[iTest].fEflOut | fEflIgn)\ 2920 3027 || rc != paTests[iTest].rc) \ 2921 RTTestFailed(g_hTest, "#%02u%s: efl=%#08x dst1=" a_Fmt " dst2=" a_Fmt " src=" a_Fmt "\n" \ 2922 " -> efl=%#08x dst1=" a_Fmt " dst2=" a_Fmt " rc=%d\n" \ 2923 "expected %#08x " a_Fmt " " a_Fmt " %d%s -%s%s%s\n", \ 2924 iTest, iVar == 0 ? "" : "/n", \ 3028 { __debugbreak(); \ 3029 RTTestFailed(g_hTest, "#%04u%s: efl=%#010x dst1=" a_Fmt " dst2=" a_Fmt " src=" a_Fmt "\n" \ 3030 " -> efl=%#010x dst1=" a_Fmt " dst2=" a_Fmt " rc=%d\n" \ 3031 " expected %#010x " a_Fmt " " a_Fmt " %d%s -%s%s%s\n", \ 3032 iTest, iVar == 0 ? " " : "/n", \ 2925 3033 paTests[iTest].fEflIn, paTests[iTest].uDst1In, paTests[iTest].uDst2In, paTests[iTest].uSrcIn, \ 2926 3034 fEfl, uDst1, uDst2, rc, \ … … 2929 3037 uDst1 != paTests[iTest].uDst1Out ? " dst1" : "", uDst2 != paTests[iTest].uDst2Out ? " dst2" : "", \ 2930 3038 (fEfl | fEflIgn) != (paTests[iTest].fEflOut | fEflIgn) ? " eflags" : ""); \ 3039 } \ 2931 3040 else \ 2932 3041 { \ … … 2945 3054 FREE_DECOMPRESSED_TESTS(a_aSubTests[iFn]); \ 2946 3055 } \ 2947 } 3056 } //1068553096 = 0x3FB0D388 (1068553096) 2948 3057 TEST_MULDIV(16, uint16_t, "%#06RX16", MULDIVU16_TEST_T, INT_MULDIV_U16_T, g_aMulDivU16) 2949 3058 TEST_MULDIV(32, uint32_t, "%#010RX32", MULDIVU32_TEST_T, INT_MULDIV_U32_T, g_aMulDivU32)
Note:
See TracChangeset
for help on using the changeset viewer.