Changeset 47411 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Jul 25, 2013 8:17:43 PM (12 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r47407 r47411 6864 6864 if ( ((pIemCpu)->CTX_SUFF(pCtx)->cr0 & X86_CR0_EM) \ 6865 6865 || !IEM_IS_INTEL_CPUID_FEATURE_PRESENT_EDX(X86_CPUID_FEATURE_EDX_MMX) ) \ 6866 return iemRaiseUndefinedOpcode(pIemCpu); \ 6867 if (pIemCpu->CTX_SUFF(pCtx)->cr0 & X86_CR0_TS) \ 6868 return iemRaiseDeviceNotAvailable(pIemCpu); \ 6869 } while (0) 6870 #define IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT_CHECK_SSE_OR_MMXEXT() \ 6871 do { \ 6872 if ( ((pIemCpu)->CTX_SUFF(pCtx)->cr0 & X86_CR0_EM) \ 6873 || ( !IEM_IS_INTEL_CPUID_FEATURE_PRESENT_EDX(X86_CPUID_FEATURE_EDX_SSE) \ 6874 && !IEM_IS_AMD_CPUID_FEATURE_PRESENT_EDX(X86_CPUID_AMD_FEATURE_EDX_AXMMX) ) ) \ 6866 6875 return iemRaiseUndefinedOpcode(pIemCpu); \ 6867 6876 if (pIemCpu->CTX_SUFF(pCtx)->cr0 & X86_CR0_TS) \ -
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r47407 r47411 2972 2972 IEMIMPL_MEDIA_SSE_PSHUFXX pshuflw 2973 2973 IEMIMPL_MEDIA_SSE_PSHUFXX pshufd 2974 2975 2976 ; 2977 ; Move byte mask. 2978 ; 2979 2980 BEGINPROC_FASTCALL iemAImpl_pmovmskb_u64, 12 2981 PROLOGUE_3_ARGS 2982 IEMIMPL_MMX_PROLOGUE 2983 2984 mov T0, [A1] 2985 movq mm1, [A2] 2986 pmovmskb T0, mm1 2987 mov [A1], T0 2988 %ifdef RT_ARCH_X86 2989 mov dword [A1 + 4], 0 2990 %endif 2991 IEMIMPL_MMX_EPILOGUE 2992 EPILOGUE_3_ARGS 2993 ENDPROC iemAImpl_pmovmskb_u64 2994 2995 BEGINPROC_FASTCALL iemAImpl_pmovmskb_u128, 12 2996 PROLOGUE_3_ARGS 2997 IEMIMPL_SSE_PROLOGUE 2998 2999 mov T0, [A1] 3000 movdqu xmm1, [A2] 3001 pmovmskb T0, xmm1 3002 mov [A1], T0 3003 %ifdef RT_ARCH_X86 3004 mov dword [A1 + 4], 0 3005 %endif 3006 IEMIMPL_SSE_EPILOGUE 3007 EPILOGUE_3_ARGS 3008 ENDPROC iemAImpl_pmovmskb_u128 3009 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r47407 r47411 1942 1942 FNIEMOP_DEF(iemOp_punpcklwd_Pq_Qd__punpcklwd_Vdq_Wdq) 1943 1943 { 1944 IEMOP_MNEMONIC("punpcklwd"); 1944 IEMOP_MNEMONIC("punpcklwd"); /** @todo AMD mark the MMX version as 3DNow!. Intel says MMX CPUID req. */ 1945 1945 return FNIEMOP_CALL_1(iemOpCommonMmxSse_LowLow_To_Full, &g_iemAImpl_punpcklwd); 1946 1946 } … … 2402 2402 IEM_MC_ARG(uint64_t const *, pSrc, 1); 2403 2403 IEM_MC_ARG_CONST(uint8_t, bEvilArg, /*=*/ bEvil, 2); 2404 IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT ();2404 IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT_CHECK_SSE_OR_MMXEXT(); 2405 2405 IEM_MC_REF_MREG_U64(pDst, (bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK); 2406 2406 IEM_MC_REF_MREG_U64_CONST(pSrc, bRm & X86_MODRM_RM_MASK); … … 2424 2424 IEM_MC_ARG_CONST(uint8_t, bEvilArg, /*=*/ bEvil, 2); 2425 2425 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 2426 IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT ();2426 IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT_CHECK_SSE_OR_MMXEXT(); 2427 2427 2428 2428 IEM_MC_FETCH_MEM_U64(uSrc, pIemCpu->iEffSeg, GCPtrEffSrc); … … 2617 2617 * 2618 2618 * Proper alignment of the 128-bit operand is enforced. 2619 * Exceptions type 4. 2619 * Exceptions type 4. SSE2 and MMX cpuid checks. 2620 2620 */ 2621 FNIEMOP_DEF_1(iemOpCommonMmxSse _FullFull_To_Full, PCIEMOPMEDIAF2, pImpl)2621 FNIEMOP_DEF_1(iemOpCommonMmxSse2_FullFull_To_Full, PCIEMOPMEDIAF2, pImpl) 2622 2622 { 2623 2623 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); … … 2718 2718 { 2719 2719 IEMOP_MNEMONIC("pcmpeqb"); 2720 return FNIEMOP_CALL_1(iemOpCommonMmxSse _FullFull_To_Full, &g_iemAImpl_pcmpeqb);2720 return FNIEMOP_CALL_1(iemOpCommonMmxSse2_FullFull_To_Full, &g_iemAImpl_pcmpeqb); 2721 2721 } 2722 2722 … … 2726 2726 { 2727 2727 IEMOP_MNEMONIC("pcmpeqw"); 2728 return FNIEMOP_CALL_1(iemOpCommonMmxSse _FullFull_To_Full, &g_iemAImpl_pcmpeqw);2728 return FNIEMOP_CALL_1(iemOpCommonMmxSse2_FullFull_To_Full, &g_iemAImpl_pcmpeqw); 2729 2729 } 2730 2730 … … 2734 2734 { 2735 2735 IEMOP_MNEMONIC("pcmpeqd"); 2736 return FNIEMOP_CALL_1(iemOpCommonMmxSse _FullFull_To_Full, &g_iemAImpl_pcmpeqd);2736 return FNIEMOP_CALL_1(iemOpCommonMmxSse2_FullFull_To_Full, &g_iemAImpl_pcmpeqd); 2737 2737 } 2738 2738 … … 6293 6293 /** Opcode 0x0f 0xd6. */ 6294 6294 FNIEMOP_STUB(iemOp_movq_Wq_Vq__movq2dq_Vdq_Nq__movdq2q_Pq_Uq); 6295 6296 6295 6297 /** Opcode 0x0f 0xd7. */ 6296 FNIEMOP_STUB(iemOp_pmovmskb_Gd_Nq__pmovmskb_Gd_Udq); //NEXT 6298 FNIEMOP_DEF(iemOp_pmovmskb_Gd_Nq__pmovmskb_Gd_Udq) 6299 { 6300 /* Docs says register only. */ 6301 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 6302 if ((bRm & X86_MODRM_MOD_MASK) != (3 << X86_MODRM_MOD_SHIFT)) /** @todo test that this is registers only. */ 6303 return IEMOP_RAISE_INVALID_OPCODE(); 6304 6305 /* Note! Taking the lazy approch here wrt the high 32-bits of the GREG. */ 6306 /** @todo testcase: Check that the instruction implicitly clears the high 6307 * bits in 64-bit mode. The REX.W is first necessary when VLMAX > 256 6308 * and opcode modifications are made to work with the whole width (not 6309 * just 128). */ 6310 switch (pIemCpu->fPrefixes & (IEM_OP_PRF_SIZE_OP | IEM_OP_PRF_REPNZ | IEM_OP_PRF_REPZ)) 6311 { 6312 case IEM_OP_PRF_SIZE_OP: /* SSE */ 6313 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 6314 IEM_MC_BEGIN(2, 0); 6315 IEM_MC_ARG(uint64_t *, pDst, 0); 6316 IEM_MC_ARG(uint128_t const *, pSrc, 1); 6317 IEM_MC_MAYBE_RAISE_SSE2_RELATED_XCPT(); 6318 IEM_MC_REF_GREG_U64(pDst, ((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pIemCpu->uRexReg); 6319 IEM_MC_REF_XREG_U128_CONST(pSrc, (bRm & X86_MODRM_RM_MASK) | pIemCpu->uRexB); 6320 IEM_MC_CALL_SSE_AIMPL_2(iemAImpl_pmovmskb_u128, pDst, pSrc); 6321 IEM_MC_ADVANCE_RIP(); 6322 IEM_MC_END(); 6323 return VINF_SUCCESS; 6324 6325 case 0: /* MMX */ 6326 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 6327 IEM_MC_BEGIN(2, 0); 6328 IEM_MC_ARG(uint64_t *, pDst, 0); 6329 IEM_MC_ARG(uint64_t const *, pSrc, 1); 6330 IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT_CHECK_SSE_OR_MMXEXT(); 6331 IEM_MC_REF_GREG_U64(pDst, (bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK); 6332 IEM_MC_REF_MREG_U64_CONST(pSrc, bRm & X86_MODRM_RM_MASK); 6333 IEM_MC_CALL_MMX_AIMPL_2(iemAImpl_pmovmskb_u64, pDst, pSrc); 6334 IEM_MC_ADVANCE_RIP(); 6335 IEM_MC_END(); 6336 return VINF_SUCCESS; 6337 6338 default: 6339 return IEMOP_RAISE_INVALID_OPCODE(); 6340 } 6341 } 6342 6343 6297 6344 /** Opcode 0x0f 0xd8. */ 6298 6345 FNIEMOP_STUB(iemOp_psubusb_Pq_Qq__psubusb_Vdq_Wdq); … … 6347 6394 { 6348 6395 IEMOP_MNEMONIC("pxor"); 6349 return FNIEMOP_CALL_1(iemOpCommonMmxSse _FullFull_To_Full, &g_iemAImpl_pxor);6396 return FNIEMOP_CALL_1(iemOpCommonMmxSse2_FullFull_To_Full, &g_iemAImpl_pxor); 6350 6397 } 6351 6398 -
trunk/src/VBox/VMM/include/IEMInternal.h
r47407 r47411 1107 1107 /** @} */ 1108 1108 1109 /** @name Media (SSE/MMX/AVX) operation: Move Byte Mask 1110 * @{ */ 1111 IEM_DECL_IMPL_DEF(void, iemAImpl_pmovmskb_u64,(PCX86FXSTATE pFpuState, uint64_t *pu64Dst, uint64_t const *pu64Src)); 1112 IEM_DECL_IMPL_DEF(void, iemAImpl_pmovmskb_u128,(PCX86FXSTATE pFpuState, uint64_t *pu64Dst, uint128_t const *pu128Src)); 1113 /** @} */ 1109 1114 1110 1115 -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r47407 r47411 320 320 #define IEM_MC_MAYBE_RAISE_FPU_XCPT() do {} while (0) 321 321 #define IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT() do {} while (0) 322 #define IEM_MC_MAYBE_RAISE_MMX_RELATED_XCPT_CHECK_SSE_OR_MMXEXT() do {} while (0) 322 323 #define IEM_MC_MAYBE_RAISE_SSE2_RELATED_XCPT() do {} while (0) 323 324 #define IEM_MC_RAISE_GP0_IF_CPL_NOT_ZERO() do {} while (0)
Note:
See TracChangeset
for help on using the changeset viewer.