Changeset 104765 in vbox
- Timestamp:
- May 23, 2024 10:30:25 AM (10 months ago)
- svn:sync-xref-src-repo-rev:
- 163333
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4.c32
r104764 r104765 74 74 #define BS3_FP32_INF(a_Sign) RTFLOAT32U_INIT_INF(a_Sign) 75 75 #define BS3_FP32_QNAN(a_Sign) RTFLOAT32U_INIT_QNAN(a_Sign) 76 #define BS3_FP32_QNAN_VAL(a_Sign, a_Val) RTFLOAT32U_INIT_QNAN_EX(a_Sign, a_Val) 76 77 #define BS3_FP32_SNAN(a_Sign) RTFLOAT32U_INIT_SNAN(a_Sign) 77 78 … … 103 104 #define BS3_FP64_INF(a_Sign) RTFLOAT64U_INIT_INF(a_Sign) 104 105 #define BS3_FP64_QNAN(a_Sign) RTFLOAT64U_INIT_QNAN(a_Sign) 106 #define BS3_FP64_QNAN_VAL(a_Sign, a_Val) RTFLOAT64U_INIT_QNAN_EX(a_Sign, a_Val) 105 107 #define BS3_FP64_SNAN(a_Sign) RTFLOAT64U_INIT_SNAN(a_Sign) 108 #define BS3_FP64_SNAN_VAL(a_Sign, a_Val) RTFLOAT64U_INIT_SNAN_EX(a_Sign, a_Val) 106 109 107 110 /* … … 361 364 static size_t bs3CpuInstr4GetXcptFlags(char BS3_FAR *pszBuf, size_t cchBuf, uint32_t fMxCsr) 362 365 { 366 BS3_ASSERT(cchBuf >= BS3_FP_XCPT_NAMES_MAXLEN); 363 367 if (!(fMxCsr & X86_MXCSR_XCPT_FLAGS)) 364 368 return Bs3StrPrintf(pszBuf, cchBuf, " None"); … … 642 646 643 647 /** 644 * Determin s the size of memory operands.648 * Determines the size of memory operands. 645 649 */ 646 650 DECLINLINE(uint8_t) bs3CpuInstrXMemOpSize(uint8_t cbOperand, uint8_t enmRm) … … 871 875 typedef struct BS3CPUINSTR4_TEST1_CTX_T 872 876 { 873 BS3CPUINSTR4_CONFIG_T const BS3_FAR *pConfig; 874 BS3CPUINSTR4_TEST1_T const BS3_FAR *pTest; 875 unsigned iVal; 876 const char BS3_FAR *pszMode; 877 PBS3TRAPFRAME pTrapFrame; 878 PBS3REGCTX pCtx; 879 PBS3EXTCTX pExtCtx; 880 PBS3EXTCTX pExtCtxOut; 881 uint8_t BS3_FAR *puMemOp; 882 uint8_t BS3_FAR *puMemOpAlias; 883 uint8_t cbMemOp; 884 uint8_t cbOperand; 885 uint8_t cbInstr; 886 uint8_t bXcptExpect; 887 bool fSseInstr; 888 bool fAvxInstr; 889 uint16_t idTestStep; 877 /** The test execution environment configuration. */ 878 BS3CPUINSTR4_CONFIG_T const BS3_FAR *pConfig; 879 /** The instruction being tested. */ 880 BS3CPUINSTR4_TEST1_T const BS3_FAR *pTest; 881 /** Which iteration of the test value is this. */ 882 unsigned iVal; 883 /** The testing mode (e.g. real, protected, paged and permutations). */ 884 const char BS3_FAR *pszMode; 885 /** The exception (trap) frame. */ 886 PBS3TRAPFRAME pTrapFrame; 887 /** The general-purpose register context. */ 888 PBS3REGCTX pCtx; 889 /** The extended (FPU) register context. */ 890 PBS3EXTCTX pExtCtx; 891 /** The output extended (FPU) register context. */ 892 PBS3EXTCTX pExtCtxOut; 893 /** The memory operand buffer. */ 894 uint8_t BS3_FAR *puMemOp; 895 /** The memory operand alias buffer for comparing result. */ 896 uint8_t BS3_FAR *puMemOpAlias; 897 /** Size of the memory operand (and alias) buffer in bytes. */ 898 uint8_t cbMemOp; 899 /** Size of the operand for the instruction (e.g., 8 for MMX, 16 for SSE etc. */ 900 uint8_t cbOperand; 901 /** Size of the instruction opcode. */ 902 uint8_t cbInstr; 903 /** The expected exception while/after executing the instruction. */ 904 uint8_t bXcptExpect; 905 /** Whether this is an SSE instruction. */ 906 bool fSseInstr; 907 /** Whether this is an AVX instruction. */ 908 bool fAvxInstr; 909 /** The test iteration step. */ 910 uint16_t idTestStep; 890 911 } BS3CPUINSTR4_TEST1_CTX_T; 891 912 /** Pointer to a test 1 context. */ … … 1301 1322 static BS3CPUINSTR4_TEST1_VALUES_PD_T const s_aValues[] = 1302 1323 { 1324 /* 1325 * Zero. 1326 */ 1303 1327 /* 0*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1304 1328 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, … … 1311 1335 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1312 1336 /*mask */ ~X86_MXCSR_XCPT_MASK, 1313 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,1337 /*daz,fz,rc*/ 0, 1, X86_MXCSR_RC_NEAREST, 1314 1338 /*flags */ 0 }, 1315 /* 2*/{ { /*src2 */ { BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1339 /* 2*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1340 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1341 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1342 /*mask */ X86_MXCSR_XCPT_MASK, 1343 /*daz,fz,rc*/ 1, 0, X86_MXCSR_RC_DOWN, 1344 /*flags */ 0 }, 1345 /* 3*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1346 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1347 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1348 /*mask */ ~X86_MXCSR_XCPT_MASK, 1349 /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_UP, 1350 /*flags */ 0 }, 1351 /* 4*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1352 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1353 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1354 /*mask */ X86_MXCSR_XCPT_MASK, 1355 /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO, 1356 /*flags */ 0 }, 1357 /* 1358 * Infinity. 1359 */ 1360 /* 5*/{ { /*src2 */ { BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1316 1361 { /*src1 */ { BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1317 1362 { /* => */ { BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, … … 1319 1364 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1320 1365 /*flags */ X86_MXCSR_IE }, 1321 /* 3*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1322 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1323 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_QNAN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1324 /*mask */ X86_MXCSR_IM, 1366 /* 6*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1367 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1368 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1369 /*mask */ ~X86_MXCSR_IM, 1370 /*daz,fz,rc*/ 0, 1, X86_MXCSR_RC_DOWN, 1371 /*flags */ X86_MXCSR_IE }, 1372 /* 7*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1373 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1374 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1375 /*mask */ ~X86_MXCSR_IM, 1376 /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_UP, 1377 /*flags */ X86_MXCSR_IE }, 1378 /* 8*/{ { /*src2 */ { BS3_FP64_INF(0), BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1379 { /*src1 */ { BS3_FP64_INF(1), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1380 { /* => */ { BS3_FP64_QNAN(1), BS3_FP64_QNAN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1381 /*mask */ X86_MXCSR_XCPT_MASK, 1382 /*daz,fz,rc*/ 1, 0, X86_MXCSR_RC_ZERO, 1383 /*flags */ X86_MXCSR_IE }, 1384 /* 1385 * Overflow. 1386 */ 1387 /* 9*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1388 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1389 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1390 /*mask */ ~X86_MXCSR_XCPT_MASK, 1325 1391 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1326 /*flags */ X86_MXCSR_IE }, 1327 /* 4*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_VAL_1(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1392 /*flags */ X86_MXCSR_OE }, 1393 /*10*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1394 { /*src1 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1395 { /* => */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1396 /*mask */ ~X86_MXCSR_XCPT_MASK, 1397 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1398 /*flags */ X86_MXCSR_OE }, 1399 /*11*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1400 { /*src1 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1401 { /* => */ { BS3_FP64_INF(0), BS3_FP64_VAL(1, 0, 2), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1402 /*mask */ X86_MXCSR_OM | X86_MXCSR_PM, 1403 /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_NEAREST, 1404 /*flags */ X86_MXCSR_OE | X86_MXCSR_PE }, 1405 /*12*/{ { /*src2 */ { BS3_FP64_NORMAL_MIN(1), BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1406 { /*src1 */ { BS3_FP64_NORMAL_MIN(1), BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1407 { /* => */ { BS3_FP64_VAL(1, 0, 2), BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1408 /*mask */ X86_MXCSR_OM | X86_MXCSR_PM, 1409 /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO, 1410 /*flags */ X86_MXCSR_OE | X86_MXCSR_PE }, 1411 /*13*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1412 { /*src1 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1413 { /* => */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1414 /*mask */ X86_MXCSR_XCPT_MASK, 1415 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_ZERO, 1416 /*flags */ X86_MXCSR_OE | X86_MXCSR_PE }, 1417 /* 1418 * Normals. 1419 */ 1420 /*14*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_VAL_1(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1328 1421 { /*src1 */ { BS3_FP64_NORMAL_MAX(1), BS3_FP64_NORMAL_VAL_1(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1329 1422 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, … … 1331 1424 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1332 1425 /*flags */ 0 }, 1333 /* 5*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1334 { /*src1 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1335 { /* => */ { BS3_FP64_INF(0), BS3_FP64_VAL(1, 0, 2), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1336 /*mask */ X86_MXCSR_OM | X86_MXCSR_PM, 1337 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1338 /*flags */ X86_MXCSR_OE | X86_MXCSR_PE }, 1339 /* 6*/{ { /*src2 */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1340 { /*src1 */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1341 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1342 /*mask */ ~X86_MXCSR_XCPT_MASK, 1343 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1344 /*flags */ X86_MXCSR_OE }, 1345 /* 7*/{ { /*src2 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1346 { /*src1 */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1347 { /* => */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1348 /*mask */ X86_MXCSR_XCPT_MASK, 1349 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_ZERO, 1350 /*flags */ X86_MXCSR_OE | X86_MXCSR_PE }, 1351 /* 8*/{ { /*src2 */ { BS3_FP64_VAL(0, 0, 0x409)/*1024*/, BS3_FP64_VAL(0, 0xb800000000000, 0x404)/*55*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1426 /*15*/{ { /*src2 */ { BS3_FP64_VAL(0, 0, 0x409)/*1024*/, BS3_FP64_VAL(0, 0xb800000000000, 0x404)/*55*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1352 1427 { /*src1 */ { BS3_FP64_VAL(0, 0, 0x408)/* 512*/, BS3_FP64_VAL(0, 0xc000000000000, 0x401)/* 7*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1353 1428 { /* => */ { BS3_FP64_VAL(0, 0x8000000000000, 0x409)/*1536*/, BS3_FP64_VAL(0, 0xf000000000000, 0x404)/*62*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, … … 1355 1430 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1356 1431 /*flags */ 0 }, 1357 /* 9*/{ { /*src2 */ { BS3_FP64_VAL(0, 0x26580b4800000, 0x41d)/* 1234567890*/, BS3_FP64_VAL(0, 0xd6f3458800000, 0x41c)/*987654321*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },1432 /*16*/{ { /*src2 */ { BS3_FP64_VAL(0, 0x26580b4800000, 0x41d)/* 1234567890*/, BS3_FP64_VAL(0, 0xd6f3458800000, 0x41c)/*987654321*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1358 1433 { /*src1 */ { BS3_FP64_VAL(1, 0x26580b4800000, 0x41d)/*-1234567890*/, BS3_FP64_VAL(1, 0x9000000000000, 0x405)/* -100*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } }, 1359 1434 { /* => */ { BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0xd6f3426800000, 0x41c)/*987654221*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
Note:
See TracChangeset
for help on using the changeset viewer.