- Timestamp:
- Aug 13, 2024 7:27:02 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
r105655 r105656 3772 3772 3773 3773 #define IEM_MC_FETCH_GREG_I16(a_i16Dst, a_iGReg) \ 3774 off = iemNativeEmitFetchGregU16Sx(pReNative, off, a_i16Dst, a_iGReg, sizeof(uint32_t)) /* Note! ON ARM we use 32-bit registers for 16-bit. */ 3774 off = iemNativeEmitFetchGregI16(pReNative, off, a_i16Dst, a_iGReg) 3775 3776 /** Emits code for IEM_MC_FETCH_GREG_I16. */ 3777 DECL_INLINE_THROW(uint32_t) 3778 iemNativeEmitFetchGregI16(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t idxDstVar, uint8_t iGReg) 3779 { 3780 IEMNATIVE_ASSERT_VAR_IDX(pReNative, idxDstVar); 3781 IEMNATIVE_ASSERT_VAR_SIZE(pReNative, idxDstVar, sizeof(int16_t)); 3782 Assert(iGReg < 16); 3783 3784 /* 3785 * We can either just load the low 16-bit of the GPR into a host register 3786 * for the variable, or we can do so via a shadow copy host register. The 3787 * latter will avoid having to reload it if it's being stored later, but 3788 * will waste a host register if it isn't touched again. Since we don't 3789 * know what going to happen, we choose the latter for now. 3790 */ 3791 uint8_t const idxGstFullReg = iemNativeRegAllocTmpForGuestReg(pReNative, &off, IEMNATIVEGSTREG_GPR(iGReg), 3792 kIemNativeGstRegUse_ReadOnly); 3793 3794 iemNativeVarSetKindToStack(pReNative, idxDstVar); 3795 uint8_t const idxVarReg = iemNativeVarRegisterAcquire(pReNative, idxDstVar, &off); 3796 #ifdef RT_ARCH_ARM64 /* Note! There are no 16-bit registers on ARM, we emulate that through 32-bit registers which requires sign extension. */ 3797 off = iemNativeEmitLoadGpr32SignExtendedFromGpr16(pReNative, off, idxVarReg, idxGstFullReg); 3798 #endif 3799 iemNativeVarRegisterRelease(pReNative, idxDstVar); 3800 3801 iemNativeRegFreeTmp(pReNative, idxGstFullReg); 3802 return off; 3803 } 3804 3775 3805 3776 3806 #define IEM_MC_FETCH_GREG_U16_SX_U32(a_u16Dst, a_iGReg) \ … … 6952 6982 #define IEM_MC_FETCH_MEM_I16(a_i16Dst, a_iSeg, a_GCPtrMem) \ 6953 6983 off = iemNativeEmitMemFetchStoreDataCommon(pReNative, off, a_i16Dst, a_iSeg, a_GCPtrMem, \ 6954 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch , \6984 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch_Sx_U32, \ 6955 6985 (uintptr_t)iemNativeHlpMemFetchDataU16_Sx_U32, pCallEntry->idxInstr) 6956 6986 6957 6987 #define IEM_MC_FETCH_MEM_I16_DISP(a_i16Dst, a_iSeg, a_GCPtrMem, a_offDisp) \ 6958 6988 off = iemNativeEmitMemFetchStoreDataCommon(pReNative, off, a_i16Dst, a_iSeg, a_GCPtrMem, \ 6959 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch , \6989 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch_Sx_U32, \ 6960 6990 (uintptr_t)iemNativeHlpMemFetchDataU16_Sx_U32, pCallEntry->idxInstr, a_offDisp) 6961 6991 … … 7086 7116 #define IEM_MC_FETCH_MEM_FLAT_I16(a_i16Dst, a_GCPtrMem) \ 7087 7117 off = iemNativeEmitMemFetchStoreDataCommon(pReNative, off, a_i16Dst, UINT8_MAX, a_GCPtrMem, \ 7088 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch , \7118 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch_Sx_U32, \ 7089 7119 (uintptr_t)iemNativeHlpMemFlatFetchDataU16_Sx_U32, pCallEntry->idxInstr) 7090 7120 7091 7121 #define IEM_MC_FETCH_MEM_FLAT_I16_DISP(a_i16Dst, a_GCPtrMem, a_offDisp) \ 7092 7122 off = iemNativeEmitMemFetchStoreDataCommon(pReNative, off, a_i16Dst, UINT8_MAX, a_GCPtrMem, \ 7093 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch , \7123 sizeof(int16_t), sizeof(int16_t) - 1, kIemNativeEmitMemOp_Fetch_Sx_U32, \ 7094 7124 (uintptr_t)iemNativeHlpMemFlatFetchDataU16_Sx_U32, pCallEntry->idxInstr, a_offDisp) 7095 7125
Note:
See TracChangeset
for help on using the changeset viewer.