- Timestamp:
- Apr 10, 2024 9:13:40 AM (10 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r104263 r104268 5073 5073 ; @param A2 Pointer to the EFLAGS register. 5074 5074 ; 5075 %macro IEMIMPL_VTESTP_S D 15075 %macro IEMIMPL_VTESTP_S_D 1 5076 5076 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u128, 12 5077 5077 PROLOGUE_3_ARGS … … 5101 5101 %endmacro 5102 5102 5103 IEMIMPL_VTESTP_S D vtestps5104 IEMIMPL_VTESTP_S D vtestpd5103 IEMIMPL_VTESTP_S_D vtestps 5104 IEMIMPL_VTESTP_S_D vtestpd 5105 5105 5106 5106 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstVexMap2.cpp.h
r104264 r104268 213 213 * Exceptions type 4. AVX cpuid check for both 128-bit and 256-bit operation. 214 214 */ 215 FNIEMOP_DEF_1(iemOpCommonAvxAvx_Vx_Wx_Efl_Opt, PCIEMOPMEDIAF2EFL, pImpl) 216 { 217 Assert(pVCpu->iem.s.uVexLength <= 1); 218 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 219 if (IEM_IS_MODRM_REG_MODE(bRm)) 220 { 221 /* 222 * Register, register. 223 */ 224 if (pVCpu->iem.s.uVexLength) 225 { 226 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); 227 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); 228 IEM_MC_LOCAL(RTUINT256U, uSrc1); 229 IEM_MC_LOCAL(RTUINT256U, uSrc2); 230 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc1, uSrc1, 0); 231 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc2, uSrc2, 1); 232 IEM_MC_ARG(uint32_t *, pEFlags, 2); 233 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); 234 IEM_MC_PREPARE_AVX_USAGE(); 235 IEM_MC_FETCH_YREG_U256(uSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 236 IEM_MC_FETCH_YREG_U256(uSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); 237 IEM_MC_REF_EFLAGS(pEFlags); 238 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnU256, puSrc1, puSrc2, pEFlags); 239 IEM_MC_ADVANCE_RIP_AND_FINISH(); 240 IEM_MC_END(); 241 } 242 else 243 { 244 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); 245 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); 246 IEM_MC_ARG(PCRTUINT128U, puSrc1, 0); 247 IEM_MC_ARG(PCRTUINT128U, puSrc2, 1); 248 IEM_MC_ARG(uint32_t *, pEFlags, 2); 249 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); 250 IEM_MC_PREPARE_AVX_USAGE(); 251 IEM_MC_REF_XREG_U128_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 252 IEM_MC_REF_XREG_U128_CONST(puSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); 253 IEM_MC_REF_EFLAGS(pEFlags); 254 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnU128, puSrc1, puSrc2, pEFlags); 255 IEM_MC_ADVANCE_RIP_AND_FINISH(); 256 IEM_MC_END(); 257 } 258 } 259 else 260 { 261 /* 262 * Register, memory. 263 */ 264 if (pVCpu->iem.s.uVexLength) 265 { 266 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); 267 IEM_MC_LOCAL(RTUINT256U, uSrc1); 268 IEM_MC_LOCAL(RTUINT256U, uSrc2); 269 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); 270 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc1, uSrc1, 0); 271 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc2, uSrc2, 1); 272 IEM_MC_ARG(uint32_t *, pEFlags, 2); 273 274 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 275 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); 276 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); 277 IEM_MC_PREPARE_AVX_USAGE(); 278 279 IEM_MC_FETCH_MEM_U256_NO_AC(uSrc2, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); 280 IEM_MC_FETCH_YREG_U256(uSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 281 IEM_MC_REF_EFLAGS(pEFlags); 282 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnU256, puSrc1, puSrc2, pEFlags); 283 284 IEM_MC_ADVANCE_RIP_AND_FINISH(); 285 IEM_MC_END(); 286 } 287 else 288 { 289 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); 290 IEM_MC_LOCAL(RTUINT128U, uSrc2); 291 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); 292 IEM_MC_ARG(PCRTUINT128U, puSrc1, 0); 293 IEM_MC_ARG_LOCAL_REF(PCRTUINT128U, puSrc2, uSrc2, 1); 294 IEM_MC_ARG(uint32_t *, pEFlags, 2); 295 296 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); 297 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); 298 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); 299 IEM_MC_PREPARE_AVX_USAGE(); 300 301 IEM_MC_FETCH_MEM_U128_NO_AC(uSrc2, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); 302 IEM_MC_REF_XREG_U128_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); 303 IEM_MC_REF_EFLAGS(pEFlags); 304 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnU128, puSrc1, puSrc2, pEFlags); 305 306 IEM_MC_ADVANCE_RIP_AND_FINISH(); 307 IEM_MC_END(); 308 } 309 } 310 } 215 #define IEMOP_BODY_VTESTP_S_D(a_Instr) \ 216 Assert(pVCpu->iem.s.uVexLength <= 1); \ 217 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); \ 218 if (IEM_IS_MODRM_REG_MODE(bRm)) \ 219 { \ 220 /* \ 221 * Register, register. \ 222 */ \ 223 if (pVCpu->iem.s.uVexLength) \ 224 { \ 225 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 226 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 227 IEM_MC_LOCAL(RTUINT256U, uSrc1); \ 228 IEM_MC_LOCAL(RTUINT256U, uSrc2); \ 229 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc1, uSrc1, 0); \ 230 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc2, uSrc2, 1); \ 231 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 232 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 233 IEM_MC_PREPARE_AVX_USAGE(); \ 234 IEM_MC_FETCH_YREG_U256(uSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 235 IEM_MC_FETCH_YREG_U256(uSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 236 IEM_MC_REF_EFLAGS(pEFlags); \ 237 IEM_MC_CALL_VOID_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_ ## a_Instr ## _u256, \ 238 iemAImpl_ ## a_Instr ## _u256_fallback), \ 239 puSrc1, puSrc2, pEFlags); \ 240 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 241 IEM_MC_END(); \ 242 } \ 243 else \ 244 { \ 245 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 246 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 247 IEM_MC_ARG(PCRTUINT128U, puSrc1, 0); \ 248 IEM_MC_ARG(PCRTUINT128U, puSrc2, 1); \ 249 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 250 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 251 IEM_MC_PREPARE_AVX_USAGE(); \ 252 IEM_MC_REF_XREG_U128_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 253 IEM_MC_REF_XREG_U128_CONST(puSrc2, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 254 IEM_MC_REF_EFLAGS(pEFlags); \ 255 IEM_MC_CALL_VOID_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_ ## a_Instr ## _u128, \ 256 iemAImpl_ ## a_Instr ## _u128_fallback), \ 257 puSrc1, puSrc2, pEFlags); \ 258 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 259 IEM_MC_END(); \ 260 } \ 261 } \ 262 else \ 263 { \ 264 /* \ 265 * Register, memory. \ 266 */ \ 267 if (pVCpu->iem.s.uVexLength) \ 268 { \ 269 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 270 IEM_MC_LOCAL(RTUINT256U, uSrc1); \ 271 IEM_MC_LOCAL(RTUINT256U, uSrc2); \ 272 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); \ 273 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc1, uSrc1, 0); \ 274 IEM_MC_ARG_LOCAL_REF(PCRTUINT256U, puSrc2, uSrc2, 1); \ 275 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 276 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); \ 277 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 278 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 279 IEM_MC_PREPARE_AVX_USAGE(); \ 280 IEM_MC_FETCH_MEM_U256_NO_AC(uSrc2, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 281 IEM_MC_FETCH_YREG_U256(uSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 282 IEM_MC_REF_EFLAGS(pEFlags); \ 283 IEM_MC_CALL_VOID_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_ ## a_Instr ## _u256, \ 284 iemAImpl_ ## a_Instr ## _u256_fallback), \ 285 puSrc1, puSrc2, pEFlags); \ 286 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 287 IEM_MC_END(); \ 288 } \ 289 else \ 290 { \ 291 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 292 IEM_MC_LOCAL(RTUINT128U, uSrc2); \ 293 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); \ 294 IEM_MC_ARG(PCRTUINT128U, puSrc1, 0); \ 295 IEM_MC_ARG_LOCAL_REF(PCRTUINT128U, puSrc2, uSrc2, 1); \ 296 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 297 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); \ 298 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 299 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 300 IEM_MC_PREPARE_AVX_USAGE(); \ 301 IEM_MC_FETCH_MEM_U128_NO_AC(uSrc2, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 302 IEM_MC_REF_XREG_U128_CONST(puSrc1, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 303 IEM_MC_REF_EFLAGS(pEFlags); \ 304 IEM_MC_CALL_VOID_AIMPL_3(IEM_SELECT_HOST_OR_FALLBACK(fAvx, iemAImpl_ ## a_Instr ## _u128, \ 305 iemAImpl_ ## a_Instr ## _u128_fallback), \ 306 puSrc1, puSrc2, pEFlags); \ 307 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 308 IEM_MC_END(); \ 309 } \ 310 } \ 311 (void)0 311 312 312 313 … … 314 315 315 316 316 /** Opcode VEX.66.0F38 0x0e. 317 * AVX,AVX */ 317 /** 318 * @opcode 0x0e 319 * @oppfx 0x66 320 * @opflmodify cf,zf,pf,af,sf,of 321 * @opflclear pf,af,sf,of 322 */ 318 323 FNIEMOP_DEF(iemOp_vtestps_Vx_Wx) 319 324 { … … 321 326 * CPU modes. */ 322 327 IEMOP_MNEMONIC2(VEX_RM, VTESTPS, vtestps, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, IEMOPHINT_IGNORES_OP_SIZES | IEMOPHINT_VEX_W_ZERO); 323 IEMOPMEDIAF2EFL_INIT_VARS(vtestps); 324 return FNIEMOP_CALL_1(iemOpCommonAvxAvx_Vx_Wx_Efl_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx, &s_Host, &s_Fallback)); 328 IEMOP_BODY_VTESTP_S_D(vtestps); 325 329 } 326 330 … … 329 333 330 334 331 /** Opcode VEX.66.0F38 0x0f. 332 * AVX,AVX */ 335 /** 336 * @opcode 0x0f 337 * @oppfx 0x66 338 * @opflmodify cf,zf,pf,af,sf,of 339 * @opflclear pf,af,sf,of 340 */ 333 341 FNIEMOP_DEF(iemOp_vtestpd_Vx_Wx) 334 342 { … … 336 344 * CPU modes. */ 337 345 IEMOP_MNEMONIC2(VEX_RM, VTESTPD, vtestpd, Vx, Wx, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, IEMOPHINT_IGNORES_OP_SIZES | IEMOPHINT_VEX_W_ZERO); 338 IEMOPMEDIAF2EFL_INIT_VARS(vtestpd); 339 return FNIEMOP_CALL_1(iemOpCommonAvxAvx_Vx_Wx_Efl_Opt, IEM_SELECT_HOST_OR_FALLBACK(fAvx, &s_Host, &s_Fallback)); 346 IEMOP_BODY_VTESTP_S_D(vtestpd); 340 347 } 341 348 -
trunk/src/VBox/VMM/include/IEMInternal.h
r104263 r104268 3858 3858 FNIEMAIMPLF2EFL128 iemAImpl_vtestpd_u128, iemAImpl_vtestpd_u128_fallback; 3859 3859 FNIEMAIMPLF2EFL256 iemAImpl_vtestpd_u256, iemAImpl_vtestpd_u256_fallback; 3860 3861 /**3862 * Function table for media instruction taking two full sized media source3863 * registers, and updating EFLAGS but no additional state (AVX).3864 */3865 typedef struct IEMOPMEDIAF2EFL3866 {3867 PFNIEMAIMPLF2EFL128 pfnU128;3868 PFNIEMAIMPLF2EFL256 pfnU256;3869 } IEMOPMEDIAF2EFL;3870 /** Pointer to a media operation function table for 3 full sized ops (AVX). */3871 typedef IEMOPMEDIAF2EFL const *PCIEMOPMEDIAF2EFL;3872 3873 /** @def IEMOPMEDIAF2EFL_INIT_VARS_EX3874 * Declares a s_Host (x86 & amd64 only) and a s_Fallback variable with the3875 * given functions as initializers. For use in AVX functions where a pair of3876 * functions are only used once and the function table need not be public. */3877 #ifndef TST_IEM_CHECK_MC3878 # if (defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)) && !defined(IEM_WITHOUT_ASSEMBLY)3879 # define IEMOPMEDIAF2EFL_INIT_VARS_EX(a_pfnHostU128, a_pfnHostU256, a_pfnFallbackU128, a_pfnFallbackU256) \3880 static IEMOPMEDIAF2EFL const s_Host = { a_pfnHostU128, a_pfnHostU256 }; \3881 static IEMOPMEDIAF2EFL const s_Fallback = { a_pfnFallbackU128, a_pfnFallbackU256 }3882 # else3883 # define IEMOPMEDIAF2EFL_INIT_VARS_EX(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) \3884 static IEMOPMEDIAF2EFL const s_Fallback = { a_pfnFallbackU128, a_pfnFallbackU256 }3885 # endif3886 #else3887 # define IEMOPMEDIAF2EFL_INIT_VARS_EX(a_pfnU128, a_pfnU256, a_pfnFallbackU128, a_pfnFallbackU256) (void)03888 #endif3889 /** @def IEMOPMEDIAF2EFL_INIT_VARS3890 * Generate AVX function tables for the @a a_InstrNm instruction.3891 * @sa IEMOPMEDIAF2EFL_INIT_VARS_EX */3892 #define IEMOPMEDIAF2EFL_INIT_VARS(a_InstrNm) \3893 IEMOPMEDIAF2EFL_INIT_VARS_EX(RT_CONCAT3(iemAImpl_,a_InstrNm,_u128), RT_CONCAT3(iemAImpl_,a_InstrNm,_u256), \3894 RT_CONCAT3(iemAImpl_,a_InstrNm,_u128_fallback), RT_CONCAT3(iemAImpl_,a_InstrNm,_u256_fallback))3895 3860 3896 3861 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2I32U64,(uint32_t uMxCsrIn, int32_t *pi32Dst, const uint64_t *pu64Src)); /* pu64Src is a double precision floating point. */
Note:
See TracChangeset
for help on using the changeset viewer.