Changeset 104521 in vbox
- Timestamp:
- May 6, 2024 2:15:45 PM (9 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r104354 r104521 5464 5464 SSE_AVX_LD_MXCSR A0_32 5465 5465 5466 movdqu 5467 movdqu 5468 %1 5469 movdqu 5466 movdqu xmm0, [A2] 5467 movdqu xmm1, [A3] 5468 %1 xmm0, xmm1 5469 movdqu [A1], xmm0 5470 5470 5471 5471 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 5479 5479 SSE_AVX_LD_MXCSR A0_32 5480 5480 5481 vmovdqu 5482 vmovdqu 5483 v %+ %1 5484 vmovdqu 5481 vmovdqu xmm0, [A2] 5482 vmovdqu xmm1, [A3] 5483 v %+ %1 xmm0, xmm1 5484 vmovdqu [A1], xmm0 5485 5485 5486 5486 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 5494 5494 SSE_AVX_LD_MXCSR A0_32 5495 5495 5496 vmovdqu 5497 vmovdqu 5496 vmovdqu ymm0, [A2] 5497 vmovdqu ymm1, [A3] 5498 5498 %if %2 == 0 5499 v %+ %1 5499 v %+ %1 xmm0, ymm1 5500 5500 %else 5501 v %+ %1 5501 v %+ %1 ymm0, xmm1 5502 5502 %endif 5503 vmovdqu 5503 vmovdqu [A1], ymm0 5504 5504 5505 5505 SSE_AVX_ST_MXCSR R0_32, A0_32 … … 5510 5510 5511 5511 IEMIMPL_CVT_F2 cvtpd2ps, 0 5512 IEMIMPL_CVT_F2 cvtps2pd, 1 5512 ;IEMIMPL_CVT_F2 cvtps2pd, 1 - inefficient. 5513 5514 BEGINPROC_FASTCALL iemAImpl_cvtps2pd_u128, 12 5515 PROLOGUE_3_ARGS 5516 IEMIMPL_SSE_PROLOGUE 5517 SSE_AVX_LD_MXCSR A0_32 5518 5519 cvtps2pd xmm0, [A2] 5520 movdqu [A1], xmm0 5521 5522 SSE_AVX_ST_MXCSR R0_32, A0_32 5523 IEMIMPL_SSE_EPILOGUE 5524 EPILOGUE_3_ARGS 5525 ENDPROC iemAImpl_cvtps2pd_u128 5526 5513 5527 5514 5528 -
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r104439 r104521 16846 16846 */ 16847 16847 #ifdef IEM_WITHOUT_ASSEMBLY 16848 static uint32_t iemAImpl_cvtps2pd_u128_worker(PRTFLOAT64U pr64Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val1) 16849 { 16850 RTFLOAT32U r32Src1; 16851 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 16848 static uint32_t iemAImpl_cvtps2pd_u128_worker(PRTFLOAT64U pr64Res, uint32_t fMxcsr, uint32_t u32SrcIn) 16849 { 16850 RTFLOAT32U r32SrcConverted; 16851 RTFLOAT32U r32SrcIn; 16852 r32SrcIn.u = u32SrcIn; 16853 fMxcsr |= iemSsePrepareValueR32(&r32SrcConverted, fMxcsr, &r32SrcIn); 16852 16854 16853 16855 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 16854 float64_t r64Result = f32_to_f64(iemFpSoftF32FromIprt(&r32Src 1), &SoftState);16856 float64_t r64Result = f32_to_f64(iemFpSoftF32FromIprt(&r32SrcConverted), &SoftState); 16855 16857 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr); 16856 16858 } 16857 16859 16858 16860 16859 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cvtps2pd_u128,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2)) 16860 { 16861 RT_NOREF(puSrc1); 16862 16863 return iemAImpl_cvtps2pd_u128_worker(&pResult->ar64[0], uMxCsrIn, &puSrc2->ar32[0]) 16864 | iemAImpl_cvtps2pd_u128_worker(&pResult->ar64[1], uMxCsrIn, &puSrc2->ar32[1]); 16861 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cvtps2pd_u128,(uint32_t fMxCsrIn, PX86XMMREG pResult, uint64_t const *pu64Src)) 16862 { 16863 uint64_t const u64Src = *pu64Src; 16864 return iemAImpl_cvtps2pd_u128_worker(&pResult->ar64[0], fMxCsrIn, RT_LO_U32(u64Src)) 16865 | iemAImpl_cvtps2pd_u128_worker(&pResult->ar64[1], fMxCsrIn, RT_HI_U32(u64Src)); 16865 16866 } 16866 16867 #endif -
trunk/src/VBox/VMM/VMMAll/IEMAllInstTwoByte0f.cpp.h
r104439 r104521 758 758 * 759 759 * Proper alignment of the 128-bit operand is enforced. 760 * Exceptions type 2. SSE cpuid checks.760 * Exceptions type 3. SSE cpuid checks. 761 761 * 762 762 * @sa iemOpCommonSse41_FullFull_To_Full, iemOpCommonSse2_FullFull_To_Full … … 886 886 * 887 887 * Proper alignment of the 128-bit operand is enforced. 888 * Exceptions type 2. SSE2 cpuid checks.888 * Exceptions type 3. SSE2 cpuid checks. 889 889 * 890 890 * @sa iemOpCommonSse41_FullFull_To_Full, iemOpCommonSse2_FullFull_To_Full … … 5480 5480 FNIEMOP_DEF(iemOp_cvtps2pd_Vpd_Wps) 5481 5481 { 5482 IEMOP_MNEMONIC2(RM, CVTPS2PD, cvtps2pd, Vpd, Wps, DISOPTYPE_HARMLESS, 0); 5483 return FNIEMOP_CALL_1(iemOpCommonSse2Fp_FullFull_To_Full, iemAImpl_cvtps2pd_u128); 5482 IEMOP_MNEMONIC2(RM, CVTPS2PD, cvtps2pd, Vpd_WO, Wps, DISOPTYPE_HARMLESS, 0); 5483 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 5484 if (IEM_IS_MODRM_REG_MODE(bRm)) 5485 { 5486 /* 5487 * XMM, XMM[63:0]. 5488 */ 5489 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); 5490 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX_EX(fSse2); 5491 IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT(); 5492 IEM_MC_PREPARE_SSE_USAGE(); 5493 5494 IEM_MC_LOCAL(X86XMMREG, SseRes); 5495 IEM_MC_ARG_LOCAL_REF(PX86XMMREG, pSseRes, SseRes, 0); 5496 IEM_MC_ARG(uint64_t const *, pu64Src, 1); /* The input is actually two 32-bit float values, */ 5497 IEM_MC_REF_XREG_U64_CONST(pu64Src, IEM_GET_MODRM_RM(pVCpu, bRm)); /* but we've got no matching type or MC. */ 5498 IEM_MC_CALL_SSE_AIMPL_2(iemAImpl_cvtps2pd_u128, pSseRes, pu64Src); 5499 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); 5500 IEM_MC_STORE_XREG_XMM(IEM_GET_MODRM_REG(pVCpu, bRm), SseRes); 5501 5502 IEM_MC_ADVANCE_RIP_AND_FINISH(); 5503 IEM_MC_END(); 5504 } 5505 else 5506 { 5507 /* 5508 * XMM, [mem64]. 5509 */ 5510 IEM_MC_BEGIN(IEM_MC_F_MIN_386, 0); 5511 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); 5512 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 5513 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX_EX(fSse2); 5514 IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT(); 5515 5516 IEM_MC_LOCAL(uint8_t, bUnmapInfo); 5517 IEM_MC_ARG(uint64_t const *, pu64Src, 1); /* (see comment above wrt type) */ 5518 IEM_MC_MEM_MAP_U64_RO(pu64Src, bUnmapInfo, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); 5519 5520 IEM_MC_PREPARE_SSE_USAGE(); 5521 IEM_MC_LOCAL(X86XMMREG, SseRes); 5522 IEM_MC_ARG_LOCAL_REF(PX86XMMREG, pSseRes, SseRes, 0); 5523 IEM_MC_CALL_SSE_AIMPL_2(iemAImpl_cvtps2pd_u128, pSseRes, pu64Src); 5524 IEM_MC_MEM_COMMIT_AND_UNMAP_RO(bUnmapInfo); 5525 5526 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); 5527 IEM_MC_STORE_XREG_XMM(IEM_GET_MODRM_REG(pVCpu, bRm), SseRes); 5528 5529 IEM_MC_ADVANCE_RIP_AND_FINISH(); 5530 IEM_MC_END(); 5531 } 5484 5532 } 5485 5533 … … 5488 5536 FNIEMOP_DEF(iemOp_cvtpd2ps_Vps_Wpd) 5489 5537 { 5490 IEMOP_MNEMONIC2(RM, CVTPD2PS, cvtpd2ps, Vps, Wpd, DISOPTYPE_HARMLESS, 0); 5538 IEMOP_MNEMONIC2(RM, CVTPD2PS, cvtpd2ps, Vps_WO, Wpd, DISOPTYPE_HARMLESS, 0); 5539 /** @todo inefficient as we don't need to fetch the destination (write-only). */ 5491 5540 return FNIEMOP_CALL_1(iemOpCommonSse2Fp_FullFull_To_Full, iemAImpl_cvtpd2ps_u128); 5492 5541 } … … 5512 5561 FNIEMOP_DEF(iemOp_cvtdq2ps_Vps_Wdq) 5513 5562 { 5514 IEMOP_MNEMONIC2(RM, CVTDQ2PS, cvtdq2ps, Vps, Wdq, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 5563 IEMOP_MNEMONIC2(RM, CVTDQ2PS, cvtdq2ps, Vps_WO, Wdq, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 5564 /** @todo inefficient as we don't need to fetch the destination (write-only). */ 5515 5565 return FNIEMOP_CALL_1(iemOpCommonSse2Fp_FullFull_To_Full, iemAImpl_cvtdq2ps_u128); 5516 5566 } … … 5520 5570 FNIEMOP_DEF(iemOp_cvtps2dq_Vdq_Wps) 5521 5571 { 5522 IEMOP_MNEMONIC2(RM, CVTPS2DQ, cvtps2dq, Vdq, Wps, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 5572 IEMOP_MNEMONIC2(RM, CVTPS2DQ, cvtps2dq, Vdq_WO, Wps, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 5573 /** @todo inefficient as we don't need to fetch the destination (write-only). */ 5523 5574 return FNIEMOP_CALL_1(iemOpCommonSse2Fp_FullFull_To_Full, iemAImpl_cvtps2dq_u128); 5524 5575 } … … 5528 5579 FNIEMOP_DEF(iemOp_cvttps2dq_Vdq_Wps) 5529 5580 { 5530 IEMOP_MNEMONIC2(RM, CVTTPS2DQ, cvttps2dq, Vdq, Wps, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 5581 IEMOP_MNEMONIC2(RM, CVTTPS2DQ, cvttps2dq, Vdq_WO, Wps, DISOPTYPE_HARMLESS | DISOPTYPE_X86_SSE, 0); 5582 /** @todo inefficient as we don't need to fetch the destination (write-only). */ 5531 5583 return FNIEMOP_CALL_1(iemOpCommonSse2Fp_FullFull_To_Full, iemAImpl_cvttps2dq_u128); 5532 5584 } -
trunk/src/VBox/VMM/include/IEMInternal.h
r104506 r104521 4444 4444 FNIEMAIMPLFPSSEF2U128 iemAImpl_addsubps_u128; 4445 4445 FNIEMAIMPLFPSSEF2U128 iemAImpl_addsubpd_u128; 4446 4446 4447 FNIEMAIMPLFPSSEF2U128 iemAImpl_cvtpd2ps_u128; 4447 FNIEMAIMPLFPSSEF2U128 iemAImpl_cvtps2pd_u128;4448 IEM_DECL_IMPL_PROTO(uint32_t, iemAImpl_cvtps2pd_u128,(uint32_t uMxCsrIn, PX86XMMREG pResult, uint64_t const *pu64Src)); 4448 4449 4449 4450 FNIEMAIMPLFPSSEF2U128 iemAImpl_cvtdq2ps_u128; -
trunk/src/VBox/VMM/testcase/tstIEMAImpl.cpp
r104269 r104521 5557 5557 TYPEDEF_SUBTEST_TYPE(SSE_BINARY_R32_T, SSE_BINARY_TEST_T, PFNIEMAIMPLFPSSEF2U128); 5558 5558 5559 /** Ugly hack to keep it working after changing function arguments! */ 5560 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_cvtps2pd_u128x,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2)) 5561 { 5562 RT_NOREF(puSrc1); 5563 return iemAImpl_cvtps2pd_u128(uMxCsrIn, pResult, &puSrc2->au64[0]); 5564 } 5565 5559 5566 static SSE_BINARY_R32_T g_aSseBinaryR32[] = 5560 5567 { … … 5569 5576 ENTRY_BIN(sqrtps_u128), 5570 5577 ENTRY_BIN(addsubps_u128), 5571 ENTRY_BIN(cvtps2pd_u128 ),5578 ENTRY_BIN(cvtps2pd_u128x), /* conversion hack */ 5572 5579 }; 5573 5580 -
trunk/src/VBox/VMM/testcase/tstIEMAImpl.h
r103064 r104521 944 944 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseBinary, SSE_BINARY_TEST_T, sqrtps_u128 ); 945 945 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseBinary, SSE_BINARY_TEST_T, addsubps_u128 ); 946 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseBinary, SSE_BINARY_TEST_T, cvtps2pd_u128 946 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseBinary, SSE_BINARY_TEST_T, cvtps2pd_u128x ); 947 947 948 948 TSTIEM_DECLARE_TEST_ARRAY_BIN(SseBinary, SSE_BINARY_U128_R32_TEST_T, addss_u128_r32 ); -
trunk/src/VBox/VMM/testcase/tstIEMAImplDataSseBinary.S
r104022 r104521 70 70 IEM_TEST_DATA sqrtps_u128, "tstIEMAImplDataSseBinary-sqrtps_u128.bin.gz" 71 71 IEM_TEST_DATA addsubps_u128, "tstIEMAImplDataSseBinary-addsubps_u128.bin.gz" 72 IEM_TEST_DATA cvtps2pd_u128 ,"tstIEMAImplDataSseBinary-cvtps2pd_u128.bin.gz"72 IEM_TEST_DATA cvtps2pd_u128x, "tstIEMAImplDataSseBinary-cvtps2pd_u128.bin.gz" 73 73 74 74 IEM_TEST_DATA addss_u128_r32, "tstIEMAImplDataSseBinary-addss_u128_r32.bin.gz" -
trunk/src/VBox/VMM/testcase/tstIEMAImplDataSseBinary.asm
r103075 r104521 69 69 IEM_TEST_DATA sqrtps_u128, "tstIEMAImplDataSseBinary-sqrtps_u128.bin.gz" 70 70 IEM_TEST_DATA addsubps_u128, "tstIEMAImplDataSseBinary-addsubps_u128.bin.gz" 71 IEM_TEST_DATA cvtps2pd_u128 ,"tstIEMAImplDataSseBinary-cvtps2pd_u128.bin.gz"71 IEM_TEST_DATA cvtps2pd_u128x, "tstIEMAImplDataSseBinary-cvtps2pd_u128.bin.gz" 72 72 73 73 IEM_TEST_DATA addss_u128_r32, "tstIEMAImplDataSseBinary-addss_u128_r32.bin.gz"
Note:
See TracChangeset
for help on using the changeset viewer.