Changeset 96797 in vbox
- Timestamp:
- Sep 19, 2022 7:10:20 PM (2 years ago)
- Location:
- trunk/src/VBox/VMM/testcase
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/Makefile.kmk
r96790 r96797 304 304 tstIEMAImplDataSseCompare-cmpss_u128.bin \ 305 305 tstIEMAImplDataSseCompare-cmppd_u128.bin \ 306 tstIEMAImplDataSseCompare-cmpsd_u128.bin 306 tstIEMAImplDataSseCompare-cmpsd_u128.bin \ 307 tstIEMAImplDataSseConvert-cvtdq2ps_u128.bin \ 308 tstIEMAImplDataSseConvert-cvtps2dq_u128.bin \ 309 tstIEMAImplDataSseConvert-cvttps2dq_u128.bin \ 310 tstIEMAImplDataSseConvert-cvtdq2pd_u128.bin \ 311 tstIEMAImplDataSseConvert-cvtpd2dq_u128.bin \ 312 tstIEMAImplDataSseConvert-cvttpd2dq_u128.bin 307 313 308 314 tstIEMAImpl_TEMPLATE = VBOXR3TSTEXE -
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r96790 r96797 7367 7367 7368 7368 7369 /* 7370 * Convert SSE operations converting signed double-words to single-precision floating point values. 7371 */ 7372 TYPEDEF_SUBTEST_TYPE(SSE_CONVERT_XMM_T, SSE_CONVERT_XMM_TEST_T, PFNIEMAIMPLFPSSEF2U128); 7373 7374 static const SSE_CONVERT_XMM_T g_aSseConvertXmmI32R32[] = 7375 { 7376 ENTRY_BIN(cvtdq2ps_u128) 7377 }; 7378 7379 #ifdef TSTIEMAIMPL_WITH_GENERATOR 7380 static RTEXITCODE SseConvertXmmI32R32Generate(const char *pszDataFileFmt, uint32_t cTests) 7381 { 7382 cTests = RT_MAX(192, cTests); /* there are 144 standard input variations */ 7383 7384 static int32_t const s_aSpecials[] = 7385 { 7386 INT32_MIN, 7387 INT32_MIN / 2, 7388 0, 7389 INT32_MAX / 2, 7390 INT32_MAX, 7391 (int32_t)0x80000000 7392 /** @todo More specials. */ 7393 }; 7394 7395 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmI32R32); iFn++) 7396 { 7397 PFNIEMAIMPLFPSSEF2U128 const pfn = g_aSseConvertXmmI32R32[iFn].pfnNative ? g_aSseConvertXmmI32R32[iFn].pfnNative : g_aSseConvertXmmI32R32[iFn].pfn; 7398 7399 PRTSTREAM pStrmOut = NULL; 7400 int rc = RTStrmOpenF("wb", &pStrmOut, pszDataFileFmt, g_aSseConvertXmmI32R32[iFn].pszName); 7401 if (RT_FAILURE(rc)) 7402 { 7403 RTMsgError("Failed to open data file for %s for writing: %Rrc", g_aSseConvertXmmI32R32[iFn].pszName, rc); 7404 return RTEXITCODE_FAILURE; 7405 } 7406 7407 X86FXSTATE State; 7408 RT_ZERO(State); 7409 for (uint32_t iTest = 0; iTest < cTests + RT_ELEMENTS(s_aSpecials); iTest += 1) 7410 { 7411 SSE_CONVERT_XMM_TEST_T TestData; RT_ZERO(TestData); 7412 7413 TestData.InVal.ai32[0] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7414 TestData.InVal.ai32[1] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7415 TestData.InVal.ai32[2] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7416 TestData.InVal.ai32[3] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7417 7418 uint32_t const fMxcsr = RandMxcsr() & X86_MXCSR_XCPT_FLAGS; 7419 for (uint16_t iRounding = 0; iRounding < 4; iRounding++) 7420 for (uint8_t iDaz = 0; iDaz < 2; iDaz++) 7421 for (uint8_t iFz = 0; iFz < 2; iFz++) 7422 { 7423 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 7424 | (iRounding << X86_MXCSR_RC_SHIFT) 7425 | (iDaz ? X86_MXCSR_DAZ : 0) 7426 | (iFz ? X86_MXCSR_FZ : 0) 7427 | X86_MXCSR_XCPT_MASK; 7428 IEMSSERESULT ResM; RT_ZERO(ResM); 7429 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 7430 TestData.fMxcsrIn = State.MXCSR; 7431 TestData.fMxcsrOut = ResM.MXCSR; 7432 TestData.OutVal = ResM.uResult; 7433 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7434 7435 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 7436 IEMSSERESULT ResU; RT_ZERO(ResU); 7437 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 7438 TestData.fMxcsrIn = State.MXCSR; 7439 TestData.fMxcsrOut = ResU.MXCSR; 7440 TestData.OutVal = ResU.uResult; 7441 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7442 7443 uint16_t fXcpt = (ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS; 7444 if (fXcpt) 7445 { 7446 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7447 IEMSSERESULT Res1; RT_ZERO(Res1); 7448 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 7449 TestData.fMxcsrIn = State.MXCSR; 7450 TestData.fMxcsrOut = Res1.MXCSR; 7451 TestData.OutVal = Res1.uResult; 7452 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7453 7454 if (((Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR & X86_MXCSR_XCPT_FLAGS)) 7455 { 7456 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 7457 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7458 IEMSSERESULT Res2; RT_ZERO(Res2); 7459 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 7460 TestData.fMxcsrIn = State.MXCSR; 7461 TestData.fMxcsrOut = Res2.MXCSR; 7462 TestData.OutVal = Res2.uResult; 7463 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7464 } 7465 if (!RT_IS_POWER_OF_TWO(fXcpt)) 7466 for (uint16_t fUnmasked = 1; fUnmasked <= X86_MXCSR_PE; fUnmasked <<= 1) 7467 if (fUnmasked & fXcpt) 7468 { 7469 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7470 IEMSSERESULT Res3; RT_ZERO(Res3); 7471 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 7472 TestData.fMxcsrIn = State.MXCSR; 7473 TestData.fMxcsrOut = Res3.MXCSR; 7474 TestData.OutVal = Res3.uResult; 7475 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7476 } 7477 } 7478 } 7479 } 7480 rc = RTStrmClose(pStrmOut); 7481 if (RT_FAILURE(rc)) 7482 { 7483 RTMsgError("Failed to close data file for %s: %Rrc", g_aSseConvertXmmI32R32[iFn].pszName, rc); 7484 return RTEXITCODE_FAILURE; 7485 } 7486 } 7487 7488 return RTEXITCODE_SUCCESS; 7489 } 7490 #endif 7491 7492 static void SseConvertXmmI32R32Test(void) 7493 { 7494 X86FXSTATE State; 7495 RT_ZERO(State); 7496 7497 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmI32R32); iFn++) 7498 { 7499 if (!SubTestAndCheckIfEnabled(g_aSseConvertXmmI32R32[iFn].pszName)) 7500 continue; 7501 7502 uint32_t const cTests = *g_aSseConvertXmmI32R32[iFn].pcTests; 7503 SSE_CONVERT_XMM_TEST_T const * const paTests = g_aSseConvertXmmI32R32[iFn].paTests; 7504 PFNIEMAIMPLFPSSEF2U128 pfn = g_aSseConvertXmmI32R32[iFn].pfn; 7505 uint32_t const cVars = COUNT_VARIATIONS(g_aSseConvertXmmI32R32[iFn]); 7506 if (!cTests) RTTestSkipped(g_hTest, "no tests"); 7507 for (uint32_t iVar = 0; iVar < cVars; iVar++) 7508 { 7509 for (uint32_t iTest = 0; iTest < cTests / sizeof(*paTests); iTest++) 7510 { 7511 IEMSSERESULT Res; RT_ZERO(Res); 7512 7513 State.MXCSR = paTests[iTest].fMxcsrIn; 7514 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 7515 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 7516 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[0], &paTests[iTest].OutVal.ar32[0]) 7517 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[1], &paTests[iTest].OutVal.ar32[1]) 7518 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[2], &paTests[iTest].OutVal.ar32[2]) 7519 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[3], &paTests[iTest].OutVal.ar32[3])) 7520 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%RI32'%RI32'%RI32'%RI32 \n" 7521 "%s -> mxcsr=%#08x %s'%s'%s'%s\n" 7522 "%s expected %#08x %s'%s'%s'%s%s%s (%s)\n", 7523 iTest, iVar ? "/n" : "", paTests[iTest].fMxcsrIn, 7524 paTests[iTest].InVal.ai32[0], paTests[iTest].InVal.ai32[1], 7525 paTests[iTest].InVal.ai32[2], paTests[iTest].InVal.ai32[3], 7526 iVar ? " " : "", Res.MXCSR, 7527 FormatR32(&Res.uResult.ar32[0]), FormatR32(&Res.uResult.ar32[1]), 7528 FormatR32(&Res.uResult.ar32[2]), FormatR32(&Res.uResult.ar32[3]), 7529 iVar ? " " : "", paTests[iTest].fMxcsrOut, 7530 FormatR32(&paTests[iTest].OutVal.ar32[0]), FormatR32(&paTests[iTest].OutVal.ar32[1]), 7531 FormatR32(&paTests[iTest].OutVal.ar32[2]), FormatR32(&paTests[iTest].OutVal.ar32[3]), 7532 MxcsrDiff(Res.MXCSR, paTests[iTest].fMxcsrOut), 7533 ( !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[0], &paTests[iTest].OutVal.ar32[0]) 7534 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[1], &paTests[iTest].OutVal.ar32[1]) 7535 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[2], &paTests[iTest].OutVal.ar32[2]) 7536 || !RTFLOAT32U_ARE_IDENTICAL(&Res.uResult.ar32[3], &paTests[iTest].OutVal.ar32[3])) 7537 ? " - val" : "", 7538 FormatMxcsr(paTests[iTest].fMxcsrIn)); 7539 } 7540 } 7541 } 7542 } 7543 7544 7545 /* 7546 * Convert SSE operations converting signed double-words to single-precision floating point values. 7547 */ 7548 static const SSE_CONVERT_XMM_T g_aSseConvertXmmR32I32[] = 7549 { 7550 ENTRY_BIN(cvtps2dq_u128), 7551 ENTRY_BIN(cvttps2dq_u128) 7552 }; 7553 7554 #ifdef TSTIEMAIMPL_WITH_GENERATOR 7555 static RTEXITCODE SseConvertXmmR32I32Generate(const char *pszDataFileFmt, uint32_t cTests) 7556 { 7557 cTests = RT_MAX(192, cTests); /* there are 144 standard input variations */ 7558 7559 static struct { RTFLOAT32U aVal1[4]; } const s_aSpecials[] = 7560 { 7561 { { RTFLOAT32U_INIT_ZERO(0), RTFLOAT32U_INIT_ZERO(0), RTFLOAT32U_INIT_ZERO(0), RTFLOAT32U_INIT_ZERO(0) } }, 7562 { { RTFLOAT32U_INIT_ZERO(1), RTFLOAT32U_INIT_ZERO(1), RTFLOAT32U_INIT_ZERO(1), RTFLOAT32U_INIT_ZERO(1) } }, 7563 { { RTFLOAT32U_INIT_INF(0), RTFLOAT32U_INIT_INF(0), RTFLOAT32U_INIT_INF(0), RTFLOAT32U_INIT_INF(0) } }, 7564 { { RTFLOAT32U_INIT_INF(1), RTFLOAT32U_INIT_INF(1), RTFLOAT32U_INIT_INF(1), RTFLOAT32U_INIT_INF(1) } } 7565 /** @todo More specials. */ 7566 }; 7567 7568 X86FXSTATE State; 7569 RT_ZERO(State); 7570 uint32_t cMinNormalPairs = (cTests - 144) / 4; 7571 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR32I32); iFn++) 7572 { 7573 PFNIEMAIMPLFPSSEF2U128 const pfn = g_aSseConvertXmmR32I32[iFn].pfnNative ? g_aSseConvertXmmR32I32[iFn].pfnNative : g_aSseConvertXmmR32I32[iFn].pfn; 7574 7575 PRTSTREAM pStrmOut = NULL; 7576 int rc = RTStrmOpenF("wb", &pStrmOut, pszDataFileFmt, g_aSseConvertXmmR32I32[iFn].pszName); 7577 if (RT_FAILURE(rc)) 7578 { 7579 RTMsgError("Failed to open data file for %s for writing: %Rrc", g_aSseConvertXmmR32I32[iFn].pszName, rc); 7580 return RTEXITCODE_FAILURE; 7581 } 7582 7583 uint32_t cNormalInputPairs = 0; 7584 for (uint32_t iTest = 0; iTest < cTests + RT_ELEMENTS(s_aSpecials); iTest += 1) 7585 { 7586 SSE_CONVERT_XMM_TEST_T TestData; RT_ZERO(TestData); 7587 7588 TestData.InVal.ar32[0] = iTest < cTests ? RandR32Src(iTest) : s_aSpecials[iTest - cTests].aVal1[0]; 7589 TestData.InVal.ar32[1] = iTest < cTests ? RandR32Src(iTest) : s_aSpecials[iTest - cTests].aVal1[1]; 7590 TestData.InVal.ar32[2] = iTest < cTests ? RandR32Src(iTest) : s_aSpecials[iTest - cTests].aVal1[2]; 7591 TestData.InVal.ar32[3] = iTest < cTests ? RandR32Src(iTest) : s_aSpecials[iTest - cTests].aVal1[3]; 7592 7593 if ( RTFLOAT32U_IS_NORMAL(&TestData.InVal.ar32[0]) 7594 && RTFLOAT32U_IS_NORMAL(&TestData.InVal.ar32[1]) 7595 && RTFLOAT32U_IS_NORMAL(&TestData.InVal.ar32[2]) 7596 && RTFLOAT32U_IS_NORMAL(&TestData.InVal.ar32[3])) 7597 cNormalInputPairs++; 7598 else if (cNormalInputPairs < cMinNormalPairs && iTest + cMinNormalPairs >= cTests && iTest < cTests) 7599 { 7600 iTest -= 1; 7601 continue; 7602 } 7603 7604 uint32_t const fMxcsr = RandMxcsr() & X86_MXCSR_XCPT_FLAGS; 7605 for (uint16_t iRounding = 0; iRounding < 4; iRounding++) 7606 for (uint8_t iDaz = 0; iDaz < 2; iDaz++) 7607 for (uint8_t iFz = 0; iFz < 2; iFz++) 7608 { 7609 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 7610 | (iRounding << X86_MXCSR_RC_SHIFT) 7611 | (iDaz ? X86_MXCSR_DAZ : 0) 7612 | (iFz ? X86_MXCSR_FZ : 0) 7613 | X86_MXCSR_XCPT_MASK; 7614 IEMSSERESULT ResM; RT_ZERO(ResM); 7615 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 7616 TestData.fMxcsrIn = State.MXCSR; 7617 TestData.fMxcsrOut = ResM.MXCSR; 7618 TestData.OutVal = ResM.uResult; 7619 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7620 7621 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 7622 IEMSSERESULT ResU; RT_ZERO(ResU); 7623 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 7624 TestData.fMxcsrIn = State.MXCSR; 7625 TestData.fMxcsrOut = ResU.MXCSR; 7626 TestData.OutVal = ResU.uResult; 7627 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7628 7629 uint16_t fXcpt = (ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS; 7630 if (fXcpt) 7631 { 7632 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7633 IEMSSERESULT Res1; RT_ZERO(Res1); 7634 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 7635 TestData.fMxcsrIn = State.MXCSR; 7636 TestData.fMxcsrOut = Res1.MXCSR; 7637 TestData.OutVal = Res1.uResult; 7638 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7639 7640 if (((Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR & X86_MXCSR_XCPT_FLAGS)) 7641 { 7642 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 7643 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7644 IEMSSERESULT Res2; RT_ZERO(Res2); 7645 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 7646 TestData.fMxcsrIn = State.MXCSR; 7647 TestData.fMxcsrOut = Res2.MXCSR; 7648 TestData.OutVal = Res2.uResult; 7649 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7650 } 7651 if (!RT_IS_POWER_OF_TWO(fXcpt)) 7652 for (uint16_t fUnmasked = 1; fUnmasked <= X86_MXCSR_PE; fUnmasked <<= 1) 7653 if (fUnmasked & fXcpt) 7654 { 7655 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7656 IEMSSERESULT Res3; RT_ZERO(Res3); 7657 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 7658 TestData.fMxcsrIn = State.MXCSR; 7659 TestData.fMxcsrOut = Res3.MXCSR; 7660 TestData.OutVal = Res3.uResult; 7661 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7662 } 7663 } 7664 } 7665 } 7666 rc = RTStrmClose(pStrmOut); 7667 if (RT_FAILURE(rc)) 7668 { 7669 RTMsgError("Failed to close data file for %s: %Rrc", g_aSseConvertXmmR32I32[iFn].pszName, rc); 7670 return RTEXITCODE_FAILURE; 7671 } 7672 } 7673 7674 return RTEXITCODE_SUCCESS; 7675 } 7676 #endif 7677 7678 static void SseConvertXmmR32I32Test(void) 7679 { 7680 X86FXSTATE State; 7681 RT_ZERO(State); 7682 7683 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR32I32); iFn++) 7684 { 7685 if (!SubTestAndCheckIfEnabled(g_aSseConvertXmmR32I32[iFn].pszName)) 7686 continue; 7687 7688 uint32_t const cTests = *g_aSseConvertXmmR32I32[iFn].pcTests; 7689 SSE_CONVERT_XMM_TEST_T const * const paTests = g_aSseConvertXmmR32I32[iFn].paTests; 7690 PFNIEMAIMPLFPSSEF2U128 pfn = g_aSseConvertXmmR32I32[iFn].pfn; 7691 uint32_t const cVars = COUNT_VARIATIONS(g_aSseConvertXmmR32I32[iFn]); 7692 if (!cTests) RTTestSkipped(g_hTest, "no tests"); 7693 for (uint32_t iVar = 0; iVar < cVars; iVar++) 7694 { 7695 for (uint32_t iTest = 0; iTest < cTests / sizeof(*paTests); iTest++) 7696 { 7697 IEMSSERESULT Res; RT_ZERO(Res); 7698 7699 State.MXCSR = paTests[iTest].fMxcsrIn; 7700 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 7701 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 7702 || Res.uResult.ai32[0] != paTests[iTest].OutVal.ai32[0] 7703 || Res.uResult.ai32[1] != paTests[iTest].OutVal.ai32[1] 7704 || Res.uResult.ai32[2] != paTests[iTest].OutVal.ai32[2] 7705 || Res.uResult.ai32[3] != paTests[iTest].OutVal.ai32[3]) 7706 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s'%s'%s \n" 7707 "%s -> mxcsr=%#08x %RI32'%RI32'%RI32'%RI32\n" 7708 "%s expected %#08x %RI32'%RI32'%RI32'%RI32%s%s (%s)\n", 7709 iTest, iVar ? "/n" : "", paTests[iTest].fMxcsrIn, 7710 FormatR32(&paTests[iTest].InVal.ar32[0]), FormatR32(&paTests[iTest].InVal.ar32[1]), 7711 FormatR32(&paTests[iTest].InVal.ar32[2]), FormatR32(&paTests[iTest].InVal.ar32[3]), 7712 iVar ? " " : "", Res.MXCSR, 7713 Res.uResult.ai32[0], Res.uResult.ai32[1], 7714 Res.uResult.ai32[2], Res.uResult.ai32[3], 7715 iVar ? " " : "", paTests[iTest].fMxcsrOut, 7716 paTests[iTest].OutVal.ai32[0], paTests[iTest].OutVal.ai32[1], 7717 paTests[iTest].OutVal.ai32[2], paTests[iTest].OutVal.ai32[3], 7718 MxcsrDiff(Res.MXCSR, paTests[iTest].fMxcsrOut), 7719 ( Res.uResult.ai32[0] != paTests[iTest].OutVal.ai32[0] 7720 || Res.uResult.ai32[1] != paTests[iTest].OutVal.ai32[1] 7721 || Res.uResult.ai32[2] != paTests[iTest].OutVal.ai32[2] 7722 || Res.uResult.ai32[3] != paTests[iTest].OutVal.ai32[3]) 7723 ? " - val" : "", 7724 FormatMxcsr(paTests[iTest].fMxcsrIn)); 7725 } 7726 } 7727 } 7728 } 7729 7730 7731 /* 7732 * Convert SSE operations converting signed double-words to double-precision floating point values. 7733 */ 7734 static const SSE_CONVERT_XMM_T g_aSseConvertXmmI32R64[] = 7735 { 7736 ENTRY_BIN(cvtdq2pd_u128) 7737 }; 7738 7739 #ifdef TSTIEMAIMPL_WITH_GENERATOR 7740 static RTEXITCODE SseConvertXmmI32R64Generate(const char *pszDataFileFmt, uint32_t cTests) 7741 { 7742 cTests = RT_MAX(192, cTests); /* there are 144 standard input variations */ 7743 7744 static int32_t const s_aSpecials[] = 7745 { 7746 INT32_MIN, 7747 INT32_MIN / 2, 7748 0, 7749 INT32_MAX / 2, 7750 INT32_MAX, 7751 (int32_t)0x80000000 7752 /** @todo More specials. */ 7753 }; 7754 7755 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmI32R64); iFn++) 7756 { 7757 PFNIEMAIMPLFPSSEF2U128 const pfn = g_aSseConvertXmmI32R64[iFn].pfnNative ? g_aSseConvertXmmI32R64[iFn].pfnNative : g_aSseConvertXmmI32R64[iFn].pfn; 7758 7759 PRTSTREAM pStrmOut = NULL; 7760 int rc = RTStrmOpenF("wb", &pStrmOut, pszDataFileFmt, g_aSseConvertXmmI32R64[iFn].pszName); 7761 if (RT_FAILURE(rc)) 7762 { 7763 RTMsgError("Failed to open data file for %s for writing: %Rrc", g_aSseConvertXmmI32R64[iFn].pszName, rc); 7764 return RTEXITCODE_FAILURE; 7765 } 7766 7767 X86FXSTATE State; 7768 RT_ZERO(State); 7769 for (uint32_t iTest = 0; iTest < cTests + RT_ELEMENTS(s_aSpecials); iTest += 1) 7770 { 7771 SSE_CONVERT_XMM_TEST_T TestData; RT_ZERO(TestData); 7772 7773 TestData.InVal.ai32[0] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7774 TestData.InVal.ai32[1] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7775 TestData.InVal.ai32[2] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7776 TestData.InVal.ai32[3] = iTest < cTests ? RandI32Src2(iTest) : s_aSpecials[iTest - cTests]; 7777 7778 uint32_t const fMxcsr = RandMxcsr() & X86_MXCSR_XCPT_FLAGS; 7779 for (uint16_t iRounding = 0; iRounding < 4; iRounding++) 7780 for (uint8_t iDaz = 0; iDaz < 2; iDaz++) 7781 for (uint8_t iFz = 0; iFz < 2; iFz++) 7782 { 7783 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 7784 | (iRounding << X86_MXCSR_RC_SHIFT) 7785 | (iDaz ? X86_MXCSR_DAZ : 0) 7786 | (iFz ? X86_MXCSR_FZ : 0) 7787 | X86_MXCSR_XCPT_MASK; 7788 IEMSSERESULT ResM; RT_ZERO(ResM); 7789 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 7790 TestData.fMxcsrIn = State.MXCSR; 7791 TestData.fMxcsrOut = ResM.MXCSR; 7792 TestData.OutVal = ResM.uResult; 7793 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7794 7795 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 7796 IEMSSERESULT ResU; RT_ZERO(ResU); 7797 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 7798 TestData.fMxcsrIn = State.MXCSR; 7799 TestData.fMxcsrOut = ResU.MXCSR; 7800 TestData.OutVal = ResU.uResult; 7801 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7802 7803 uint16_t fXcpt = (ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS; 7804 if (fXcpt) 7805 { 7806 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7807 IEMSSERESULT Res1; RT_ZERO(Res1); 7808 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 7809 TestData.fMxcsrIn = State.MXCSR; 7810 TestData.fMxcsrOut = Res1.MXCSR; 7811 TestData.OutVal = Res1.uResult; 7812 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7813 7814 if (((Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR & X86_MXCSR_XCPT_FLAGS)) 7815 { 7816 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 7817 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7818 IEMSSERESULT Res2; RT_ZERO(Res2); 7819 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 7820 TestData.fMxcsrIn = State.MXCSR; 7821 TestData.fMxcsrOut = Res2.MXCSR; 7822 TestData.OutVal = Res2.uResult; 7823 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7824 } 7825 if (!RT_IS_POWER_OF_TWO(fXcpt)) 7826 for (uint16_t fUnmasked = 1; fUnmasked <= X86_MXCSR_PE; fUnmasked <<= 1) 7827 if (fUnmasked & fXcpt) 7828 { 7829 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 7830 IEMSSERESULT Res3; RT_ZERO(Res3); 7831 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 7832 TestData.fMxcsrIn = State.MXCSR; 7833 TestData.fMxcsrOut = Res3.MXCSR; 7834 TestData.OutVal = Res3.uResult; 7835 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7836 } 7837 } 7838 } 7839 } 7840 rc = RTStrmClose(pStrmOut); 7841 if (RT_FAILURE(rc)) 7842 { 7843 RTMsgError("Failed to close data file for %s: %Rrc", g_aSseConvertXmmI32R64[iFn].pszName, rc); 7844 return RTEXITCODE_FAILURE; 7845 } 7846 } 7847 7848 return RTEXITCODE_SUCCESS; 7849 } 7850 #endif 7851 7852 static void SseConvertXmmI32R64Test(void) 7853 { 7854 X86FXSTATE State; 7855 RT_ZERO(State); 7856 7857 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmI32R64); iFn++) 7858 { 7859 if (!SubTestAndCheckIfEnabled(g_aSseConvertXmmI32R64[iFn].pszName)) 7860 continue; 7861 7862 uint32_t const cTests = *g_aSseConvertXmmI32R64[iFn].pcTests; 7863 SSE_CONVERT_XMM_TEST_T const * const paTests = g_aSseConvertXmmI32R64[iFn].paTests; 7864 PFNIEMAIMPLFPSSEF2U128 pfn = g_aSseConvertXmmI32R64[iFn].pfn; 7865 uint32_t const cVars = COUNT_VARIATIONS(g_aSseConvertXmmI32R64[iFn]); 7866 if (!cTests) RTTestSkipped(g_hTest, "no tests"); 7867 for (uint32_t iVar = 0; iVar < cVars; iVar++) 7868 { 7869 for (uint32_t iTest = 0; iTest < cTests / sizeof(*paTests); iTest++) 7870 { 7871 IEMSSERESULT Res; RT_ZERO(Res); 7872 7873 State.MXCSR = paTests[iTest].fMxcsrIn; 7874 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 7875 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 7876 || !RTFLOAT64U_ARE_IDENTICAL(&Res.uResult.ar64[0], &paTests[iTest].OutVal.ar64[0]) 7877 || !RTFLOAT64U_ARE_IDENTICAL(&Res.uResult.ar64[1], &paTests[iTest].OutVal.ar64[1])) 7878 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%RI32'%RI32'%RI32'%RI32 \n" 7879 "%s -> mxcsr=%#08x %s'%s\n" 7880 "%s expected %#08x %s'%s%s%s (%s)\n", 7881 iTest, iVar ? "/n" : "", paTests[iTest].fMxcsrIn, 7882 paTests[iTest].InVal.ai32[0], paTests[iTest].InVal.ai32[1], 7883 paTests[iTest].InVal.ai32[2], paTests[iTest].InVal.ai32[3], 7884 iVar ? " " : "", Res.MXCSR, 7885 FormatR64(&Res.uResult.ar64[0]), FormatR64(&Res.uResult.ar64[1]), 7886 iVar ? " " : "", paTests[iTest].fMxcsrOut, 7887 FormatR64(&paTests[iTest].OutVal.ar64[0]), FormatR64(&paTests[iTest].OutVal.ar64[1]), 7888 MxcsrDiff(Res.MXCSR, paTests[iTest].fMxcsrOut), 7889 ( !RTFLOAT64U_ARE_IDENTICAL(&Res.uResult.ar64[0], &paTests[iTest].OutVal.ar64[0]) 7890 || !RTFLOAT64U_ARE_IDENTICAL(&Res.uResult.ar64[1], &paTests[iTest].OutVal.ar64[1])) 7891 ? " - val" : "", 7892 FormatMxcsr(paTests[iTest].fMxcsrIn)); 7893 } 7894 } 7895 } 7896 } 7897 7898 7899 /* 7900 * Convert SSE operations converting signed double-words to double-precision floating point values. 7901 */ 7902 static const SSE_CONVERT_XMM_T g_aSseConvertXmmR64I32[] = 7903 { 7904 ENTRY_BIN(cvtpd2dq_u128), 7905 ENTRY_BIN(cvttpd2dq_u128) 7906 }; 7907 7908 #ifdef TSTIEMAIMPL_WITH_GENERATOR 7909 static RTEXITCODE SseConvertXmmR64I32Generate(const char *pszDataFileFmt, uint32_t cTests) 7910 { 7911 cTests = RT_MAX(192, cTests); /* there are 144 standard input variations */ 7912 7913 static struct { RTFLOAT64U aVal1[2]; } const s_aSpecials[] = 7914 { 7915 { { RTFLOAT64U_INIT_ZERO(0), RTFLOAT64U_INIT_ZERO(0) } }, 7916 { { RTFLOAT64U_INIT_ZERO(1), RTFLOAT64U_INIT_ZERO(1) } }, 7917 { { RTFLOAT64U_INIT_INF(0), RTFLOAT64U_INIT_INF(0) } }, 7918 { { RTFLOAT64U_INIT_INF(1), RTFLOAT64U_INIT_INF(1) } } 7919 /** @todo More specials. */ 7920 }; 7921 7922 X86FXSTATE State; 7923 RT_ZERO(State); 7924 uint32_t cMinNormalPairs = (cTests - 144) / 4; 7925 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR64I32); iFn++) 7926 { 7927 PFNIEMAIMPLFPSSEF2U128 const pfn = g_aSseConvertXmmR64I32[iFn].pfnNative ? g_aSseConvertXmmR64I32[iFn].pfnNative : g_aSseConvertXmmR64I32[iFn].pfn; 7928 7929 PRTSTREAM pStrmOut = NULL; 7930 int rc = RTStrmOpenF("wb", &pStrmOut, pszDataFileFmt, g_aSseConvertXmmR64I32[iFn].pszName); 7931 if (RT_FAILURE(rc)) 7932 { 7933 RTMsgError("Failed to open data file for %s for writing: %Rrc", g_aSseConvertXmmR64I32[iFn].pszName, rc); 7934 return RTEXITCODE_FAILURE; 7935 } 7936 7937 uint32_t cNormalInputPairs = 0; 7938 for (uint32_t iTest = 0; iTest < cTests + RT_ELEMENTS(s_aSpecials); iTest += 1) 7939 { 7940 SSE_CONVERT_XMM_TEST_T TestData; RT_ZERO(TestData); 7941 7942 TestData.InVal.ar64[0] = iTest < cTests ? RandR64Src(iTest) : s_aSpecials[iTest - cTests].aVal1[0]; 7943 TestData.InVal.ar64[1] = iTest < cTests ? RandR64Src(iTest) : s_aSpecials[iTest - cTests].aVal1[1]; 7944 7945 if ( RTFLOAT64U_IS_NORMAL(&TestData.InVal.ar32[0]) 7946 && RTFLOAT64U_IS_NORMAL(&TestData.InVal.ar32[1])) 7947 cNormalInputPairs++; 7948 else if (cNormalInputPairs < cMinNormalPairs && iTest + cMinNormalPairs >= cTests && iTest < cTests) 7949 { 7950 iTest -= 1; 7951 continue; 7952 } 7953 7954 uint32_t const fMxcsr = RandMxcsr() & X86_MXCSR_XCPT_FLAGS; 7955 for (uint16_t iRounding = 0; iRounding < 4; iRounding++) 7956 for (uint8_t iDaz = 0; iDaz < 2; iDaz++) 7957 for (uint8_t iFz = 0; iFz < 2; iFz++) 7958 { 7959 State.MXCSR = (fMxcsr & ~X86_MXCSR_RC_MASK) 7960 | (iRounding << X86_MXCSR_RC_SHIFT) 7961 | (iDaz ? X86_MXCSR_DAZ : 0) 7962 | (iFz ? X86_MXCSR_FZ : 0) 7963 | X86_MXCSR_XCPT_MASK; 7964 IEMSSERESULT ResM; RT_ZERO(ResM); 7965 pfn(&State, &ResM, &ResM.uResult, &TestData.InVal); 7966 TestData.fMxcsrIn = State.MXCSR; 7967 TestData.fMxcsrOut = ResM.MXCSR; 7968 TestData.OutVal = ResM.uResult; 7969 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7970 7971 State.MXCSR = State.MXCSR & ~X86_MXCSR_XCPT_MASK; 7972 IEMSSERESULT ResU; RT_ZERO(ResU); 7973 pfn(&State, &ResU, &ResU.uResult, &TestData.InVal); 7974 TestData.fMxcsrIn = State.MXCSR; 7975 TestData.fMxcsrOut = ResU.MXCSR; 7976 TestData.OutVal = ResU.uResult; 7977 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7978 7979 uint16_t fXcpt = (ResM.MXCSR | ResU.MXCSR) & X86_MXCSR_XCPT_FLAGS; 7980 if (fXcpt) 7981 { 7982 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | fXcpt; 7983 IEMSSERESULT Res1; RT_ZERO(Res1); 7984 pfn(&State, &Res1, &Res1.uResult, &TestData.InVal); 7985 TestData.fMxcsrIn = State.MXCSR; 7986 TestData.fMxcsrOut = Res1.MXCSR; 7987 TestData.OutVal = Res1.uResult; 7988 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 7989 7990 if (((Res1.MXCSR & X86_MXCSR_XCPT_FLAGS) & fXcpt) != (Res1.MXCSR & X86_MXCSR_XCPT_FLAGS)) 7991 { 7992 fXcpt |= Res1.MXCSR & X86_MXCSR_XCPT_FLAGS; 7993 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | (fXcpt << X86_MXCSR_XCPT_MASK_SHIFT); 7994 IEMSSERESULT Res2; RT_ZERO(Res2); 7995 pfn(&State, &Res2, &Res2.uResult, &TestData.InVal); 7996 TestData.fMxcsrIn = State.MXCSR; 7997 TestData.fMxcsrOut = Res2.MXCSR; 7998 TestData.OutVal = Res2.uResult; 7999 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 8000 } 8001 if (!RT_IS_POWER_OF_TWO(fXcpt)) 8002 for (uint16_t fUnmasked = 1; fUnmasked <= X86_MXCSR_PE; fUnmasked <<= 1) 8003 if (fUnmasked & fXcpt) 8004 { 8005 State.MXCSR = (State.MXCSR & ~X86_MXCSR_XCPT_MASK) | ((fXcpt & ~fUnmasked) << X86_MXCSR_XCPT_MASK_SHIFT); 8006 IEMSSERESULT Res3; RT_ZERO(Res3); 8007 pfn(&State, &Res3, &Res3.uResult, &TestData.InVal); 8008 TestData.fMxcsrIn = State.MXCSR; 8009 TestData.fMxcsrOut = Res3.MXCSR; 8010 TestData.OutVal = Res3.uResult; 8011 RTStrmWrite(pStrmOut, &TestData, sizeof(TestData)); 8012 } 8013 } 8014 } 8015 } 8016 rc = RTStrmClose(pStrmOut); 8017 if (RT_FAILURE(rc)) 8018 { 8019 RTMsgError("Failed to close data file for %s: %Rrc", g_aSseConvertXmmR64I32[iFn].pszName, rc); 8020 return RTEXITCODE_FAILURE; 8021 } 8022 } 8023 8024 return RTEXITCODE_SUCCESS; 8025 } 8026 #endif 8027 8028 static void SseConvertXmmR64I32Test(void) 8029 { 8030 X86FXSTATE State; 8031 RT_ZERO(State); 8032 8033 for (size_t iFn = 0; iFn < RT_ELEMENTS(g_aSseConvertXmmR64I32); iFn++) 8034 { 8035 if (!SubTestAndCheckIfEnabled(g_aSseConvertXmmR64I32[iFn].pszName)) 8036 continue; 8037 8038 uint32_t const cTests = *g_aSseConvertXmmR64I32[iFn].pcTests; 8039 SSE_CONVERT_XMM_TEST_T const * const paTests = g_aSseConvertXmmR64I32[iFn].paTests; 8040 PFNIEMAIMPLFPSSEF2U128 pfn = g_aSseConvertXmmR64I32[iFn].pfn; 8041 uint32_t const cVars = COUNT_VARIATIONS(g_aSseConvertXmmR64I32[iFn]); 8042 if (!cTests) RTTestSkipped(g_hTest, "no tests"); 8043 for (uint32_t iVar = 0; iVar < cVars; iVar++) 8044 { 8045 for (uint32_t iTest = 0; iTest < cTests / sizeof(*paTests); iTest++) 8046 { 8047 IEMSSERESULT Res; RT_ZERO(Res); 8048 8049 State.MXCSR = paTests[iTest].fMxcsrIn; 8050 pfn(&State, &Res, &Res.uResult, &paTests[iTest].InVal); 8051 if ( Res.MXCSR != paTests[iTest].fMxcsrOut 8052 || Res.uResult.ai32[0] != paTests[iTest].OutVal.ai32[0] 8053 || Res.uResult.ai32[1] != paTests[iTest].OutVal.ai32[1] 8054 || Res.uResult.ai32[2] != paTests[iTest].OutVal.ai32[2] 8055 || Res.uResult.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8056 RTTestFailed(g_hTest, "#%04u%s: mxcsr=%#08x in1=%s'%s \n" 8057 "%s -> mxcsr=%#08x %RI32'%RI32'%RI32'%RI32\n" 8058 "%s expected %#08x %RI32'%RI32'%RI32'%RI32%s%s (%s)\n", 8059 iTest, iVar ? "/n" : "", paTests[iTest].fMxcsrIn, 8060 FormatR64(&paTests[iTest].InVal.ar64[0]), FormatR64(&paTests[iTest].InVal.ar64[1]), 8061 iVar ? " " : "", Res.MXCSR, 8062 Res.uResult.ai32[0], Res.uResult.ai32[1], 8063 Res.uResult.ai32[2], Res.uResult.ai32[3], 8064 iVar ? " " : "", paTests[iTest].fMxcsrOut, 8065 paTests[iTest].OutVal.ai32[0], paTests[iTest].OutVal.ai32[1], 8066 paTests[iTest].OutVal.ai32[2], paTests[iTest].OutVal.ai32[3], 8067 MxcsrDiff(Res.MXCSR, paTests[iTest].fMxcsrOut), 8068 ( Res.uResult.ai32[0] != paTests[iTest].OutVal.ai32[0] 8069 || Res.uResult.ai32[1] != paTests[iTest].OutVal.ai32[1] 8070 || Res.uResult.ai32[2] != paTests[iTest].OutVal.ai32[2] 8071 || Res.uResult.ai32[3] != paTests[iTest].OutVal.ai32[3]) 8072 ? " - val" : "", 8073 FormatMxcsr(paTests[iTest].fMxcsrIn)); 8074 } 8075 } 8076 } 8077 } 8078 8079 7369 8080 7370 8081 int main(int argc, char **argv) … … 7742 8453 if (fSseFpOther) 7743 8454 { 7744 const char *pszDataFileFmt = fCommonData ? "tstIEMAImplDataSseCompare-%s.bin" : pszBitBucket; 7745 7746 RTEXITCODE rcExit = SseCompareEflR32R32Generate(pszDataFileFmt, cTests); 8455 const char *pszDataFileFmtCmp = fCommonData ? "tstIEMAImplDataSseCompare-%s.bin" : pszBitBucket; 8456 const char *pszDataFileFmtConv = fCommonData ? "tstIEMAImplDataSseConvert-%s.bin" : pszBitBucket; 8457 8458 RTEXITCODE rcExit = SseCompareEflR32R32Generate(pszDataFileFmtCmp, cTests); 7747 8459 if (rcExit == RTEXITCODE_SUCCESS) 7748 rcExit = SseCompareEflR64R64Generate(pszDataFileFmt , cTests);8460 rcExit = SseCompareEflR64R64Generate(pszDataFileFmtCmp, cTests); 7749 8461 if (rcExit == RTEXITCODE_SUCCESS) 7750 rcExit = SseCompareF2XmmR32Imm8Generate(pszDataFileFmt , cTests);8462 rcExit = SseCompareF2XmmR32Imm8Generate(pszDataFileFmtCmp, cTests); 7751 8463 if (rcExit == RTEXITCODE_SUCCESS) 7752 rcExit = SseCompareF2XmmR64Imm8Generate(pszDataFileFmt, cTests); 8464 rcExit = SseCompareF2XmmR64Imm8Generate(pszDataFileFmtCmp, cTests); 8465 if (rcExit == RTEXITCODE_SUCCESS) 8466 rcExit = SseConvertXmmI32R32Generate(pszDataFileFmtConv, cTests); 8467 if (rcExit == RTEXITCODE_SUCCESS) 8468 rcExit = SseConvertXmmR32I32Generate(pszDataFileFmtConv, cTests); 8469 if (rcExit == RTEXITCODE_SUCCESS) 8470 rcExit = SseConvertXmmI32R64Generate(pszDataFileFmtConv, cTests); 8471 if (rcExit == RTEXITCODE_SUCCESS) 8472 rcExit = SseConvertXmmR64I32Generate(pszDataFileFmtConv, cTests); 7753 8473 if (rcExit != RTEXITCODE_SUCCESS) 7754 8474 return rcExit; … … 7869 8589 SseCompareF2XmmR32Imm8Test(); 7870 8590 SseCompareF2XmmR64Imm8Test(); 8591 SseConvertXmmI32R32Test(); 8592 SseConvertXmmR32I32Test(); 8593 SseConvertXmmI32R64Test(); 8594 SseConvertXmmR64I32Test(); 7871 8595 } 7872 8596 } -
trunk/src/VBox/VMM/testcase/tstIEMAImpl.h
r96790 r96797 484 484 X86XMMREG OutVal; 485 485 } SSE_COMPARE_F2_XMM_IMM8_TEST_T; 486 487 typedef struct SSE_CONVERT_XMM_TEST_T 488 { 489 uint32_t fMxcsrIn; 490 uint32_t fMxcsrOut; 491 uint32_t au32Padding[2]; 492 X86XMMREG InVal; 493 X86XMMREG OutVal; 494 } SSE_CONVERT_XMM_TEST_T; 486 495 487 496 /** @} */ … … 936 945 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseCompare, SSE_COMPARE_F2_XMM_IMM8_TEST_T, cmpsd_u128 ); 937 946 947 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseConvert, SSE_CONVERT_XMM_TEST_T, cvtdq2ps_u128 ); 948 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseConvert, SSE_CONVERT_XMM_TEST_T, cvtps2dq_u128 ); 949 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseConvert, SSE_CONVERT_XMM_TEST_T, cvttps2dq_u128 ); 950 951 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseConvert, SSE_CONVERT_XMM_TEST_T, cvttpd2dq_u128 ); 952 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseConvert, SSE_CONVERT_XMM_TEST_T, cvtdq2pd_u128 ); 953 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseConvert, SSE_CONVERT_XMM_TEST_T, cvtpd2dq_u128 ); 954 938 955 RT_C_DECLS_END 939 956 -
trunk/src/VBox/VMM/testcase/tstIEMAImplDataSseBinary.S
r96790 r96797 134 134 IEM_TEST_DATA cmppd_u128, "tstIEMAImplDataSseCompare-cmppd_u128.bin" 135 135 IEM_TEST_DATA cmpsd_u128, "tstIEMAImplDataSseCompare-cmpsd_u128.bin" 136 137 IEM_TEST_DATA cvtdq2ps_u128, "tstIEMAImplDataSseConvert-cvtdq2ps_u128.bin" 138 IEM_TEST_DATA cvtps2dq_u128, "tstIEMAImplDataSseConvert-cvtps2dq_u128.bin" 139 IEM_TEST_DATA cvttps2dq_u128, "tstIEMAImplDataSseConvert-cvttps2dq_u128.bin" 140 141 IEM_TEST_DATA cvtdq2pd_u128, "tstIEMAImplDataSseConvert-cvtdq2pd_u128.bin" 142 IEM_TEST_DATA cvtpd2dq_u128, "tstIEMAImplDataSseConvert-cvtpd2dq_u128.bin" 143 IEM_TEST_DATA cvttpd2dq_u128, "tstIEMAImplDataSseConvert-cvttpd2dq_u128.bin" -
trunk/src/VBox/VMM/testcase/tstIEMAImplDataSseBinary.asm
r96790 r96797 132 132 IEM_TEST_DATA cmppd_u128, "tstIEMAImplDataSseCompare-cmppd_u128.bin" 133 133 IEM_TEST_DATA cmpsd_u128, "tstIEMAImplDataSseCompare-cmpsd_u128.bin" 134 135 IEM_TEST_DATA cvtdq2ps_u128, "tstIEMAImplDataSseConvert-cvtdq2ps_u128.bin" 136 IEM_TEST_DATA cvtps2dq_u128, "tstIEMAImplDataSseConvert-cvtps2dq_u128.bin" 137 IEM_TEST_DATA cvttps2dq_u128, "tstIEMAImplDataSseConvert-cvttps2dq_u128.bin" 138 139 IEM_TEST_DATA cvtdq2pd_u128, "tstIEMAImplDataSseConvert-cvtdq2pd_u128.bin" 140 IEM_TEST_DATA cvtpd2dq_u128, "tstIEMAImplDataSseConvert-cvtpd2dq_u128.bin" 141 IEM_TEST_DATA cvttpd2dq_u128, "tstIEMAImplDataSseConvert-cvttpd2dq_u128.bin"
Note:
See TracChangeset
for help on using the changeset viewer.