Changeset 104135 in vbox
- Timestamp:
- Apr 3, 2024 1:18:38 PM (8 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r104132 r104135 4817 4817 4818 4818 ;; 4819 ; Need to move this as well somewhere better?4820 ;4821 struc IEMAVX128RESULT4822 .uResult resd 44823 .MXCSR resd 14824 endstruc4825 4826 4827 ;;4828 ; Need to move this as well somewhere better?4829 ;4830 struc IEMAVX256RESULT4831 .uResult resd 84832 .MXCSR resd 14833 endstruc4834 4835 4836 ;;4837 4819 ; Initialize the SSE MXCSR register using the guest value partially to 4838 4820 ; account for rounding mode, load the value from the given register. … … 4841 4823 ; @param 1 Expression giving the register holding the guest's MXCSR. 4842 4824 ; 4843 %macro SSE_ LD_MXCSR 14825 %macro SSE_AVX_LD_MXCSR 1 4844 4826 sub xSP, 4 4845 4827 … … 4864 4846 ; @note Restores the stack pointer. 4865 4847 ; 4866 %macro SSE_ ST_MXCSR 24848 %macro SSE_AVX_ST_MXCSR 2 4867 4849 sub xSP, 4 4868 4850 stmxcsr [xSP] … … 4879 4861 4880 4862 ;; 4881 ; Initialize the SSE MXCSR register using the guest value partially to4882 ; account for rounding mode.4883 ;4884 ; @uses 4 bytes of stack to save the original value.4885 ; @param 1 Expression giving the address of the FXSTATE of the guest.4886 ;4887 %macro AVX_LD_XSAVEAREA_MXCSR 14888 sub xSP, 44889 4890 stmxcsr [xSP]4891 mov T0_32, [%1 + X86FXSTATE.MXCSR]4892 and T0_32, X86_MXCSR_FZ | X86_MXCSR_RC_MASK | X86_MXCSR_DAZ4893 sub xSP, 44894 mov [xSP], T0_324895 ldmxcsr [xSP]4896 add xSP, 44897 %endmacro4898 4899 4900 ;;4901 ; Restores the AVX128 MXCSR register with the original value.4902 ;4903 ; @param 1 Expression giving the address where to return the MXCSR value.4904 ;4905 ; @note Restores the stack pointer.4906 ;4907 %macro AVX128_ST_XSAVEAREA_MXCSR 14908 stmxcsr [%1 + IEMAVX128RESULT.MXCSR]4909 4910 ldmxcsr [xSP]4911 add xSP, 44912 %endmacro4913 4914 4915 ;;4916 ; Restores the AVX256 MXCSR register with the original value.4917 ;4918 ; @param 1 Expression giving the address where to return the MXCSR value.4919 ;4920 ; @note Restores the stack pointer.4921 ;4922 %macro AVX256_ST_XSAVEAREA_MXCSR 14923 stmxcsr [%1 + IEMAVX256RESULT.MXCSR]4924 4925 ldmxcsr [xSP]4926 add xSP, 44927 %endmacro4928 4929 4930 ;;4931 4863 ; Floating point instruction working on two full sized registers. 4932 4864 ; … … 4944 4876 PROLOGUE_4_ARGS 4945 4877 IEMIMPL_SSE_PROLOGUE 4946 SSE_ LD_MXCSR A0_324878 SSE_AVX_LD_MXCSR A0_32 4947 4879 4948 4880 movdqu xmm0, [A2] … … 4951 4883 movdqu [A1], xmm0 4952 4884 4953 SSE_ ST_MXCSR R0_32, A0_324885 SSE_AVX_ST_MXCSR R0_32, A0_32 4954 4886 IEMIMPL_SSE_PROLOGUE 4955 4887 EPILOGUE_4_ARGS … … 4960 4892 PROLOGUE_4_ARGS 4961 4893 IEMIMPL_AVX_PROLOGUE 4962 AVX_LD_XSAVEAREA_MXCSR A04894 SSE_AVX_LD_MXCSR A0_32 4963 4895 4964 4896 vmovdqu xmm0, [A2] … … 4967 4899 vmovdqu [A1 + IEMAVX128RESULT.uResult], xmm0 4968 4900 4969 AVX128_ST_XSAVEAREA_MXCSR A14901 SSE_AVX_ST_MXCSR R0_32, A0_32 4970 4902 IEMIMPL_AVX_PROLOGUE 4971 4903 EPILOGUE_4_ARGS … … 4975 4907 PROLOGUE_4_ARGS 4976 4908 IEMIMPL_AVX_PROLOGUE 4977 AVX_LD_XSAVEAREA_MXCSR A04909 SSE_AVX_LD_MXCSR A0_32 4978 4910 4979 4911 vmovdqu ymm0, [A2] … … 4982 4914 vmovdqu [A1 + IEMAVX256RESULT.uResult], ymm0 4983 4915 4984 AVX256_ST_XSAVEAREA_MXCSR A14916 SSE_AVX_ST_MXCSR R0_32, A0_32 4985 4917 IEMIMPL_AVX_PROLOGUE 4986 4918 EPILOGUE_4_ARGS … … 4990 4922 PROLOGUE_4_ARGS 4991 4923 IEMIMPL_AVX_PROLOGUE 4992 AVX_LD_XSAVEAREA_MXCSR A04924 SSE_AVX_LD_MXCSR A0_32 4993 4925 4994 4926 vmovdqu xmm0, [A2] … … 4997 4929 vmovdqu [A1 + IEMAVX128RESULT.uResult], xmm0 4998 4930 4999 AVX128_ST_XSAVEAREA_MXCSR A14931 SSE_AVX_ST_MXCSR R0_32, A0_32 5000 4932 IEMIMPL_AVX_PROLOGUE 5001 4933 EPILOGUE_4_ARGS … … 5005 4937 PROLOGUE_4_ARGS 5006 4938 IEMIMPL_AVX_PROLOGUE 5007 AVX_LD_XSAVEAREA_MXCSR A04939 SSE_AVX_LD_MXCSR A0_32 5008 4940 5009 4941 vmovdqu ymm0, [A2] … … 5012 4944 vmovdqu [A1 + IEMAVX256RESULT.uResult], ymm0 5013 4945 5014 AVX256_ST_XSAVEAREA_MXCSR A14946 SSE_AVX_ST_MXCSR R0_32, A0_32 5015 4947 IEMIMPL_AVX_PROLOGUE 5016 4948 EPILOGUE_4_ARGS … … 5071 5003 PROLOGUE_4_ARGS 5072 5004 IEMIMPL_SSE_PROLOGUE 5073 SSE_ LD_MXCSR A0_325005 SSE_AVX_LD_MXCSR A0_32 5074 5006 5075 5007 movdqu xmm0, [A2] … … 5078 5010 movdqu [A1], xmm0 5079 5011 5080 SSE_ ST_MXCSR R0_32, A0_325012 SSE_AVX_ST_MXCSR R0_32, A0_32 5081 5013 IEMIMPL_SSE_EPILOGUE 5082 5014 EPILOGUE_4_ARGS … … 5126 5058 PROLOGUE_4_ARGS 5127 5059 IEMIMPL_SSE_PROLOGUE 5128 SSE_ LD_MXCSR A0_325060 SSE_AVX_LD_MXCSR A0_32 5129 5061 5130 5062 movdqu xmm0, [A2] … … 5133 5065 movdqu [A1], xmm0 5134 5066 5135 SSE_ ST_MXCSR R0_32, A0_325067 SSE_AVX_ST_MXCSR R0_32, A0_32 5136 5068 IEMIMPL_SSE_EPILOGUE 5137 5069 EPILOGUE_4_ARGS … … 5180 5112 PROLOGUE_4_ARGS 5181 5113 IEMIMPL_SSE_PROLOGUE 5182 SSE_ LD_MXCSR A0_325114 SSE_AVX_LD_MXCSR A0_32 5183 5115 5184 5116 movdqu xmm0, [A2] … … 5187 5119 movdqu [A1], xmm0 5188 5120 5189 SSE_ ST_MXCSR R0_32, A0_325121 SSE_AVX_ST_MXCSR R0_32, A0_32 5190 5122 IEMIMPL_SSE_EPILOGUE 5191 5123 EPILOGUE_4_ARGS … … 5990 5922 PROLOGUE_4_ARGS 5991 5923 IEMIMPL_SSE_PROLOGUE 5992 SSE_ LD_MXCSR A0_325924 SSE_AVX_LD_MXCSR A0_32 5993 5925 5994 5926 cvttsd2si T0_32, [A2] 5995 5927 mov dword [A1], T0_32 5996 5928 5997 SSE_ ST_MXCSR R0_32, A0_325929 SSE_AVX_ST_MXCSR R0_32, A0_32 5998 5930 IEMIMPL_SSE_EPILOGUE 5999 5931 EPILOGUE_4_ARGS … … 6011 5943 PROLOGUE_3_ARGS 6012 5944 IEMIMPL_SSE_PROLOGUE 6013 SSE_ LD_MXCSR A0_325945 SSE_AVX_LD_MXCSR A0_32 6014 5946 6015 5947 cvttsd2si T0, [A2] 6016 5948 mov qword [A1], T0 6017 5949 6018 SSE_ ST_MXCSR R0_32, A0_325950 SSE_AVX_ST_MXCSR R0_32, A0_32 6019 5951 IEMIMPL_SSE_EPILOGUE 6020 5952 EPILOGUE_3_ARGS … … 6033 5965 PROLOGUE_3_ARGS 6034 5966 IEMIMPL_SSE_PROLOGUE 6035 SSE_ LD_MXCSR A0_325967 SSE_AVX_LD_MXCSR A0_32 6036 5968 6037 5969 cvtsd2si T0_32, [A2] 6038 5970 mov dword [A1], T0_32 6039 5971 6040 SSE_ ST_MXCSR R0_32, A0_325972 SSE_AVX_ST_MXCSR R0_32, A0_32 6041 5973 IEMIMPL_SSE_EPILOGUE 6042 5974 EPILOGUE_3_ARGS … … 6054 5986 PROLOGUE_3_ARGS 6055 5987 IEMIMPL_SSE_PROLOGUE 6056 SSE_ LD_MXCSR A0_325988 SSE_AVX_LD_MXCSR A0_32 6057 5989 6058 5990 cvtsd2si T0, [A2] 6059 5991 mov qword [A1], T0 6060 5992 6061 SSE_ ST_MXCSR R0_32, A0_325993 SSE_AVX_ST_MXCSR R0_32, A0_32 6062 5994 IEMIMPL_SSE_EPILOGUE 6063 5995 EPILOGUE_3_ARGS … … 6076 6008 PROLOGUE_3_ARGS 6077 6009 IEMIMPL_SSE_PROLOGUE 6078 SSE_ LD_MXCSR A0_326010 SSE_AVX_LD_MXCSR A0_32 6079 6011 6080 6012 cvttss2si T0_32, [A2] 6081 6013 mov dword [A1], T0_32 6082 6014 6083 SSE_ ST_MXCSR R0_32, A0_326015 SSE_AVX_ST_MXCSR R0_32, A0_32 6084 6016 IEMIMPL_SSE_EPILOGUE 6085 6017 EPILOGUE_3_ARGS … … 6097 6029 PROLOGUE_3_ARGS 6098 6030 IEMIMPL_SSE_PROLOGUE 6099 SSE_ LD_MXCSR A0_326031 SSE_AVX_LD_MXCSR A0_32 6100 6032 6101 6033 cvttss2si T0, [A2] 6102 6034 mov qword [A1], T0 6103 6035 6104 SSE_ ST_MXCSR R0_32, A0_326036 SSE_AVX_ST_MXCSR R0_32, A0_32 6105 6037 IEMIMPL_SSE_EPILOGUE 6106 6038 EPILOGUE_3_ARGS … … 6119 6051 PROLOGUE_3_ARGS 6120 6052 IEMIMPL_SSE_PROLOGUE 6121 SSE_ LD_MXCSR A0_326053 SSE_AVX_LD_MXCSR A0_32 6122 6054 6123 6055 cvtss2si T0_32, [A2] 6124 6056 mov dword [A1], T0_32 6125 6057 6126 SSE_ ST_MXCSR R0_32, A0_326058 SSE_AVX_ST_MXCSR R0_32, A0_32 6127 6059 IEMIMPL_SSE_EPILOGUE 6128 6060 EPILOGUE_3_ARGS … … 6140 6072 PROLOGUE_3_ARGS 6141 6073 IEMIMPL_SSE_PROLOGUE 6142 SSE_ LD_MXCSR A0_326074 SSE_AVX_LD_MXCSR A0_32 6143 6075 6144 6076 cvtss2si T0, [A2] 6145 6077 mov qword [A1], T0 6146 6078 6147 SSE_ ST_MXCSR R0_32, A0_326079 SSE_AVX_ST_MXCSR R0_32, A0_32 6148 6080 IEMIMPL_SSE_EPILOGUE 6149 6081 EPILOGUE_3_ARGS … … 6162 6094 PROLOGUE_3_ARGS 6163 6095 IEMIMPL_SSE_PROLOGUE 6164 SSE_ LD_MXCSR A0_326096 SSE_AVX_LD_MXCSR A0_32 6165 6097 6166 6098 cvtsi2ss xmm0, dword [A2] 6167 6099 movd dword [A1], xmm0 6168 6100 6169 SSE_ ST_MXCSR R0_32, A0_326101 SSE_AVX_ST_MXCSR R0_32, A0_32 6170 6102 IEMIMPL_SSE_EPILOGUE 6171 6103 EPILOGUE_3_ARGS … … 6183 6115 PROLOGUE_3_ARGS 6184 6116 IEMIMPL_SSE_PROLOGUE 6185 SSE_ LD_MXCSR A0_326117 SSE_AVX_LD_MXCSR A0_32 6186 6118 6187 6119 cvtsi2ss xmm0, qword [A2] 6188 6120 movd dword [A1], xmm0 6189 6121 6190 SSE_ ST_MXCSR R0_32, A0_326122 SSE_AVX_ST_MXCSR R0_32, A0_32 6191 6123 IEMIMPL_SSE_EPILOGUE 6192 6124 EPILOGUE_3_ARGS … … 6205 6137 PROLOGUE_3_ARGS 6206 6138 IEMIMPL_SSE_PROLOGUE 6207 SSE_ LD_MXCSR A0_326139 SSE_AVX_LD_MXCSR A0_32 6208 6140 6209 6141 cvtsi2sd xmm0, dword [A2] 6210 6142 movq [A1], xmm0 6211 6143 6212 SSE_ ST_MXCSR R0_32, A0_326144 SSE_AVX_ST_MXCSR R0_32, A0_32 6213 6145 IEMIMPL_SSE_EPILOGUE 6214 6146 EPILOGUE_3_ARGS … … 6226 6158 PROLOGUE_3_ARGS 6227 6159 IEMIMPL_SSE_PROLOGUE 6228 SSE_ LD_MXCSR A0_326160 SSE_AVX_LD_MXCSR A0_32 6229 6161 6230 6162 cvtsi2sd xmm0, qword [A2] 6231 6163 movq [A1], xmm0 6232 6164 6233 SSE_ ST_MXCSR R0_32, A0_326165 SSE_AVX_ST_MXCSR R0_32, A0_32 6234 6166 IEMIMPL_SSE_EPILOGUE 6235 6167 EPILOGUE_3_ARGS … … 6249 6181 PROLOGUE_4_ARGS 6250 6182 IEMIMPL_SSE_PROLOGUE 6251 SSE_ LD_MXCSR A0_326183 SSE_AVX_LD_MXCSR A0_32 6252 6184 6253 6185 movdqu xmm0, [A2] … … 6256 6188 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6257 6189 6258 SSE_ ST_MXCSR R0_32, A0_326190 SSE_AVX_ST_MXCSR R0_32, A0_32 6259 6191 IEMIMPL_SSE_EPILOGUE 6260 6192 EPILOGUE_4_ARGS … … 6264 6196 PROLOGUE_4_ARGS 6265 6197 IEMIMPL_SSE_PROLOGUE 6266 SSE_ LD_MXCSR A0_326198 SSE_AVX_LD_MXCSR A0_32 6267 6199 6268 6200 movdqu xmm0, [A2] … … 6271 6203 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6272 6204 6273 SSE_ ST_MXCSR R0_32, A0_326205 SSE_AVX_ST_MXCSR R0_32, A0_32 6274 6206 IEMIMPL_SSE_EPILOGUE 6275 6207 EPILOGUE_3_ARGS … … 6289 6221 PROLOGUE_4_ARGS 6290 6222 IEMIMPL_SSE_PROLOGUE 6291 SSE_ LD_MXCSR A0_326223 SSE_AVX_LD_MXCSR A0_32 6292 6224 6293 6225 movdqu xmm0, [A2] … … 6296 6228 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6297 6229 6298 SSE_ ST_MXCSR R0_32, A0_326230 SSE_AVX_ST_MXCSR R0_32, A0_32 6299 6231 IEMIMPL_SSE_EPILOGUE 6300 6232 EPILOGUE_4_ARGS … … 6304 6236 PROLOGUE_4_ARGS 6305 6237 IEMIMPL_SSE_PROLOGUE 6306 SSE_ LD_MXCSR A0_326238 SSE_AVX_LD_MXCSR A0_32 6307 6239 6308 6240 movdqu xmm0, [A2] … … 6311 6243 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6312 6244 6313 SSE_ ST_MXCSR R0_32, A0_326245 SSE_AVX_ST_MXCSR R0_32, A0_32 6314 6246 IEMIMPL_SSE_EPILOGUE 6315 6247 EPILOGUE_4_ARGS … … 6328 6260 PROLOGUE_4_ARGS 6329 6261 IEMIMPL_SSE_PROLOGUE 6330 SSE_ LD_MXCSR A0_326262 SSE_AVX_LD_MXCSR A0_32 6331 6263 6332 6264 movdqu xmm0, [A2] … … 6335 6267 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6336 6268 6337 SSE_ ST_MXCSR R0_32, A0_326269 SSE_AVX_ST_MXCSR R0_32, A0_32 6338 6270 IEMIMPL_SSE_EPILOGUE 6339 6271 EPILOGUE_4_ARGS … … 6343 6275 PROLOGUE_4_ARGS 6344 6276 IEMIMPL_SSE_PROLOGUE 6345 SSE_ LD_MXCSR A0_326277 SSE_AVX_LD_MXCSR A0_32 6346 6278 6347 6279 movdqu xmm0, [A2] … … 6350 6282 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6351 6283 6352 SSE_ ST_MXCSR R0_32, A0_326284 SSE_AVX_ST_MXCSR R0_32, A0_32 6353 6285 IEMIMPL_SSE_EPILOGUE 6354 6286 EPILOGUE_4_ARGS … … 6368 6300 PROLOGUE_4_ARGS 6369 6301 IEMIMPL_SSE_PROLOGUE 6370 SSE_ LD_MXCSR A0_326302 SSE_AVX_LD_MXCSR A0_32 6371 6303 6372 6304 movdqu xmm0, [A2] … … 6375 6307 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6376 6308 6377 SSE_ ST_MXCSR R0_32, A0_326309 SSE_AVX_ST_MXCSR R0_32, A0_32 6378 6310 IEMIMPL_SSE_EPILOGUE 6379 6311 EPILOGUE_4_ARGS … … 6383 6315 PROLOGUE_4_ARGS 6384 6316 IEMIMPL_SSE_PROLOGUE 6385 SSE_ LD_MXCSR A0_326317 SSE_AVX_LD_MXCSR A0_32 6386 6318 6387 6319 movdqu xmm0, [A2] … … 6390 6322 IEM_SAVE_FLAGS A1, X86_EFL_ZF | X86_EFL_PF | X86_EFL_CF, 0, X86_EFL_OF | X86_EFL_SF | X86_EFL_AF 6391 6323 6392 SSE_ ST_MXCSR R0_32, A0_326324 SSE_AVX_ST_MXCSR R0_32, A0_32 6393 6325 IEMIMPL_SSE_EPILOGUE 6394 6326 EPILOGUE_4_ARGS -
trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py
r104133 r104135 2995 2995 'IEM_MC_CALL_AVX_AIMPL_2': (McBlock.parseMcCallAvxAImpl, True, True, g_fNativeSimd), 2996 2996 'IEM_MC_CALL_AVX_AIMPL_3': (McBlock.parseMcCallAvxAImpl, True, True, g_fNativeSimd), 2997 'IEM_MC_CALL_AVX_AIMPL_NEW_3': (McBlock.parseMcCallAvxAImpl, True, True, False, ),2998 2997 'IEM_MC_CALL_CIMPL_0': (McBlock.parseMcCallCImpl, True, True, False, ), 2999 2998 'IEM_MC_CALL_CIMPL_1': (McBlock.parseMcCallCImpl, True, True, False, ), -
trunk/src/VBox/VMM/VMMAll/IEMAllInstVexMap1.cpp.h
r104133 r104135 2343 2343 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2344 2344 IEM_MC_REF_XREG_XMM_CONST(puSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); 2345 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomiss_u128, iemAImpl_vucomiss_u128_fallback),2346 2345 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomiss_u128, iemAImpl_vucomiss_u128_fallback), 2346 pEFlags, puSrc1, puSrc2); 2347 2347 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2348 2348 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2375 2375 IEM_MC_FETCH_EFLAGS(fEFlags); 2376 2376 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2377 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomiss_u128, iemAImpl_vucomiss_u128_fallback),2378 2377 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomiss_u128, iemAImpl_vucomiss_u128_fallback), 2378 pEFlags, puSrc1, puSrc2); 2379 2379 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2380 2380 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2415 2415 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2416 2416 IEM_MC_REF_XREG_XMM_CONST(puSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); 2417 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomisd_u128, iemAImpl_vucomisd_u128_fallback),2418 2417 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomisd_u128, iemAImpl_vucomisd_u128_fallback), 2418 pEFlags, puSrc1, puSrc2); 2419 2419 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2420 2420 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2447 2447 IEM_MC_FETCH_EFLAGS(fEFlags); 2448 2448 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2449 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomisd_u128, iemAImpl_vucomisd_u128_fallback),2450 2449 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vucomisd_u128, iemAImpl_vucomisd_u128_fallback), 2450 pEFlags, puSrc1, puSrc2); 2451 2451 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2452 2452 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2490 2490 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2491 2491 IEM_MC_REF_XREG_XMM_CONST(puSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); 2492 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomiss_u128, iemAImpl_vcomiss_u128_fallback),2493 2492 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomiss_u128, iemAImpl_vcomiss_u128_fallback), 2493 pEFlags, puSrc1, puSrc2); 2494 2494 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2495 2495 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2522 2522 IEM_MC_FETCH_EFLAGS(fEFlags); 2523 2523 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2524 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomiss_u128, iemAImpl_vcomiss_u128_fallback),2525 2524 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomiss_u128, iemAImpl_vcomiss_u128_fallback), 2525 pEFlags, puSrc1, puSrc2); 2526 2526 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2527 2527 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2562 2562 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2563 2563 IEM_MC_REF_XREG_XMM_CONST(puSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); 2564 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomisd_u128, iemAImpl_vcomisd_u128_fallback),2565 2564 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomisd_u128, iemAImpl_vcomisd_u128_fallback), 2565 pEFlags, puSrc1, puSrc2); 2566 2566 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2567 2567 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); … … 2594 2594 IEM_MC_FETCH_EFLAGS(fEFlags); 2595 2595 IEM_MC_REF_XREG_XMM_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 2596 IEM_MC_CALL_AVX_AIMPL_ NEW_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomisd_u128, iemAImpl_vcomisd_u128_fallback),2597 2596 IEM_MC_CALL_AVX_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_vcomisd_u128, iemAImpl_vcomisd_u128_fallback), 2597 pEFlags, puSrc1, puSrc2); 2598 2598 IEM_MC_IF_MXCSR_XCPT_PENDING() { 2599 2599 IEM_MC_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veLiveness.cpp
r104133 r104135 1102 1102 #define IEM_MC_CALL_SSE_AIMPL_2(a_pfnAImpl, a0, a1) IEM_LIVENESS_MXCSR_MODIFY() 1103 1103 #define IEM_MC_CALL_SSE_AIMPL_3(a_pfnAImpl, a0, a1, a2) IEM_LIVENESS_MXCSR_MODIFY() 1104 #define IEM_MC_CALL_AVX_AIMPL_2(a_pfnAImpl, a0, a1) NOP() 1105 #define IEM_MC_CALL_AVX_AIMPL_3(a_pfnAImpl, a0, a1, a2) NOP() 1106 #define IEM_MC_CALL_AVX_AIMPL_NEW_3(a_pfnAImpl, a0, a1, a2) IEM_LIVENESS_MXCSR_MODIFY() 1104 #define IEM_MC_CALL_AVX_AIMPL_2(a_pfnAImpl, a0, a1) IEM_LIVENESS_MXCSR_MODIFY() 1105 #define IEM_MC_CALL_AVX_AIMPL_3(a_pfnAImpl, a0, a1, a2) IEM_LIVENESS_MXCSR_MODIFY() 1107 1106 1108 1107 #define IEM_LIVENESS_ONE_STATUS_EFLAG_INPUT(a_fBit) \ -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
r104133 r104135 8718 8718 8719 8719 /** 8720 * Common worker for IEM_MC_CALL_SSE_AIMPL_XXX .8720 * Common worker for IEM_MC_CALL_SSE_AIMPL_XXX/IEM_MC_CALL_AVX_AIMPL_XXX. 8721 8721 */ 8722 8722 DECL_INLINE_THROW(uint32_t) 8723 iemNativeEmitCallSseA ImplCommon(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl, uint8_t cArgs)8723 iemNativeEmitCallSseAvxAImplCommon(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl, uint8_t cArgs) 8724 8724 { 8725 8725 /* Grab the MXCSR register, it must not be call volatile or we end up freeing it when setting up the call below. */ … … 8773 8773 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg0, 0 + IEM_SSE_AIMPL_HIDDEN_ARGS); 8774 8774 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg1, 1 + IEM_SSE_AIMPL_HIDDEN_ARGS); 8775 return iemNativeEmitCallSseA ImplCommon(pReNative, off, pfnAImpl, 2);8775 return iemNativeEmitCallSseAvxAImplCommon(pReNative, off, pfnAImpl, 2); 8776 8776 } 8777 8777 … … 8787 8787 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg1, 1 + IEM_SSE_AIMPL_HIDDEN_ARGS); 8788 8788 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg2, 2 + IEM_SSE_AIMPL_HIDDEN_ARGS); 8789 return iemNativeEmitCallSseA ImplCommon(pReNative, off, pfnAImpl, 3);8789 return iemNativeEmitCallSseAvxAImplCommon(pReNative, off, pfnAImpl, 3); 8790 8790 } 8791 8791 … … 8795 8795 *********************************************************************************************************************************/ 8796 8796 8797 /**8798 * Common worker for IEM_MC_CALL_AVX_AIMPL_XXX.8799 */8800 DECL_INLINE_THROW(uint32_t)8801 iemNativeEmitCallAvxAImplCommon(PIEMRECOMPILERSTATE pReNative, uint32_t off, uintptr_t pfnAImpl, uint8_t cArgs)8802 {8803 /*8804 * Need to do the FPU preparation.8805 */8806 off = iemNativeEmitPrepareFpuForUse(pReNative, off, true /*fForChange*/);8807 8808 /*8809 * Do all the call setup and cleanup.8810 */8811 off = iemNativeEmitCallCommon(pReNative, off, cArgs + IEM_AVX_AIMPL_HIDDEN_ARGS, IEM_AVX_AIMPL_HIDDEN_ARGS);8812 8813 /*8814 * Load the XState pointer.8815 */8816 off = iemNativeEmitLeaGprByGstRegRef(pReNative, off, IEMNATIVE_CALL_ARG0_GREG, kIemNativeGstRegRef_XState, 0 /*idxRegInClass*/);8817 8818 /*8819 * Make the call.8820 */8821 off = iemNativeEmitCallImm(pReNative, off, pfnAImpl);8822 8823 return off;8824 }8825 8826 8827 8797 #define IEM_MC_CALL_AVX_AIMPL_2(a_pfnAImpl, a0, a1) \ 8828 8798 off = iemNativeEmitCallAvxAImpl2(pReNative, off, (uintptr_t)(a_pfnAImpl), (a0), (a1)) … … 8834 8804 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg0, 0 + IEM_AVX_AIMPL_HIDDEN_ARGS); 8835 8805 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg1, 1 + IEM_AVX_AIMPL_HIDDEN_ARGS); 8836 return iemNativeEmitCall AvxAImplCommon(pReNative, off, pfnAImpl, 2);8806 return iemNativeEmitCallSseAvxAImplCommon(pReNative, off, pfnAImpl, 2); 8837 8807 } 8838 8808 … … 8848 8818 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg1, 1 + IEM_AVX_AIMPL_HIDDEN_ARGS); 8849 8819 IEMNATIVE_ASSERT_ARG_VAR_IDX(pReNative, idxArg2, 2 + IEM_AVX_AIMPL_HIDDEN_ARGS); 8850 return iemNativeEmitCall AvxAImplCommon(pReNative, off, pfnAImpl, 3);8820 return iemNativeEmitCallSseAvxAImplCommon(pReNative, off, pfnAImpl, 3); 8851 8821 } 8852 8822 #endif /* IEMNATIVE_WITH_SIMD_REG_ALLOCATOR */ -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py
r104129 r104135 1897 1897 'IEM_MC_CALL_AVX_AIMPL_4': '__aimpl_avx', 1898 1898 'IEM_MC_CALL_AVX_AIMPL_5': '__aimpl_avx', 1899 'IEM_MC_CALL_AVX_AIMPL_NEW_3': '__aimpl_avx',1900 1899 }; 1901 1900 def analyzeAndAnnotateName(self, aoStmts: List[iai.McStmt]): -
trunk/src/VBox/VMM/include/IEMInternal.h
r104133 r104135 4239 4239 /** @name SSE/AVX single/double precision floating point operations. 4240 4240 * @{ */ 4241 /**4242 * A AVX128 result.4243 */4244 typedef struct IEMAVX128RESULT4245 {4246 /** The output value. */4247 X86XMMREG uResult;4248 /** The output status. */4249 uint32_t MXCSR;4250 } IEMAVX128RESULT;4251 AssertCompileMemberOffset(IEMAVX128RESULT, MXCSR, 128 / 8);4252 /** Pointer to a AVX128 result. */4253 typedef IEMAVX128RESULT *PIEMAVX128RESULT;4254 /** Pointer to a const AVX128 result. */4255 typedef IEMAVX128RESULT const *PCIEMAVX128RESULT;4256 4257 4258 /**4259 * A AVX256 result.4260 */4261 typedef struct IEMAVX256RESULT4262 {4263 /** The output value. */4264 X86YMMREG uResult;4265 /** The output status. */4266 uint32_t MXCSR;4267 } IEMAVX256RESULT;4268 AssertCompileMemberOffset(IEMAVX256RESULT, MXCSR, 256 / 8);4269 /** Pointer to a AVX256 result. */4270 typedef IEMAVX256RESULT *PIEMAVX256RESULT;4271 /** Pointer to a const AVX256 result. */4272 typedef IEMAVX256RESULT const *PCIEMAVX256RESULT;4273 4274 4275 4241 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLFPSSEF2U128,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2)); 4276 4242 typedef FNIEMAIMPLFPSSEF2U128 *PFNIEMAIMPLFPSSEF2U128; … … 4280 4246 typedef FNIEMAIMPLFPSSEF2U128R64 *PFNIEMAIMPLFPSSEF2U128R64; 4281 4247 4282 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLFPAVXF3U128,(PX86XSAVEAREA pExtState, PIEMAVX128RESULTpResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2));4248 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLFPAVXF3U128,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCX86XMMREG puSrc2)); 4283 4249 typedef FNIEMAIMPLFPAVXF3U128 *PFNIEMAIMPLFPAVXF3U128; 4284 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLFPAVXF3U128R32,(PX86XSAVEAREA pExtState, PIEMAVX128RESULTpResult, PCX86XMMREG puSrc1, PCRTFLOAT32U pr32Src2));4250 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLFPAVXF3U128R32,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCRTFLOAT32U pr32Src2)); 4285 4251 typedef FNIEMAIMPLFPAVXF3U128R32 *PFNIEMAIMPLFPAVXF3U128R32; 4286 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLFPAVXF3U128R64,(PX86XSAVEAREA pExtState, PIEMAVX128RESULTpResult, PCX86XMMREG puSrc1, PCRTFLOAT64U pr64Src2));4252 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLFPAVXF3U128R64,(uint32_t uMxCsrIn, PX86XMMREG pResult, PCX86XMMREG puSrc1, PCRTFLOAT64U pr64Src2)); 4287 4253 typedef FNIEMAIMPLFPAVXF3U128R64 *PFNIEMAIMPLFPAVXF3U128R64; 4288 4254 4289 typedef IEM_DECL_IMPL_TYPE( void, FNIEMAIMPLFPAVXF3U256,(PX86XSAVEAREA pExtState, PIEMAVX256RESULTpResult, PCX86YMMREG puSrc1, PCX86YMMREG puSrc2));4255 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLFPAVXF3U256,(uint32_t uMxCsrIn, PX86YMMREG pResult, PCX86YMMREG puSrc1, PCX86YMMREG puSrc2)); 4290 4256 typedef FNIEMAIMPLFPAVXF3U256 *PFNIEMAIMPLFPAVXF3U256; 4291 4257 -
trunk/src/VBox/VMM/include/IEMMc.h
r104134 r104135 3079 3079 * @param a2 The second extra argument. 3080 3080 */ 3081 #define IEM_MC_CALL_AVX_AIMPL_2(a_pfnAImpl, a 1, a2) \3081 #define IEM_MC_CALL_AVX_AIMPL_2(a_pfnAImpl, a0, a1) \ 3082 3082 do { \ 3083 3083 IEM_MC_PREPARE_AVX_USAGE(); \ 3084 a_pfnAImpl(&pVCpu->cpum.GstCtx.XState, (a1), (a2)); \ 3084 pVCpu->cpum.GstCtx.XState.x87.MXCSR = a_pfnAImpl(pVCpu->cpum.GstCtx.XState.x87.MXCSR & ~X86_MXCSR_XCPT_FLAGS, \ 3085 (a0), (a1)); \ 3085 3086 } while (0) 3086 3087 … … 3095 3096 * @param a3 The third extra argument. 3096 3097 */ 3097 #define IEM_MC_CALL_AVX_AIMPL_3(a_pfnAImpl, a 1, a2, a3) \3098 #define IEM_MC_CALL_AVX_AIMPL_3(a_pfnAImpl, a0, a1, a2) \ 3098 3099 do { \ 3099 3100 IEM_MC_PREPARE_AVX_USAGE(); \ 3100 a_pfnAImpl(&pVCpu->cpum.GstCtx.XState, (a1), (a2), (a3)); \ 3101 } while (0) 3102 3103 /** 3104 * Calls a AVX assembly implementation taking three visible arguments. 3105 * 3106 * @param a_pfnAImpl Pointer to the assembly SSE routine. 3107 * @param a0 The first extra argument. 3108 * @param a1 The second extra argument. 3109 * @param a2 The third extra argument. 3110 * 3111 * @note The and'ing with X86_MXCSR_XCPT_FLAGS is just a precaution as 3112 * the called helper should return an MXCSR with only new exception flags 3113 * added. 3114 * @note This is temporarily required for the v(u)comis* stuff because 3115 * tstIEMAImpl will not compile otherwise, will be removed once the AVX 3116 * stuff is reworked, see @bugref{10641} 3117 */ 3118 #define IEM_MC_CALL_AVX_AIMPL_NEW_3(a_pfnAImpl, a0, a1, a2) \ 3119 do { \ 3120 IEM_MC_PREPARE_SSE_USAGE(); \ 3121 pVCpu->cpum.GstCtx.XState.x87.MXCSR |= a_pfnAImpl(pVCpu->cpum.GstCtx.XState.x87.MXCSR, (a0), (a1), (a2)) \ 3122 & X86_MXCSR_XCPT_FLAGS; \ 3101 pVCpu->cpum.GstCtx.XState.x87.MXCSR = a_pfnAImpl(pVCpu->cpum.GstCtx.XState.x87.MXCSR & ~X86_MXCSR_XCPT_FLAGS, \ 3102 (a0), (a1), (a2)); \ 3123 3103 } while (0) 3124 3104 -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r104133 r104135 1082 1082 #define IEM_MC_CALL_AVX_AIMPL_3(a_pfnAImpl, a0, a1, a2) \ 1083 1083 do { (void)fAvxHost; (void)fAvxWrite; CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); (void)fMcBegin; } while (0) 1084 #define IEM_MC_CALL_AVX_AIMPL_NEW_3(a_pfnAImpl, a0, a1, a2) \1085 do { (void)fAvxHost; (void)fAvxWrite; CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); (void)fMcBegin; } while (0)1086 1084 #define IEM_MC_CALL_AVX_AIMPL_4(a_pfnAImpl, a0, a1, a2, a3) \ 1087 1085 do { (void)fAvxHost; (void)fAvxWrite; CHK_CALL_ARG(a0, 0); CHK_CALL_ARG(a1, 1); CHK_CALL_ARG(a2, 2); CHK_CALL_ARG(a3, 3); (void)fMcBegin; } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.