Changeset 96379 in vbox
- Timestamp:
- Aug 20, 2022 7:23:07 PM (2 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r96351 r96379 4647 4647 IEMIMPL_FP_F2_R32 divss 4648 4648 IEMIMPL_FP_F2_R32 maxss 4649 IEMIMPL_FP_F2_R32 cvtss2sd 4649 4650 4650 4651 … … 4697 4698 IEMIMPL_FP_F2_R64 divsd 4698 4699 IEMIMPL_FP_F2_R64 maxsd 4700 IEMIMPL_FP_F2_R64 cvtsd2ss -
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r96351 r96379 13876 13876 * @param pr32Result Where to store the result for IEM. 13877 13877 * @param fMxcsr The original MXCSR value. 13878 * @param pr32Src1 The first source operand (for setting \#DE under certain circumstances).13879 * @param pr32Src2 The second source operand (for setting \#DE under certain circumstances).13880 13878 */ 13881 13879 DECLINLINE(uint32_t) iemSseSoftStateAndR32ToMxcsrAndIprtResult(softfloat_state_t const *pSoftState, float32_t r32Result, 13882 PRTFLOAT32U pr32Result, uint32_t fMxcsr, 13883 PCRTFLOAT32U pr32Src1, PCRTFLOAT32U pr32Src2) 13880 PRTFLOAT32U pr32Result, uint32_t fMxcsr) 13884 13881 { 13885 13882 iemFpSoftF32ToIprt(pr32Result, r32Result); … … 13900 13897 && (RTFLOAT32U_IS_SUBNORMAL(pr32Result)))) 13901 13898 fXcpt &= ~X86_MXCSR_DE; 13902 else /* Need to set \#DE when one of the source operands is a De-normal. */13903 fXcpt |= ( RTFLOAT32U_IS_SUBNORMAL(pr32Src1)13904 || RTFLOAT32U_IS_SUBNORMAL(pr32Src2))13905 ? X86_MXCSR_DE13906 : 0;13907 13899 13908 13900 return fMxcsr | (fXcpt & X86_MXCSR_XCPT_FLAGS); … … 13919 13911 * @param pr32Result Where to store the result for IEM. 13920 13912 * @param fMxcsr The original MXCSR value. 13921 * @param pr32Src1 The first source operand (for setting \#DE under certain circumstances).13922 * @param pr32Src2 The second source operand (for setting \#DE under certain circumstances).13923 13913 */ 13924 13914 DECLINLINE(uint32_t) iemSseSoftStateAndR32ToMxcsrAndIprtResultNoFz(softfloat_state_t const *pSoftState, float32_t r32Result, 13925 PRTFLOAT32U pr32Result, uint32_t fMxcsr, 13926 PCRTFLOAT32U pr32Src1, PCRTFLOAT32U pr32Src2) 13915 PRTFLOAT32U pr32Result, uint32_t fMxcsr) 13927 13916 { 13928 13917 iemFpSoftF32ToIprt(pr32Result, r32Result); … … 13934 13923 && (RTFLOAT32U_IS_SUBNORMAL(pr32Result)))) 13935 13924 fXcpt &= ~X86_MXCSR_DE; 13936 else /* Need to set \#DE when one of the source operands is a De-normal. */13937 fXcpt |= ( RTFLOAT32U_IS_SUBNORMAL(pr32Src1)13938 || RTFLOAT32U_IS_SUBNORMAL(pr32Src2))13939 ? X86_MXCSR_DE13940 : 0;13941 13925 13942 13926 return fMxcsr | (fXcpt & X86_MXCSR_XCPT_FLAGS); … … 13953 13937 * @param pr64Result Where to store the result for IEM. 13954 13938 * @param fMxcsr The original MXCSR value. 13955 * @param pr64Src1 The first source operand (for setting \#DE under certain circumstances).13956 * @param pr64Src2 The second source operand (for setting \#DE under certain circumstances).13957 13939 */ 13958 13940 DECLINLINE(uint32_t) iemSseSoftStateAndR64ToMxcsrAndIprtResult(softfloat_state_t const *pSoftState, float64_t r64Result, 13959 PRTFLOAT64U pr64Result, uint32_t fMxcsr, 13960 PCRTFLOAT64U pr64Src1, PCRTFLOAT64U pr64Src2) 13941 PRTFLOAT64U pr64Result, uint32_t fMxcsr) 13961 13942 { 13962 13943 iemFpSoftF64ToIprt(pr64Result, r64Result); … … 13978 13959 && (RTFLOAT64U_IS_SUBNORMAL(pr64Result)))) 13979 13960 fXcpt &= ~X86_MXCSR_DE; 13980 else /* Need to set \#DE when one of the source operands is a De-normal. */13981 fXcpt |= ( RTFLOAT64U_IS_SUBNORMAL(pr64Src1)13982 || RTFLOAT64U_IS_SUBNORMAL(pr64Src2))13983 ? X86_MXCSR_DE13984 : 0;13985 13961 13986 13962 return fMxcsr | (fXcpt & X86_MXCSR_XCPT_FLAGS); … … 13997 13973 * @param pr64Result Where to store the result for IEM. 13998 13974 * @param fMxcsr The original MXCSR value. 13999 * @param pr64Src1 The first source operand (for setting \#DE under certain circumstances).14000 * @param pr64Src2 The second source operand (for setting \#DE under certain circumstances).14001 13975 */ 14002 13976 DECLINLINE(uint32_t) iemSseSoftStateAndR64ToMxcsrAndIprtResultNoFz(softfloat_state_t const *pSoftState, float64_t r64Result, 14003 PRTFLOAT64U pr64Result, uint32_t fMxcsr, 14004 PCRTFLOAT64U pr64Src1, PCRTFLOAT64U pr64Src2) 13977 PRTFLOAT64U pr64Result, uint32_t fMxcsr) 14005 13978 { 14006 13979 iemFpSoftF64ToIprt(pr64Result, r64Result); … … 14012 13985 && (RTFLOAT64U_IS_SUBNORMAL(pr64Result)))) 14013 13986 fXcpt &= ~X86_MXCSR_DE; 14014 else /* Need to set \#DE when one of the source operands is a De-normal. */14015 fXcpt |= ( RTFLOAT64U_IS_SUBNORMAL(pr64Src1)14016 || RTFLOAT64U_IS_SUBNORMAL(pr64Src2))14017 ? X86_MXCSR_DE14018 : 0;14019 13987 14020 13988 return fMxcsr | (fXcpt & X86_MXCSR_XCPT_FLAGS); … … 14026 13994 * in MXCSR into account. 14027 13995 * 14028 * @returns nothing.13996 * @returns The output MXCSR De-normal flag if the input is a de-normal and the DAZ flag is not set. 14029 13997 * @param pr32Val Where to store the result. 14030 13998 * @param fMxcsr The input MXCSR value. 14031 13999 * @param pr32Src The value to use. 14032 14000 */ 14033 DECLINLINE(void) iemSsePrepareValueR32(PRTFLOAT32U pr32Val, uint32_t fMxcsr, PCRTFLOAT32U pr32Src) 14034 { 14035 /* De-normals are changed to 0. */ 14036 if ( fMxcsr & X86_MXCSR_DAZ 14037 && RTFLOAT32U_IS_SUBNORMAL(pr32Src)) 14038 { 14039 pr32Val->s.fSign = pr32Src->s.fSign; 14040 pr32Val->s.uFraction = 0; 14041 pr32Val->s.uExponent = 0; 14042 } 14043 else 14001 DECLINLINE(uint32_t) iemSsePrepareValueR32(PRTFLOAT32U pr32Val, uint32_t fMxcsr, PCRTFLOAT32U pr32Src) 14002 { 14003 if (RTFLOAT32U_IS_SUBNORMAL(pr32Src)) 14004 { 14005 if (fMxcsr & X86_MXCSR_DAZ) 14006 { 14007 /* De-normals are changed to 0. */ 14008 pr32Val->s.fSign = pr32Src->s.fSign; 14009 pr32Val->s.uFraction = 0; 14010 pr32Val->s.uExponent = 0; 14011 return 0; 14012 } 14013 14044 14014 *pr32Val = *pr32Src; 14015 return X86_MXCSR_DE; 14016 } 14017 14018 *pr32Val = *pr32Src; 14019 return 0; 14045 14020 } 14046 14021 … … 14050 14025 * in MXCSR into account. 14051 14026 * 14052 * @returns nothing.14027 * @returns The output MXCSR De-normal flag if the input is a de-normal and the DAZ flag is not set. 14053 14028 * @param pr64Val Where to store the result. 14054 14029 * @param fMxcsr The input MXCSR value. 14055 14030 * @param pr64Src The value to use. 14056 14031 */ 14057 DECLINLINE(void) iemSsePrepareValueR64(PRTFLOAT64U pr64Val, uint32_t fMxcsr, PCRTFLOAT64U pr64Src) 14058 { 14059 /* De-normals are changed to 0. */ 14060 if ( fMxcsr & X86_MXCSR_DAZ 14061 && RTFLOAT64U_IS_SUBNORMAL(pr64Src)) 14062 { 14063 pr64Val->s64.fSign = pr64Src->s.fSign; 14064 pr64Val->s64.uFraction = 0; 14065 pr64Val->s64.uExponent = 0; 14066 } 14067 else 14032 DECLINLINE(uint32_t) iemSsePrepareValueR64(PRTFLOAT64U pr64Val, uint32_t fMxcsr, PCRTFLOAT64U pr64Src) 14033 { 14034 if (RTFLOAT64U_IS_SUBNORMAL(pr64Src)) 14035 { 14036 if (fMxcsr & X86_MXCSR_DAZ) 14037 { 14038 /* De-normals are changed to 0. */ 14039 pr64Val->s64.fSign = pr64Src->s.fSign; 14040 pr64Val->s64.uFraction = 0; 14041 pr64Val->s64.uExponent = 0; 14042 return 0; 14043 } 14044 14068 14045 *pr64Val = *pr64Src; 14046 return X86_MXCSR_DE; 14047 } 14048 14049 *pr64Val = *pr64Src; 14050 return 0; 14069 14051 } 14070 14052 … … 14165 14147 14166 14148 RTFLOAT32U r32Src1, r32Src2; 14167 iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1);14168 iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2);14149 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14150 fMxcsr |= iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14169 14151 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14170 14152 float32_t r32Result = f32_add(iemFpSoftF32FromIprt(&r32Src1), iemFpSoftF32FromIprt(&r32Src2), &SoftState); 14171 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr , &r32Src1, &r32Src2);14153 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr); 14172 14154 } 14173 14155 … … 14207 14189 14208 14190 RTFLOAT64U r64Src1, r64Src2; 14209 iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1);14210 iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2);14191 fMxcsr |= iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14192 fMxcsr |= iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14211 14193 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14212 14194 float64_t r64Result = f64_add(iemFpSoftF64FromIprt(&r64Src1), iemFpSoftF64FromIprt(&r64Src2), &SoftState); 14213 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr , &r64Src1, &r64Src2);14195 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr); 14214 14196 } 14215 14197 … … 14245 14227 14246 14228 RTFLOAT32U r32Src1, r32Src2; 14247 iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1);14248 iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2);14229 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14230 fMxcsr |= iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14249 14231 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14250 14232 float32_t r32Result = f32_mul(iemFpSoftF32FromIprt(&r32Src1), iemFpSoftF32FromIprt(&r32Src2), &SoftState); 14251 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr , &r32Src1, &r32Src2);14233 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr); 14252 14234 } 14253 14235 … … 14287 14269 14288 14270 RTFLOAT64U r64Src1, r64Src2; 14289 iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1);14290 iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2);14271 fMxcsr |= iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14272 fMxcsr |= iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14291 14273 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14292 14274 float64_t r64Result = f64_mul(iemFpSoftF64FromIprt(&r64Src1), iemFpSoftF64FromIprt(&r64Src2), &SoftState); 14293 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr , &r64Src1, &r64Src2);14275 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr); 14294 14276 } 14295 14277 … … 14325 14307 14326 14308 RTFLOAT32U r32Src1, r32Src2; 14327 iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1);14328 iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2);14309 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14310 fMxcsr |= iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14329 14311 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14330 14312 float32_t r32Result = f32_sub(iemFpSoftF32FromIprt(&r32Src1), iemFpSoftF32FromIprt(&r32Src2), &SoftState); 14331 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr , &r32Src1, &r32Src2);14313 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr); 14332 14314 } 14333 14315 … … 14367 14349 14368 14350 RTFLOAT64U r64Src1, r64Src2; 14369 iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1);14370 iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2);14351 fMxcsr |= iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14352 fMxcsr |= iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14371 14353 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14372 14354 float64_t r64Result = f64_sub(iemFpSoftF64FromIprt(&r64Src1), iemFpSoftF64FromIprt(&r64Src2), &SoftState); 14373 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr , &r64Src1, &r64Src2);14355 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr); 14374 14356 } 14375 14357 … … 14401 14383 static uint32_t iemAImpl_minps_u128_worker(PRTFLOAT32U pr32Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val1, PCRTFLOAT32U pr32Val2) 14402 14384 { 14385 if (RTFLOAT32U_IS_NAN(pr32Val1) || RTFLOAT32U_IS_NAN(pr32Val2)) 14386 { 14387 /* The DAZ flag gets honored but the DE flag will not get set because \#IE has higher priority. */ 14388 iemSsePrepareValueR32(pr32Res, fMxcsr, pr32Val2); 14389 return fMxcsr | X86_MXCSR_IE; 14390 } 14391 14403 14392 RTFLOAT32U r32Src1, r32Src2; 14404 iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14405 iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14406 14393 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14394 fMxcsr |= iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14407 14395 if (RTFLOAT32U_IS_ZERO(&r32Src1) && RTFLOAT32U_IS_ZERO(&r32Src2)) 14408 14396 { 14409 14397 *pr32Res = r32Src2; 14410 14398 return fMxcsr; 14411 }14412 else if (RTFLOAT32U_IS_NAN(&r32Src1) || RTFLOAT32U_IS_NAN(&r32Src2))14413 {14414 *pr32Res = r32Src2;14415 return fMxcsr | X86_MXCSR_IE;14416 14399 } 14417 14400 … … 14422 14405 ? iemFpSoftF32FromIprt(&r32Src1) 14423 14406 : iemFpSoftF32FromIprt(&r32Src2), 14424 pr32Res, fMxcsr , &r32Src1, &r32Src2);14407 pr32Res, fMxcsr); 14425 14408 } 14426 14409 … … 14456 14439 static uint32_t iemAImpl_minpd_u128_worker(PRTFLOAT64U pr64Res, uint32_t fMxcsr, PCRTFLOAT64U pr64Val1, PCRTFLOAT64U pr64Val2) 14457 14440 { 14441 if (RTFLOAT64U_IS_NAN(pr64Val1) || RTFLOAT64U_IS_NAN(pr64Val2)) 14442 { 14443 /* The DAZ flag gets honored but the DE flag will not get set because \#IE has higher priority. */ 14444 iemSsePrepareValueR64(pr64Res, fMxcsr, pr64Val2); 14445 return fMxcsr | X86_MXCSR_IE; 14446 } 14447 14458 14448 RTFLOAT64U r64Src1, r64Src2; 14459 iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14460 iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14461 14449 fMxcsr |= iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14450 fMxcsr |= iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14462 14451 if (RTFLOAT64U_IS_ZERO(&r64Src1) && RTFLOAT64U_IS_ZERO(&r64Src2)) 14463 14452 { 14464 14453 *pr64Res = r64Src2; 14465 14454 return fMxcsr; 14466 }14467 else if (RTFLOAT64U_IS_NAN(&r64Src1) || RTFLOAT64U_IS_NAN(&r64Src2))14468 {14469 *pr64Res = r64Src2;14470 return fMxcsr | X86_MXCSR_IE;14471 14455 } 14472 14456 … … 14477 14461 ? iemFpSoftF64FromIprt(&r64Src1) 14478 14462 : iemFpSoftF64FromIprt(&r64Src2), 14479 pr64Res, fMxcsr , &r64Src1, &r64Src2);14463 pr64Res, fMxcsr); 14480 14464 } 14481 14465 … … 14511 14495 14512 14496 RTFLOAT32U r32Src1, r32Src2; 14513 iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14514 iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14515 14497 uint32_t fDe = iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14498 fDe |= iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14516 14499 if (RTFLOAT32U_IS_ZERO(&r32Src2)) 14517 14500 { … … 14536 14519 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14537 14520 float32_t r32Result = f32_div(iemFpSoftF32FromIprt(&r32Src1), iemFpSoftF32FromIprt(&r32Src2), &SoftState); 14538 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr , &r32Src1, &r32Src2);14521 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr | fDe); 14539 14522 } 14540 14523 … … 14574 14557 14575 14558 RTFLOAT64U r64Src1, r64Src2; 14576 iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14577 iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14578 14559 uint32_t fDe = iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14560 fDe |= iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14579 14561 if (RTFLOAT64U_IS_ZERO(&r64Src2)) 14580 14562 { … … 14599 14581 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14600 14582 float64_t r64Result = f64_div(iemFpSoftF64FromIprt(&r64Src1), iemFpSoftF64FromIprt(&r64Src2), &SoftState); 14601 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr , &r64Src1, &r64Src2);14583 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr | fDe); 14602 14584 } 14603 14585 … … 14629 14611 static uint32_t iemAImpl_maxps_u128_worker(PRTFLOAT32U pr32Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val1, PCRTFLOAT32U pr32Val2) 14630 14612 { 14613 if (RTFLOAT32U_IS_NAN(pr32Val1) || RTFLOAT32U_IS_NAN(pr32Val2)) 14614 { 14615 /* The DAZ flag gets honored but the DE flag will not get set because \#IE has higher priority. */ 14616 iemSsePrepareValueR32(pr32Res, fMxcsr, pr32Val2); 14617 return fMxcsr | X86_MXCSR_IE; 14618 } 14619 14631 14620 RTFLOAT32U r32Src1, r32Src2; 14632 iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14633 iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14634 14621 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14622 fMxcsr |= iemSsePrepareValueR32(&r32Src2, fMxcsr, pr32Val2); 14635 14623 if (RTFLOAT32U_IS_ZERO(&r32Src1) && RTFLOAT32U_IS_ZERO(&r32Src2)) 14636 14624 { 14637 14625 *pr32Res = r32Src2; 14638 14626 return fMxcsr; 14639 }14640 else if (RTFLOAT32U_IS_NAN(&r32Src1) || RTFLOAT32U_IS_NAN(&r32Src2))14641 {14642 *pr32Res = r32Src2;14643 return fMxcsr | X86_MXCSR_IE;14644 14627 } 14645 14628 … … 14650 14633 ? iemFpSoftF32FromIprt(&r32Src2) 14651 14634 : iemFpSoftF32FromIprt(&r32Src1), 14652 pr32Res, fMxcsr , &r32Src1, &r32Src2);14635 pr32Res, fMxcsr); 14653 14636 } 14654 14637 … … 14684 14667 static uint32_t iemAImpl_maxpd_u128_worker(PRTFLOAT64U pr64Res, uint32_t fMxcsr, PCRTFLOAT64U pr64Val1, PCRTFLOAT64U pr64Val2) 14685 14668 { 14669 if (RTFLOAT64U_IS_NAN(pr64Val1) || RTFLOAT64U_IS_NAN(pr64Val2)) 14670 { 14671 /* The DAZ flag gets honored but the DE flag will not get set because \#IE has higher priority. */ 14672 iemSsePrepareValueR64(pr64Res, fMxcsr, pr64Val2); 14673 return fMxcsr | X86_MXCSR_IE; 14674 } 14675 14686 14676 RTFLOAT64U r64Src1, r64Src2; 14687 iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14688 iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14689 14677 fMxcsr |= iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14678 fMxcsr |= iemSsePrepareValueR64(&r64Src2, fMxcsr, pr64Val2); 14690 14679 if (RTFLOAT64U_IS_ZERO(&r64Src1) && RTFLOAT64U_IS_ZERO(&r64Src2)) 14691 14680 { 14692 14681 *pr64Res = r64Src2; 14693 14682 return fMxcsr; 14694 }14695 else if (RTFLOAT64U_IS_NAN(&r64Src1) || RTFLOAT64U_IS_NAN(&r64Src2))14696 {14697 *pr64Res = r64Src2;14698 return fMxcsr | X86_MXCSR_IE;14699 14683 } 14700 14684 … … 14705 14689 ? iemFpSoftF64FromIprt(&r64Src2) 14706 14690 : iemFpSoftF64FromIprt(&r64Src1), 14707 pr64Res, fMxcsr , &r64Src1, &r64Src2);14691 pr64Res, fMxcsr); 14708 14692 } 14709 14693 … … 14716 14700 #endif 14717 14701 14702 14718 14703 /** 14719 14704 * MAXSD … … 14726 14711 } 14727 14712 #endif 14713 14714 14715 /** 14716 * CVTSS2SD 14717 */ 14718 #ifdef IEM_WITHOUT_ASSEMBLY 14719 static uint32_t iemAImpl_cvtss2sd_u128_r32_worker(PRTFLOAT64U pr64Res, uint32_t fMxcsr, PCRTFLOAT32U pr32Val1) 14720 { 14721 RTFLOAT32U r32Src1; 14722 fMxcsr |= iemSsePrepareValueR32(&r32Src1, fMxcsr, pr32Val1); 14723 14724 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14725 float64_t r64Result = f32_to_f64(iemFpSoftF32FromIprt(&r32Src1), &SoftState); 14726 return iemSseSoftStateAndR64ToMxcsrAndIprtResult(&SoftState, r64Result, pr64Res, fMxcsr); 14727 } 14728 14729 14730 IEM_DECL_IMPL_DEF(void, iemAImpl_cvtss2sd_u128_r32,(PX86FXSTATE pFpuState, PIEMSSERESULT pResult, PCX86XMMREG puSrc1, PCRTFLOAT32U pr32Src2)) 14731 { 14732 pResult->MXCSR = iemAImpl_cvtss2sd_u128_r32_worker(&pResult->uResult.ar64[0], pFpuState->MXCSR, pr32Src2); 14733 pResult->uResult.ar64[1] = puSrc1->ar64[1]; 14734 } 14735 #endif 14736 14737 14738 /** 14739 * CVTSD2SS 14740 */ 14741 #ifdef IEM_WITHOUT_ASSEMBLY 14742 static uint32_t iemAImpl_cvtsd2ss_u128_r64_worker(PRTFLOAT32U pr32Res, uint32_t fMxcsr, PCRTFLOAT64U pr64Val1) 14743 { 14744 RTFLOAT64U r64Src1; 14745 fMxcsr |= iemSsePrepareValueR64(&r64Src1, fMxcsr, pr64Val1); 14746 14747 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(fMxcsr); 14748 float32_t r32Result = f64_to_f32(iemFpSoftF64FromIprt(&r64Src1), &SoftState); 14749 return iemSseSoftStateAndR32ToMxcsrAndIprtResult(&SoftState, r32Result, pr32Res, fMxcsr); 14750 } 14751 14752 14753 IEM_DECL_IMPL_DEF(void, iemAImpl_cvtsd2ss_u128_r64,(PX86FXSTATE pFpuState, PIEMSSERESULT pResult, PCX86XMMREG puSrc1, PCRTFLOAT64U pr64Src2)) 14754 { 14755 pResult->MXCSR = iemAImpl_cvtsd2ss_u128_r64_worker(&pResult->uResult.ar32[0], pFpuState->MXCSR, pr64Src2); 14756 pResult->uResult.ar32[1] = puSrc1->ar32[1]; 14757 pResult->uResult.ar32[2] = puSrc1->ar32[2]; 14758 pResult->uResult.ar32[3] = puSrc1->ar32[3]; 14759 } 14760 #endif -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r96351 r96379 4121 4121 /** Opcode 0x66 0x0f 0x5a - cvtpd2ps Vps, Wpd */ 4122 4122 FNIEMOP_STUB(iemOp_cvtpd2ps_Vps_Wpd); 4123 4124 4123 4125 /** Opcode 0xf3 0x0f 0x5a - cvtss2sd Vsd, Wss */ 4124 FNIEMOP_STUB(iemOp_cvtss2sd_Vsd_Wss); 4126 FNIEMOP_DEF(iemOp_cvtss2sd_Vsd_Wss) 4127 { 4128 IEMOP_MNEMONIC2(RM, CVTSS2SD, cvtss2sd, Vsd, Wss, DISOPTYPE_HARMLESS, 0); 4129 return FNIEMOP_CALL_1(iemOpCommonSseFp_FullR32_To_Full, iemAImpl_cvtss2sd_u128_r32); 4130 } 4131 4132 4125 4133 /** Opcode 0xf2 0x0f 0x5a - cvtsd2ss Vss, Wsd */ 4126 FNIEMOP_STUB(iemOp_cvtsd2ss_Vss_Wsd); 4134 FNIEMOP_DEF(iemOp_cvtsd2ss_Vss_Wsd) 4135 { 4136 IEMOP_MNEMONIC2(RM, CVTSD2SS, cvtsd2ss, Vss, Wsd, DISOPTYPE_HARMLESS, 0); 4137 return FNIEMOP_CALL_1(iemOpCommonSse2Fp_FullR64_To_Full, iemAImpl_cvtsd2ss_u128_r64); 4138 } 4139 4127 4140 4128 4141 /** Opcode 0x0f 0x5b - cvtdq2ps Vps, Wdq */ -
trunk/src/VBox/VMM/include/IEMInternal.h
r96351 r96379 2451 2451 FNIEMAIMPLFPSSEF2U128R32 iemAImpl_maxss_u128_r32; 2452 2452 FNIEMAIMPLFPSSEF2U128R64 iemAImpl_maxsd_u128_r64; 2453 FNIEMAIMPLFPSSEF2U128R32 iemAImpl_cvtss2sd_u128_r32; 2454 FNIEMAIMPLFPSSEF2U128R64 iemAImpl_cvtsd2ss_u128_r64; 2453 2455 2454 2456 FNIEMAIMPLFPAVXF3U128 iemAImpl_vaddps_u128, iemAImpl_vaddps_u128_fallback; -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r96351 r96379 487 487 #define iemAImpl_maxss_u128_r32 NULL 488 488 #define iemAImpl_maxsd_u128_r64 NULL 489 490 #define iemAImpl_cvtss2sd_u128_r32 NULL 491 #define iemAImpl_cvtsd2ss_u128_r64 NULL 489 492 490 493 /** @} */
Note:
See TracChangeset
for help on using the changeset viewer.