Changeset 104033 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Mar 25, 2024 7:55:45 AM (11 months ago)
- svn:sync-xref-src-repo-rev:
- 162422
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r104019 r104033 5710 5710 5711 5711 5712 static uint32_t iemNativeSimdRegAllocLoadVecRegFromVecRegSz(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxHstSimdRegDst,5713 uint8_t idxHstSimdReg Src, IEMNATIVEGSTSIMDREGLDSTSZ enmLoadSzDst)5712 static uint32_t iemNativeSimdRegAllocLoadVecRegFromVecRegSz(PIEMRECOMPILERSTATE pReNative, uint32_t off, IEMNATIVEGSTSIMDREG enmGstSimdRegDst, 5713 uint8_t idxHstSimdRegDst, uint8_t idxHstSimdRegSrc, IEMNATIVEGSTSIMDREGLDSTSZ enmLoadSzDst) 5714 5714 { 5715 5715 /* Easy case first, either the destination loads the same range as what the source has already loaded or the source has loaded everything. */ … … 5733 5733 break; 5734 5734 case kIemNativeGstSimdRegLdStSz_High128: 5735 off = iemNativeEmitSimdLoadVecReg FromVecRegU128(pReNative, off, idxHstSimdRegDst + 1, idxHstSimdRegSrc + 1);5735 off = iemNativeEmitSimdLoadVecRegHighU128FromVecRegHighU128(pReNative, off, idxHstSimdRegDst, idxHstSimdRegSrc); 5736 5736 break; 5737 5737 default: … … 5744 5744 else 5745 5745 { 5746 /* Complicated stuff where the source is currently missing something, later. */ 5747 AssertFailedStmt(IEMNATIVE_DO_LONGJMP(pReNative, VERR_IPE_NOT_REACHED_DEFAULT_CASE)); 5746 /* The source doesn't has the part loaded, so load the register from CPUMCTX. */ 5747 Assert(enmLoadSzDst == kIemNativeGstSimdRegLdStSz_Low128 || enmLoadSzDst == kIemNativeGstSimdRegLdStSz_High128); 5748 off = iemNativeEmitLoadSimdRegWithGstShadowSimdReg(pReNative, off, idxHstSimdRegDst, enmGstSimdRegDst, enmLoadSzDst); 5748 5749 } 5749 5750 … … 5826 5827 uint8_t const idxRegNew = iemNativeSimdRegAllocTmpEx(pReNative, poff, fRegMask); 5827 5828 5828 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, idxRegNew, idxSimdReg, enmLoadSz);5829 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, enmGstSimdReg, idxRegNew, idxSimdReg, enmLoadSz); 5829 5830 5830 5831 Log12(("iemNativeSimdRegAllocTmpForGuestSimdReg: Duplicated %s for guest %s into %s for destructive calc\n", … … 5842 5843 { 5843 5844 if (enmIntendedUse != kIemNativeGstRegUse_ForFullWrite) 5844 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, idxSimdReg, idxSimdReg, enmLoadSz);5845 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, enmGstSimdReg, idxSimdReg, idxSimdReg, enmLoadSz); 5845 5846 else 5846 5847 iemNativeSimdRegSetValidLoadFlag(pReNative, idxSimdReg, enmLoadSz); … … 5864 5865 !fNoVolatileRegs 5865 5866 && enmIntendedUse == kIemNativeGstRegUse_Calculation); 5866 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, idxRegNew, idxSimdReg, enmLoadSz);5867 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, enmGstSimdReg, idxRegNew, idxSimdReg, enmLoadSz); 5867 5868 if (enmIntendedUse != kIemNativeGstRegUse_Calculation) 5868 5869 { … … 5897 5898 5898 5899 if (enmIntendedUse != kIemNativeGstRegUse_ForFullWrite) 5899 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, idxRegNew, idxSimdReg, enmLoadSz);5900 *poff = iemNativeSimdRegAllocLoadVecRegFromVecRegSz(pReNative, *poff, enmGstSimdReg, idxRegNew, idxSimdReg, enmLoadSz); 5900 5901 else 5901 5902 iemNativeSimdRegSetValidLoadFlag(pReNative, idxRegNew, enmLoadSz); -
trunk/src/VBox/VMM/include/IEMN8veRecompilerEmit.h
r104030 r104033 7989 7989 7990 7990 /** 7991 * Emits a vecdst[128:255] = vecsrc[128:255] load. 7992 */ 7993 DECL_FORCE_INLINE_THROW(uint32_t) 7994 iemNativeEmitSimdLoadVecRegHighU128FromVecRegHighU128Ex(PIEMNATIVEINSTR pCodeBuf, uint32_t off, uint8_t iVecRegDst, uint8_t iVecRegSrc) 7995 { 7996 #ifdef RT_ARCH_AMD64 7997 /* vperm2i128 dst, dst, src, 0x30. */ /* ASSUMES AVX2 support */ 7998 pCodeBuf[off++] = X86_OP_VEX3; 7999 pCodeBuf[off++] = X86_OP_VEX3_BYTE1_MAKE(0x3, iVecRegSrc >= 8, false, iVecRegDst >= 8); 8000 pCodeBuf[off++] = X86_OP_VEX3_BYTE2_MAKE(false, iVecRegDst, true, X86_OP_VEX3_BYTE2_P_066H); 8001 pCodeBuf[off++] = 0x46; 8002 pCodeBuf[off++] = X86_MODRM_MAKE(X86_MOD_REG, iVecRegDst & 7, iVecRegSrc & 7); 8003 pCodeBuf[off++] = 0x30; /* Immediate, this will leave the low 128 bits of dst untouched and move the high 128 bits from src to dst. */ 8004 8005 #elif defined(RT_ARCH_ARM64) 8006 RT_NOREF(pCodeBuf, iVecRegDst, iVecRegSrc); 8007 8008 /* Should never be called because we can just use iemNativeEmitSimdLoadVecRegFromVecRegU128(). */ 8009 # ifdef IEM_WITH_THROW_CATCH 8010 AssertFailedStmt(IEMNATIVE_DO_LONGJMP(NULL, VERR_IEM_IPE_9)); 8011 # else 8012 AssertReleaseFailedStmt(off = UINT32_MAX); 8013 # endif 8014 #else 8015 # error "port me" 8016 #endif 8017 return off; 8018 } 8019 8020 8021 /** 8022 * Emits a vecdst[128:255] = vecsrc[128:255] load, high 128-bit. 8023 */ 8024 DECL_INLINE_THROW(uint32_t) 8025 iemNativeEmitSimdLoadVecRegHighU128FromVecRegHighU128(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iVecRegDst, uint8_t iVecRegSrc) 8026 { 8027 #ifdef RT_ARCH_AMD64 8028 off = iemNativeEmitSimdLoadVecRegHighU128FromVecRegHighU128Ex(iemNativeInstrBufEnsure(pReNative, off, 5), off, iVecRegDst, iVecRegSrc); 8029 #elif defined(RT_ARCH_ARM64) 8030 Assert(!(iVecRegDst & 0x1) && !(iVecRegSrc & 0x1)); 8031 off = iemNativeEmitSimdLoadVecRegFromVecRegU128Ex(iemNativeInstrBufEnsure(pReNative, off, 1), off, iVecRegDst + 1, iVecRegSrc + 1); 8032 #else 8033 # error "port me" 8034 #endif 8035 IEMNATIVE_ASSERT_INSTR_BUF_ENSURE(pReNative, off); 8036 return off; 8037 } 8038 8039 8040 /** 7991 8041 * Emits a vecdst = vecsrc load, 256-bit. 7992 8042 */
Note:
See TracChangeset
for help on using the changeset viewer.