Changeset 105315 in vbox
- Timestamp:
- Jul 12, 2024 5:38:53 PM (5 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r105311 r105315 6442 6442 6443 6443 ;; 6444 ; cvttsd2si instruction - 32-bit variant. 6444 ; Template for [v]cvttss2si/[v]cvtss2si instructions. 6445 ; 6446 ; @param 1 Instruction name. 6447 ; @param 2 AVX or SSE 6445 6448 ; 6446 6449 ; @return R0_32 The new MXCSR value of the guest. … … 6449 6452 ; @param A2 Pointer to the second operand (input). 6450 6453 ; 6451 BEGINPROC_FASTCALL iemAImpl_cvttsd2si_i32_r64, 16 6452 PROLOGUE_4_ARGS 6453 IEMIMPL_SSE_PROLOGUE 6454 %macro IEMIMPL_MEDIA_V_CVTXSS2SI 2 6455 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _i32_r32, 16 6456 PROLOGUE_3_ARGS 6457 IEMIMPL_ %+ %2 %+ _PROLOGUE 6454 6458 SSE_AVX_LD_MXCSR A0_32 6455 6459 6456 cvttsd2siT0_32, [A2]6457 mov 6460 %1 T0_32, [A2] 6461 mov dword [A1], T0_32 6458 6462 6459 6463 SSE_AVX_ST_MXCSR R0_32, A0_32 6460 IEMIMPL_SSE_EPILOGUE 6461 EPILOGUE_4_ARGS 6462 ENDPROC iemAImpl_cvttsd2si_i32_r64 6463 6464 ;; 6465 ; cvttsd2si instruction - 64-bit variant. 6464 IEMIMPL_ %+ %2 %+ _EPILOGUE 6465 EPILOGUE_3_ARGS 6466 ENDPROC iemAImpl_ %+ %1 %+ _i32_r32 6467 6468 6469 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _i64_r32, 16 6470 PROLOGUE_3_ARGS 6471 IEMIMPL_ %+ %2 %+ _PROLOGUE 6472 SSE_AVX_LD_MXCSR A0_32 6473 6474 %1 T0, [A2] 6475 mov qword [A1], T0 6476 6477 SSE_AVX_ST_MXCSR R0_32, A0_32 6478 IEMIMPL_ %+ %2 %+ _EPILOGUE 6479 EPILOGUE_3_ARGS 6480 ENDPROC iemAImpl_ %+ %1 %+ _i64_r32 6481 %endmacro 6482 6483 IEMIMPL_MEDIA_V_CVTXSS2SI cvttss2si, SSE 6484 IEMIMPL_MEDIA_V_CVTXSS2SI vcvttss2si, AVX 6485 IEMIMPL_MEDIA_V_CVTXSS2SI cvtss2si, SSE 6486 IEMIMPL_MEDIA_V_CVTXSS2SI vcvtss2si, AVX 6487 6488 6489 ;; 6490 ; Template for [v]cvttsd2si/[v]cvtsd2si instructions. 6491 ; 6492 ; @param 1 Instruction name. 6493 ; @param 2 AVX or SSE 6466 6494 ; 6467 6495 ; @return R0_32 The new MXCSR value of the guest. … … 6470 6498 ; @param A2 Pointer to the second operand (input). 6471 6499 ; 6472 BEGINPROC_FASTCALL iemAImpl_cvttsd2si_i64_r64, 16 6473 PROLOGUE_3_ARGS 6474 IEMIMPL_SSE_PROLOGUE 6500 %macro IEMIMPL_MEDIA_V_CVTXSD2SI 2 6501 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _i32_r64, 16 6502 PROLOGUE_3_ARGS 6503 IEMIMPL_ %+ %2 %+ _PROLOGUE 6475 6504 SSE_AVX_LD_MXCSR A0_32 6476 6505 6477 cvttsd2si T0, [A2]6478 mov qword [A1], T06506 %1 T0_32, [A2] 6507 mov dword [A1], T0_32 6479 6508 6480 6509 SSE_AVX_ST_MXCSR R0_32, A0_32 6481 IEMIMPL_SSE_EPILOGUE 6482 EPILOGUE_3_ARGS 6483 ENDPROC iemAImpl_cvttsd2si_i64_r64 6484 6485 6486 ;; 6487 ; cvtsd2si instruction - 32-bit variant. 6488 ; 6489 ; @return R0_32 The new MXCSR value of the guest. 6490 ; @param A0_32 The guest's MXCSR register value to use. 6491 ; @param A1 Pointer to the result operand (output). 6492 ; @param A2 Pointer to the second operand (input). 6493 ; 6494 BEGINPROC_FASTCALL iemAImpl_cvtsd2si_i32_r64, 16 6495 PROLOGUE_3_ARGS 6496 IEMIMPL_SSE_PROLOGUE 6510 IEMIMPL_ %+ %2 %+ _EPILOGUE 6511 EPILOGUE_3_ARGS 6512 ENDPROC iemAImpl_ %+ %1 %+ _i32_r64 6513 6514 6515 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _i64_r64, 16 6516 PROLOGUE_3_ARGS 6517 IEMIMPL_ %+ %2 %+ _PROLOGUE 6497 6518 SSE_AVX_LD_MXCSR A0_32 6498 6519 6499 cvtsd2si T0_32, [A2]6500 mov dword [A1], T0_326520 %1 T0, [A2] 6521 mov qword [A1], T0 6501 6522 6502 6523 SSE_AVX_ST_MXCSR R0_32, A0_32 6503 IEMIMPL_SSE_EPILOGUE 6504 EPILOGUE_3_ARGS 6505 ENDPROC iemAImpl_cvtsd2si_i32_r64 6506 6507 ;; 6508 ; cvtsd2si instruction - 64-bit variant. 6509 ; 6510 ; @return R0_32 The new MXCSR value of the guest. 6511 ; @param A0_32 The guest's MXCSR register value to use. 6512 ; @param A1 Pointer to the result operand (output). 6513 ; @param A2 Pointer to the second operand (input). 6514 ; 6515 BEGINPROC_FASTCALL iemAImpl_cvtsd2si_i64_r64, 16 6516 PROLOGUE_3_ARGS 6517 IEMIMPL_SSE_PROLOGUE 6518 SSE_AVX_LD_MXCSR A0_32 6519 6520 cvtsd2si T0, [A2] 6521 mov qword [A1], T0 6522 6523 SSE_AVX_ST_MXCSR R0_32, A0_32 6524 IEMIMPL_SSE_EPILOGUE 6525 EPILOGUE_3_ARGS 6526 ENDPROC iemAImpl_cvtsd2si_i64_r64 6527 6528 6529 ;; 6530 ; cvttss2si instruction - 32-bit variant. 6531 ; 6532 ; @return R0_32 The new MXCSR value of the guest. 6533 ; @param A0_32 The guest's MXCSR register value to use. 6534 ; @param A1 Pointer to the result operand (output). 6535 ; @param A2 Pointer to the second operand (input). 6536 ; 6537 BEGINPROC_FASTCALL iemAImpl_cvttss2si_i32_r32, 16 6538 PROLOGUE_3_ARGS 6539 IEMIMPL_SSE_PROLOGUE 6540 SSE_AVX_LD_MXCSR A0_32 6541 6542 cvttss2si T0_32, [A2] 6543 mov dword [A1], T0_32 6544 6545 SSE_AVX_ST_MXCSR R0_32, A0_32 6546 IEMIMPL_SSE_EPILOGUE 6547 EPILOGUE_3_ARGS 6548 ENDPROC iemAImpl_cvttss2si_i32_r32 6549 6550 ;; 6551 ; cvttss2si instruction - 64-bit variant. 6552 ; 6553 ; @return R0_32 The new MXCSR value of the guest. 6554 ; @param A0_32 The guest's MXCSR register value to use. 6555 ; @param A1 Pointer to the result operand (output). 6556 ; @param A2 Pointer to the second operand (input). 6557 ; 6558 BEGINPROC_FASTCALL iemAImpl_cvttss2si_i64_r32, 16 6559 PROLOGUE_3_ARGS 6560 IEMIMPL_SSE_PROLOGUE 6561 SSE_AVX_LD_MXCSR A0_32 6562 6563 cvttss2si T0, [A2] 6564 mov qword [A1], T0 6565 6566 SSE_AVX_ST_MXCSR R0_32, A0_32 6567 IEMIMPL_SSE_EPILOGUE 6568 EPILOGUE_3_ARGS 6569 ENDPROC iemAImpl_cvttss2si_i64_r32 6570 6571 6572 ;; 6573 ; cvtss2si instruction - 32-bit variant. 6574 ; 6575 ; @return R0_32 The new MXCSR value of the guest. 6576 ; @param A0_32 The guest's MXCSR register value to use. 6577 ; @param A1 Pointer to the result operand (output). 6578 ; @param A2 Pointer to the second operand (input). 6579 ; 6580 BEGINPROC_FASTCALL iemAImpl_cvtss2si_i32_r32, 16 6581 PROLOGUE_3_ARGS 6582 IEMIMPL_SSE_PROLOGUE 6583 SSE_AVX_LD_MXCSR A0_32 6584 6585 cvtss2si T0_32, [A2] 6586 mov dword [A1], T0_32 6587 6588 SSE_AVX_ST_MXCSR R0_32, A0_32 6589 IEMIMPL_SSE_EPILOGUE 6590 EPILOGUE_3_ARGS 6591 ENDPROC iemAImpl_cvtss2si_i32_r32 6592 6593 ;; 6594 ; cvtss2si instruction - 64-bit variant. 6595 ; 6596 ; @return R0_32 The new MXCSR value of the guest. 6597 ; @param A0_32 The guest's MXCSR register value to use. 6598 ; @param A1 Pointer to the result operand (output). 6599 ; @param A2 Pointer to the second operand (input). 6600 ; 6601 BEGINPROC_FASTCALL iemAImpl_cvtss2si_i64_r32, 16 6602 PROLOGUE_3_ARGS 6603 IEMIMPL_SSE_PROLOGUE 6604 SSE_AVX_LD_MXCSR A0_32 6605 6606 cvtss2si T0, [A2] 6607 mov qword [A1], T0 6608 6609 SSE_AVX_ST_MXCSR R0_32, A0_32 6610 IEMIMPL_SSE_EPILOGUE 6611 EPILOGUE_3_ARGS 6612 ENDPROC iemAImpl_cvtss2si_i64_r32 6524 IEMIMPL_ %+ %2 %+ _EPILOGUE 6525 EPILOGUE_3_ARGS 6526 ENDPROC iemAImpl_ %+ %1 %+ _i64_r64 6527 %endmacro 6528 6529 IEMIMPL_MEDIA_V_CVTXSD2SI cvttsd2si, SSE 6530 IEMIMPL_MEDIA_V_CVTXSD2SI vcvttsd2si, AVX 6531 IEMIMPL_MEDIA_V_CVTXSD2SI cvtsd2si, SSE 6532 IEMIMPL_MEDIA_V_CVTXSD2SI vcvtsd2si, AVX 6613 6533 6614 6534 -
trunk/src/VBox/VMM/VMMAll/IEMAllAImplC.cpp
r105311 r105315 18968 18968 18969 18969 /** 18970 * CVTTSD2SI18970 * [V]CVTTSD2SI 18971 18971 */ 18972 18972 #ifdef IEM_WITHOUT_ASSEMBLY … … 18998 18998 18999 18999 19000 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvttsd2si_i32_r64_fallback,(uint32_t uMxCsrIn, int32_t *pi32Dst, PCRTFLOAT64U pr64Src)) 19001 { 19002 RTFLOAT64U r64Src; 19003 iemSsePrepareValueR64(&r64Src, uMxCsrIn, pr64Src); /* The de-normal flag is not set. */ 19004 19005 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19006 *pi32Dst = f64_to_i32_r_minMag(iemFpSoftF64FromIprt(&r64Src), true /*exact*/, &SoftState); 19007 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19008 } 19009 19010 19011 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvttsd2si_i64_r64_fallback,(uint32_t uMxCsrIn, int64_t *pi64Dst, PCRTFLOAT64U pr64Src)) 19012 { 19013 RTFLOAT64U r64Src; 19014 iemSsePrepareValueR64(&r64Src, uMxCsrIn, pr64Src); /* The de-normal flag is not set. */ 19015 19016 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19017 *pi64Dst = f64_to_i64_r_minMag(iemFpSoftF64FromIprt(&r64Src), true /*exact*/, &SoftState); 19018 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19019 } 19020 19021 19000 19022 /** 19001 * CVTSD2SI19023 * [V]CVTSD2SI 19002 19024 */ 19003 19025 #ifdef IEM_WITHOUT_ASSEMBLY … … 19029 19051 19030 19052 19053 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvtsd2si_i32_r64_fallback,(uint32_t uMxCsrIn, int32_t *pi32Dst, PCRTFLOAT64U pr64Src)) 19054 { 19055 RTFLOAT64U r64Src; 19056 iemSsePrepareValueR64(&r64Src, uMxCsrIn, pr64Src); /* The de-normal flag is not set. */ 19057 19058 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19059 *pi32Dst = f64_to_i32(iemFpSoftF64FromIprt(&r64Src), SoftState.roundingMode, true /*exact*/, &SoftState); 19060 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19061 } 19062 19063 19064 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvtsd2si_i64_r64_fallback,(uint32_t uMxCsrIn, int64_t *pi64Dst, PCRTFLOAT64U pr64Src)) 19065 { 19066 RTFLOAT64U r64Src; 19067 iemSsePrepareValueR64(&r64Src, uMxCsrIn, pr64Src); /* The de-normal flag is not set. */ 19068 19069 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19070 *pi64Dst = f64_to_i64(iemFpSoftF64FromIprt(&r64Src), SoftState.roundingMode, true /*exact*/, &SoftState); 19071 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19072 } 19073 19074 19031 19075 /** 19032 * CVTTSS2SI19076 * [V]CVTTSS2SI 19033 19077 */ 19034 19078 #ifdef IEM_WITHOUT_ASSEMBLY … … 19060 19104 19061 19105 19106 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvttss2si_i32_r32_fallback,(uint32_t uMxCsrIn, int32_t *pi32Dst, PCRTFLOAT32U pr32Src)) 19107 { 19108 RTFLOAT32U r32Src; 19109 iemSsePrepareValueR32(&r32Src, uMxCsrIn, pr32Src); /* The de-normal flag is not set. */ 19110 19111 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19112 *pi32Dst = f32_to_i32_r_minMag(iemFpSoftF32FromIprt(&r32Src), true /*exact*/, &SoftState); 19113 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19114 } 19115 19116 19117 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvttss2si_i64_r32_fallback,(uint32_t uMxCsrIn, int64_t *pi64Dst, PCRTFLOAT32U pr32Src)) 19118 { 19119 RTFLOAT32U r32Src; 19120 iemSsePrepareValueR32(&r32Src, uMxCsrIn, pr32Src); /* The de-normal flag is not set. */ 19121 19122 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19123 *pi64Dst = f32_to_i64_r_minMag(iemFpSoftF32FromIprt(&r32Src), true /*exact*/, &SoftState); 19124 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19125 } 19126 19127 19062 19128 /** 19063 * CVTSS2SI19129 * [V]CVTSS2SI 19064 19130 */ 19065 19131 #ifdef IEM_WITHOUT_ASSEMBLY … … 19089 19155 } 19090 19156 #endif 19157 19158 19159 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvtss2si_i32_r32_fallback,(uint32_t uMxCsrIn, int32_t *pi32Dst, PCRTFLOAT32U pr32Src)) 19160 { 19161 RTFLOAT32U r32Src; 19162 iemSsePrepareValueR32(&r32Src, uMxCsrIn, pr32Src); /* The de-normal flag is not set. */ 19163 19164 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19165 *pi32Dst = f32_to_i32(iemFpSoftF32FromIprt(&r32Src), SoftState.roundingMode, true /*exact*/, &SoftState); 19166 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19167 } 19168 19169 19170 IEM_DECL_IMPL_DEF(uint32_t, iemAImpl_vcvtss2si_i64_r32_fallback,(uint32_t uMxCsrIn, int64_t *pi64Dst, PCRTFLOAT32U pr32Src)) 19171 { 19172 RTFLOAT32U r32Src; 19173 iemSsePrepareValueR32(&r32Src, uMxCsrIn, pr32Src); /* The de-normal flag is not set. */ 19174 19175 softfloat_state_t SoftState = IEM_SOFTFLOAT_STATE_INITIALIZER_FROM_MXCSR(uMxCsrIn); 19176 *pi64Dst = f32_to_i64(iemFpSoftF32FromIprt(&r32Src), SoftState.roundingMode, true /*exact*/, &SoftState); 19177 return uMxCsrIn | (SoftState.exceptionFlags & X86_MXCSR_XCPT_FLAGS); 19178 } 19091 19179 19092 19180 -
trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py
r105283 r105315 3332 3332 'IEM_MC_STORE_FPU_RESULT_WITH_MEM_OP_THEN_POP': (McBlock.parseMcGeneric, True, True, False, ), 3333 3333 'IEM_MC_STORE_FPUREG_R80_SRC_REF': (McBlock.parseMcGeneric, True, True, False, ), 3334 'IEM_MC_STORE_GREG_I32': (McBlock.parseMcGeneric, True, True, True, ), 3334 3335 'IEM_MC_STORE_GREG_I64': (McBlock.parseMcGeneric, True, True, True, ), 3335 3336 'IEM_MC_STORE_GREG_U16': (McBlock.parseMcGeneric, True, True, True, ), -
trunk/src/VBox/VMM/VMMAll/IEMAllInstVexMap1.cpp.h
r105311 r105315 2746 2746 /* Opcode VEX.0F 0x2c - invalid */ 2747 2747 /* Opcode VEX.66.0F 0x2c - invalid */ 2748 2749 #define IEMOP_VCVTXSS2SI_Gy_Wss_BODY(a_Instr) \ 2750 IEMOP_HLP_IGNORE_VEX_W_PREFIX_IF_NOT_IN_64BIT(); \ 2751 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); \ 2752 if (pVCpu->iem.s.fPrefixes & IEM_OP_PRF_SIZE_REX_W) \ 2753 { \ 2754 if (IEM_IS_MODRM_REG_MODE(bRm)) \ 2755 { \ 2756 /* greg64, XMM */ \ 2757 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 2758 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2759 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2760 IEM_MC_PREPARE_AVX_USAGE(); \ 2761 IEM_MC_LOCAL( int64_t, i64Dst); \ 2762 IEM_MC_ARG_LOCAL_REF(int64_t *, pi64Dst, i64Dst, 0); \ 2763 IEM_MC_ARG( PCRTFLOAT32U, pr32Src, 1); \ 2764 IEM_MC_REF_XREG_R32_CONST(pr32Src, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 2765 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2766 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r32), \ 2767 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r32_fallback)), \ 2768 pi64Dst, pr32Src); \ 2769 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2770 IEM_MC_STORE_GREG_I64(IEM_GET_MODRM_REG(pVCpu, bRm), i64Dst); \ 2771 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2772 IEM_MC_END(); \ 2773 } \ 2774 else \ 2775 { \ 2776 /* greg64, [mem64] */ \ 2777 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 2778 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); \ 2779 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); \ 2780 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2781 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2782 IEM_MC_PREPARE_AVX_USAGE(); \ 2783 IEM_MC_LOCAL(RTFLOAT32U, r32Src); \ 2784 IEM_MC_ARG_LOCAL_REF(PCRTFLOAT32U, pr32Src, r32Src, 1); \ 2785 IEM_MC_FETCH_MEM_R32(r32Src, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 2786 IEM_MC_LOCAL( int64_t, i64Dst); \ 2787 IEM_MC_ARG_LOCAL_REF(int64_t *, pi64Dst, i64Dst, 0); \ 2788 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2789 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r32), \ 2790 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r32_fallback)), \ 2791 pi64Dst, pr32Src); \ 2792 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2793 IEM_MC_STORE_GREG_I64(IEM_GET_MODRM_REG(pVCpu, bRm), i64Dst); \ 2794 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2795 IEM_MC_END(); \ 2796 } \ 2797 } \ 2798 else \ 2799 { \ 2800 if (IEM_IS_MODRM_REG_MODE(bRm)) \ 2801 { \ 2802 /* greg, XMM */ \ 2803 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 2804 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2805 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2806 IEM_MC_PREPARE_AVX_USAGE(); \ 2807 IEM_MC_LOCAL( int32_t, i32Dst); \ 2808 IEM_MC_ARG_LOCAL_REF(int32_t *, pi32Dst, i32Dst, 0); \ 2809 IEM_MC_ARG( PCRTFLOAT32U, pr32Src, 1); \ 2810 IEM_MC_REF_XREG_R32_CONST(pr32Src, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 2811 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2812 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r32), \ 2813 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r32_fallback)), \ 2814 pi32Dst, pr32Src); \ 2815 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2816 IEM_MC_STORE_GREG_I32(IEM_GET_MODRM_REG(pVCpu, bRm), i32Dst); \ 2817 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2818 IEM_MC_END(); \ 2819 } \ 2820 else \ 2821 { \ 2822 /* greg, [mem] */ \ 2823 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 2824 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); \ 2825 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); \ 2826 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2827 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2828 IEM_MC_PREPARE_AVX_USAGE(); \ 2829 IEM_MC_LOCAL(RTFLOAT32U, r32Src); \ 2830 IEM_MC_ARG_LOCAL_REF(PCRTFLOAT32U, pr32Src, r32Src, 1); \ 2831 IEM_MC_FETCH_MEM_R32(r32Src, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 2832 IEM_MC_LOCAL( int32_t, i32Dst); \ 2833 IEM_MC_ARG_LOCAL_REF(int32_t *, pi32Dst, i32Dst, 0); \ 2834 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2835 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r32), \ 2836 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r32_fallback)), \ 2837 pi32Dst, pr32Src); \ 2838 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2839 IEM_MC_STORE_GREG_I32(IEM_GET_MODRM_REG(pVCpu, bRm), i32Dst); \ 2840 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2841 IEM_MC_END(); \ 2842 } \ 2843 } \ 2844 (void)0 2845 2846 2847 #define IEMOP_VCVTXSD2SI_Gy_Wss_BODY(a_Instr) \ 2848 IEMOP_HLP_IGNORE_VEX_W_PREFIX_IF_NOT_IN_64BIT(); \ 2849 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); \ 2850 if (pVCpu->iem.s.fPrefixes & IEM_OP_PRF_SIZE_REX_W) \ 2851 { \ 2852 if (IEM_IS_MODRM_REG_MODE(bRm)) \ 2853 { \ 2854 /* greg64, XMM */ \ 2855 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 2856 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2857 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2858 IEM_MC_PREPARE_AVX_USAGE(); \ 2859 IEM_MC_LOCAL( int64_t, i64Dst); \ 2860 IEM_MC_ARG_LOCAL_REF(int64_t *, pi64Dst, i64Dst, 0); \ 2861 IEM_MC_ARG( PCRTFLOAT64U, pr64Src, 1); \ 2862 IEM_MC_REF_XREG_R64_CONST(pr64Src, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 2863 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2864 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r64), \ 2865 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r64_fallback)), \ 2866 pi64Dst, pr64Src); \ 2867 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2868 IEM_MC_STORE_GREG_I64(IEM_GET_MODRM_REG(pVCpu, bRm), i64Dst); \ 2869 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2870 IEM_MC_END(); \ 2871 } \ 2872 else \ 2873 { \ 2874 /* greg64, [mem64] */ \ 2875 IEM_MC_BEGIN(IEM_MC_F_64BIT, 0); \ 2876 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); \ 2877 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); \ 2878 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2879 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2880 IEM_MC_PREPARE_AVX_USAGE(); \ 2881 IEM_MC_LOCAL(RTFLOAT64U, r64Src); \ 2882 IEM_MC_ARG_LOCAL_REF(PCRTFLOAT64U, pr64Src, r64Src, 1); \ 2883 IEM_MC_FETCH_MEM_R64(r64Src, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 2884 IEM_MC_LOCAL( int64_t, i64Dst); \ 2885 IEM_MC_ARG_LOCAL_REF(int64_t *, pi64Dst, i64Dst, 0); \ 2886 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2887 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r64), \ 2888 RT_CONCAT3(iemAImpl_,a_Instr,_i64_r64_fallback)), \ 2889 pi64Dst, pr64Src); \ 2890 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2891 IEM_MC_STORE_GREG_I64(IEM_GET_MODRM_REG(pVCpu, bRm), i64Dst); \ 2892 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2893 IEM_MC_END(); \ 2894 } \ 2895 } \ 2896 else \ 2897 { \ 2898 if (IEM_IS_MODRM_REG_MODE(bRm)) \ 2899 { \ 2900 /* greg, XMM */ \ 2901 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 2902 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2903 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2904 IEM_MC_PREPARE_AVX_USAGE(); \ 2905 IEM_MC_LOCAL( int32_t, i32Dst); \ 2906 IEM_MC_ARG_LOCAL_REF(int32_t *, pi32Dst, i32Dst, 0); \ 2907 IEM_MC_ARG( PCRTFLOAT64U, pr64Src, 1); \ 2908 IEM_MC_REF_XREG_R64_CONST(pr64Src, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 2909 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2910 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r64), \ 2911 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r64_fallback)), \ 2912 pi32Dst, pr64Src); \ 2913 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2914 IEM_MC_STORE_GREG_I32(IEM_GET_MODRM_REG(pVCpu, bRm), i32Dst); \ 2915 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2916 IEM_MC_END(); \ 2917 } \ 2918 else \ 2919 { \ 2920 /* greg, [mem] */ \ 2921 IEM_MC_BEGIN(IEM_MC_F_NOT_286_OR_OLDER, 0); \ 2922 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); \ 2923 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0); \ 2924 IEMOP_HLP_DONE_VEX_DECODING_EX(fAvx); \ 2925 IEM_MC_MAYBE_RAISE_AVX_RELATED_XCPT(); \ 2926 IEM_MC_PREPARE_AVX_USAGE(); \ 2927 IEM_MC_LOCAL(RTFLOAT64U, r64Src); \ 2928 IEM_MC_ARG_LOCAL_REF(PCRTFLOAT64U, pr64Src, r64Src, 1); \ 2929 IEM_MC_FETCH_MEM_R64(r64Src, pVCpu->iem.s.iEffSeg, GCPtrEffSrc); \ 2930 IEM_MC_LOCAL( int32_t, i32Dst); \ 2931 IEM_MC_ARG_LOCAL_REF(int32_t *, pi32Dst, i32Dst, 0); \ 2932 IEM_MC_CALL_AVX_AIMPL_2(IEM_SELECT_HOST_OR_FALLBACK(fAvx, \ 2933 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r64), \ 2934 RT_CONCAT3(iemAImpl_,a_Instr,_i32_r64_fallback)), \ 2935 pi32Dst, pr64Src); \ 2936 IEM_MC_MAYBE_RAISE_SSE_AVX_SIMD_FP_OR_UD_XCPT(); \ 2937 IEM_MC_STORE_GREG_I32(IEM_GET_MODRM_REG(pVCpu, bRm), i32Dst); \ 2938 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 2939 IEM_MC_END(); \ 2940 } \ 2941 } \ 2942 (void)0 2943 2944 2748 2945 /** Opcode VEX.F3.0F 0x2c - vcvttss2si Gy, Wss */ 2749 FNIEMOP_STUB(iemOp_vcvttss2si_Gy_Wss); 2946 FNIEMOP_DEF(iemOp_vcvttss2si_Gy_Wss) 2947 { 2948 IEMOP_MNEMONIC2(VEX_RM, VCVTTSS2SI, vcvttss2si, Gy, Wss, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0); 2949 IEMOP_VCVTXSS2SI_Gy_Wss_BODY( vcvttss2si); 2950 } 2951 2952 2750 2953 /** Opcode VEX.F2.0F 0x2c - vcvttsd2si Gy, Wsd */ 2751 FNIEMOP_STUB(iemOp_vcvttsd2si_Gy_Wsd); 2954 FNIEMOP_DEF(iemOp_vcvttsd2si_Gy_Wsd) 2955 { 2956 IEMOP_MNEMONIC2(VEX_RM, VCVTTSD2SI, vcvttsd2si, Gy, Wss, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0); 2957 IEMOP_VCVTXSD2SI_Gy_Wss_BODY( vcvttsd2si); 2958 } 2959 2752 2960 2753 2961 /* Opcode VEX.0F 0x2d - invalid */ 2754 2962 /* Opcode VEX.66.0F 0x2d - invalid */ 2963 2964 2755 2965 /** Opcode VEX.F3.0F 0x2d - vcvtss2si Gy, Wss */ 2756 FNIEMOP_STUB(iemOp_vcvtss2si_Gy_Wss); 2966 FNIEMOP_DEF(iemOp_vcvtss2si_Gy_Wss) 2967 { 2968 IEMOP_MNEMONIC2(VEX_RM, VCVTSS2SI, vcvtss2si, Gy, Wss, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0); 2969 IEMOP_VCVTXSS2SI_Gy_Wss_BODY( vcvtss2si); 2970 } 2971 2972 2757 2973 /** Opcode VEX.F2.0F 0x2d - vcvtsd2si Gy, Wsd */ 2758 FNIEMOP_STUB(iemOp_vcvtsd2si_Gy_Wsd); 2974 FNIEMOP_DEF(iemOp_vcvtsd2si_Gy_Wsd) 2975 { 2976 IEMOP_MNEMONIC2(VEX_RM, VCVTSD2SI, vcvtsd2si, Gy, Wss, DISOPTYPE_HARMLESS | DISOPTYPE_X86_AVX, 0); 2977 IEMOP_VCVTXSD2SI_Gy_Wss_BODY( vcvtsd2si); 2978 } 2979 2759 2980 2760 2981 -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veLiveness.cpp
r105183 r105315 575 575 #define IEM_MC_STORE_GREG_U16(a_iGReg, a_u16Value) IEM_LIVENESS_GPR_MODIFY(a_iGReg) 576 576 #define IEM_MC_STORE_GREG_U32(a_iGReg, a_u32Value) IEM_LIVENESS_GPR_CLOBBER(a_iGReg) 577 #define IEM_MC_STORE_GREG_I32(a_iGReg, a_i32Value) IEM_LIVENESS_GPR_CLOBBER(a_iGReg) 577 578 #define IEM_MC_STORE_GREG_U64(a_iGReg, a_u64Value) IEM_LIVENESS_GPR_CLOBBER(a_iGReg) 578 579 #define IEM_MC_STORE_GREG_I64(a_iGReg, a_i64Value) IEM_LIVENESS_GPR_CLOBBER(a_iGReg) -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompFuncs.h
r105271 r105315 4281 4281 off = iemNativeEmitStoreGregU32(pReNative, off, a_iGReg, a_u32Value) 4282 4282 4283 /** Emits code for IEM_MC_STORE_GREG_U32. */ 4283 #define IEM_MC_STORE_GREG_I32(a_iGReg, a_i32Value) \ 4284 off = iemNativeEmitStoreGregU32(pReNative, off, a_iGReg, a_i32Value) 4285 4286 /** Emits code for IEM_MC_STORE_GREG_U32/IEM_MC_STORE_GREG_I32. */ 4284 4287 DECL_INLINE_THROW(uint32_t) 4285 4288 iemNativeEmitStoreGregU32(PIEMRECOMPILERSTATE pReNative, uint32_t off, uint8_t iGReg, uint8_t idxValueVar) -
trunk/src/VBox/VMM/include/IEMInternal.h
r105311 r105315 4130 4130 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2I64U32,(uint32_t uMxCsrIn, int64_t *pi64Dst, const uint32_t *pu32Src)); /* pu32Src is a single precision floating point. */ 4131 4131 typedef FNIEMAIMPLSSEF2I64U32 *PFNIEMAIMPLSSEF2I64U32; 4132 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2I32R32,(uint32_t uMxCsrIn, int32_t *pi32Dst, PCRTFLOAT32U pr32Src)); 4133 typedef FNIEMAIMPLSSEF2I32R32 *PFNIEMAIMPLSSEF2I32R32; 4134 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2I64R32,(uint32_t uMxCsrIn, int64_t *pi64Dst, PCRTFLOAT32U pr32Src)); 4135 typedef FNIEMAIMPLSSEF2I64R32 *PFNIEMAIMPLSSEF2I64R32; 4136 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2I32R64,(uint32_t uMxCsrIn, int32_t *pi32Dst, PCRTFLOAT64U pr64Src)); 4137 typedef FNIEMAIMPLSSEF2I32R64 *PFNIEMAIMPLSSEF2I32R64; 4138 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2I64R64,(uint32_t uMxCsrIn, int64_t *pi64Dst, PCRTFLOAT64U pr64Src)); 4139 typedef FNIEMAIMPLSSEF2I64R64 *PFNIEMAIMPLSSEF2I64R64; 4132 4140 4133 4141 FNIEMAIMPLSSEF2I32U64 iemAImpl_cvttsd2si_i32_r64; … … 4142 4150 FNIEMAIMPLSSEF2I64U32 iemAImpl_cvttss2si_i64_r32; 4143 4151 FNIEMAIMPLSSEF2I64U32 iemAImpl_cvtss2si_i64_r32; 4152 4153 FNIEMAIMPLSSEF2I32R32 iemAImpl_vcvttss2si_i32_r32, iemAImpl_vcvttss2si_i32_r32_fallback; 4154 FNIEMAIMPLSSEF2I64R32 iemAImpl_vcvttss2si_i64_r32, iemAImpl_vcvttss2si_i64_r32_fallback; 4155 FNIEMAIMPLSSEF2I32R32 iemAImpl_vcvtss2si_i32_r32, iemAImpl_vcvtss2si_i32_r32_fallback; 4156 FNIEMAIMPLSSEF2I64R32 iemAImpl_vcvtss2si_i64_r32, iemAImpl_vcvtss2si_i64_r32_fallback; 4157 4158 FNIEMAIMPLSSEF2I32R64 iemAImpl_vcvttss2si_i32_r64, iemAImpl_vcvttss2si_i32_r64_fallback; 4159 FNIEMAIMPLSSEF2I64R64 iemAImpl_vcvttss2si_i64_r64, iemAImpl_vcvttss2si_i64_r64_fallback; 4160 FNIEMAIMPLSSEF2I32R64 iemAImpl_vcvtss2si_i32_r64, iemAImpl_vcvtss2si_i32_r64_fallback; 4161 FNIEMAIMPLSSEF2I64R64 iemAImpl_vcvtss2si_i64_r64, iemAImpl_vcvtss2si_i64_r64_fallback; 4162 4163 FNIEMAIMPLSSEF2I32R32 iemAImpl_vcvttsd2si_i32_r32, iemAImpl_vcvttsd2si_i32_r32_fallback; 4164 FNIEMAIMPLSSEF2I64R32 iemAImpl_vcvttsd2si_i64_r32, iemAImpl_vcvttsd2si_i64_r32_fallback; 4165 FNIEMAIMPLSSEF2I32R32 iemAImpl_vcvtsd2si_i32_r32, iemAImpl_vcvtsd2si_i32_r32_fallback; 4166 FNIEMAIMPLSSEF2I64R32 iemAImpl_vcvtsd2si_i64_r32, iemAImpl_vcvtsd2si_i64_r32_fallback; 4167 4168 FNIEMAIMPLSSEF2I32R64 iemAImpl_vcvttsd2si_i32_r64, iemAImpl_vcvttsd2si_i32_r64_fallback; 4169 FNIEMAIMPLSSEF2I64R64 iemAImpl_vcvttsd2si_i64_r64, iemAImpl_vcvttsd2si_i64_r64_fallback; 4170 FNIEMAIMPLSSEF2I32R64 iemAImpl_vcvtsd2si_i32_r64, iemAImpl_vcvtsd2si_i32_r64_fallback; 4171 FNIEMAIMPLSSEF2I64R64 iemAImpl_vcvtsd2si_i64_r64, iemAImpl_vcvtsd2si_i64_r64_fallback; 4144 4172 4145 4173 typedef IEM_DECL_IMPL_TYPE(uint32_t, FNIEMAIMPLSSEF2R32I32,(uint32_t uMxCsrIn, PRTFLOAT32U pr32Dst, const int32_t *pi32Src)); -
trunk/src/VBox/VMM/include/IEMMc.h
r105283 r105315 305 305 #define IEM_MC_STORE_GREG_U16(a_iGReg, a_u16Value) *iemGRegRefU16(pVCpu, (a_iGReg)) = (a_u16Value) 306 306 #define IEM_MC_STORE_GREG_U32(a_iGReg, a_u32Value) *iemGRegRefU64(pVCpu, (a_iGReg)) = (uint32_t)(a_u32Value) /* clear high bits. */ 307 #define IEM_MC_STORE_GREG_I32(a_iGReg, a_i32Value) *iemGRegRefU64(pVCpu, (a_iGReg)) = (uint32_t)(a_i32Value) /* clear high bits. */ 307 308 #define IEM_MC_STORE_GREG_U64(a_iGReg, a_u64Value) *iemGRegRefU64(pVCpu, (a_iGReg)) = (a_u64Value) 308 309 #define IEM_MC_STORE_GREG_I64(a_iGReg, a_i64Value) *iemGRegRefI64(pVCpu, (a_iGReg)) = (a_i64Value) -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r105295 r105315 716 716 #define IEM_MC_STORE_GREG_U16(a_iGReg, a_u16Value) do { CHK_GREG_IDX(a_iGReg); CHK_VAR(a_u16Value); CHK_TYPE(uint16_t, a_u16Value); (void)fMcBegin; } while (0) 717 717 #define IEM_MC_STORE_GREG_U32(a_iGReg, a_u32Value) do { CHK_GREG_IDX(a_iGReg); CHK_VAR(a_u32Value); (void)fMcBegin; } while (0) 718 #define IEM_MC_STORE_GREG_I32(a_iGReg, a_i32Value) do { CHK_GREG_IDX(a_iGReg); CHK_VAR(a_i32Value); (void)fMcBegin; } while (0) 718 719 #define IEM_MC_STORE_GREG_U64(a_iGReg, a_u64Value) do { CHK_GREG_IDX(a_iGReg); CHK_VAR(a_u64Value); (void)fMcBegin; } while (0) 719 720 #define IEM_MC_STORE_GREG_I64(a_iGReg, a_i64Value) do { CHK_GREG_IDX(a_iGReg); CHK_VAR(a_i64Value); (void)fMcBegin; } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.