Changeset 40250 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Feb 24, 2012 8:28:08 PM (13 years ago)
- Location:
- trunk/src/VBox/VMM/VMMAll
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r40248 r40250 4935 4935 4936 4936 /** 4937 * Fetches a data tword. 4938 * 4939 * @returns Strict VBox status code. 4940 * @param pIemCpu The IEM per CPU data. 4941 * @param pr80Dst Where to return the tword. 4942 * @param iSegReg The index of the segment register to use for 4943 * this access. The base and limits are checked. 4944 * @param GCPtrMem The address of the guest memory. 4945 */ 4946 static VBOXSTRICTRC iemMemFetchDataR80(PIEMCPU pIemCpu, PRTFLOAT80U pr80Dst, uint8_t iSegReg, RTGCPTR GCPtrMem) 4947 { 4948 /* The lazy approach for now... */ 4949 PCRTFLOAT80U pr80Src; 4950 VBOXSTRICTRC rc = iemMemMap(pIemCpu, (void **)&pr80Src, sizeof(*pr80Src), iSegReg, GCPtrMem, IEM_ACCESS_DATA_R); 4951 if (rc == VINF_SUCCESS) 4952 { 4953 *pr80Dst = *pr80Src; 4954 rc = iemMemCommitAndUnmap(pIemCpu, (void *)pr80Src, IEM_ACCESS_DATA_R); 4955 } 4956 return rc; 4957 } 4958 4959 4960 /** 4937 4961 * Fetches a descriptor register (lgdt, lidt). 4938 4962 * … … 6016 6040 IEM_MC_RETURN_ON_FAILURE(iemMemFetchDataU64(pIemCpu, &(a_r64Dst).au64[0], (a_iSeg), (a_GCPtrMem))) 6017 6041 #define IEM_MC_FETCH_MEM_R80(a_r80Dst, a_iSeg, a_GCPtrMem) \ 6018 IEM_MC_RETURN_ON_FAILURE(iemMemFetchDataR80(pIemCpu, &(a_r 64Dst), (a_iSeg), (a_GCPtrMem)))6042 IEM_MC_RETURN_ON_FAILURE(iemMemFetchDataR80(pIemCpu, &(a_r80Dst), (a_iSeg), (a_GCPtrMem))) 6019 6043 6020 6044 -
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r40248 r40250 1893 1893 1894 1894 ;; 1895 ; Loads a 80-bit floating point register value from memory. 1896 ; 1897 ; @param A0 FPU context (fxsave). 1898 ; @param A1 Pointer to a IEMFPURESULT for the output. 1899 ; @param A2 Pointer to the 80-bit floating point value to load. 1900 ; 1901 BEGINPROC_FASTCALL iemAImpl_fld_r80_from_r80, 12 1902 PROLOGUE_3_ARGS 1903 sub xSP, 20h 1904 1905 fninit 1906 FPU_LD_FXSTATE_FCW_AND_SAFE_FSW A0 1907 fld tword [A2] 1908 1909 fnstsw word [A1 + IEMFPURESULT.FSW] 1910 fnclex 1911 fstp tword [A1 + IEMFPURESULT.r80Result] 1912 1913 fninit 1914 add xSP, 20h 1915 EPILOGUE_3_ARGS 0 1916 ENDPROC iemAImpl_fld_r80_from_r80 1917 1918 1919 ;; 1920 ; Store a 80-bit floating point register to memory 1921 ; 1922 ; @param A0 FPU context (fxsave). 1923 ; @param A1 Where to return the output FSW. 1924 ; @param A2 Where to store the 80-bit value. 1925 ; @param A3 Pointer to the 80-bit register value. 1926 ; 1927 BEGINPROC_FASTCALL iemAImpl_fst_r80_to_r80, 12 1928 PROLOGUE_3_ARGS 1929 sub xSP, 20h 1930 1931 fninit 1932 fld tword [A3] 1933 FPU_LD_FXSTATE_FCW_AND_SAFE_FSW A0 1934 fstp tword [A2] 1935 1936 fnstsw word [A1] 1937 1938 fninit 1939 add xSP, 20h 1940 EPILOGUE_3_ARGS 0 1941 ENDPROC iemAImpl_fst_r80_to_r80 1942 1943 1944 ;; 1895 1945 ; FPU instruction working on two 80-bit floating point values. 1896 1946 ; -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r40248 r40250 11795 11795 11796 11796 /** Opcode 0xdb !11/5. */ 11797 FNIEMOP_STUB_1(iemOp_fld_m80r, uint8_t, bRm); 11797 FNIEMOP_DEF_1(iemOp_fld_m80r, uint8_t, bRm) 11798 { 11799 IEMOP_MNEMONIC("fld m80r"); 11800 11801 IEM_MC_BEGIN(2, 3); 11802 IEM_MC_LOCAL(RTGCPTR, GCPtrEffSrc); 11803 IEM_MC_LOCAL(IEMFPURESULT, FpuRes); 11804 IEM_MC_LOCAL(RTFLOAT80U, r80Val); 11805 IEM_MC_ARG_LOCAL_REF(PIEMFPURESULT, pFpuRes, FpuRes, 0); 11806 IEM_MC_ARG_LOCAL_REF(PCRTFLOAT80U, pr80Val, r80Val, 1); 11807 11808 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm); 11809 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 11810 11811 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 11812 IEM_MC_MAYBE_RAISE_FPU_XCPT(); 11813 IEM_MC_FETCH_MEM_R80(r80Val, pIemCpu->iEffSeg, GCPtrEffSrc); 11814 11815 IEM_MC_IF_FPUREG_IS_EMPTY(7) 11816 IEM_MC_CALL_FPU_AIMPL_2(iemAImpl_fld_r80_from_r80, pFpuRes, pr80Val); 11817 IEM_MC_PUSH_FPU_RESULT_MEM_OP(FpuRes, pIemCpu->iEffSeg, GCPtrEffSrc); 11818 IEM_MC_ELSE() 11819 IEM_MC_FPU_STACK_PUSH_OVERFLOW_MEM_OP(pIemCpu->iEffSeg, GCPtrEffSrc); 11820 IEM_MC_ENDIF(); 11821 IEM_MC_ADVANCE_RIP(); 11822 11823 IEM_MC_END(); 11824 return VINF_SUCCESS; 11825 } 11798 11826 11799 11827 11800 11828 /** Opcode 0xdb !11/7. */ 11801 FNIEMOP_STUB_1(iemOp_fstp_m80r, uint8_t, bRm); 11829 FNIEMOP_DEF_1(iemOp_fstp_m80r, uint8_t, bRm) 11830 { 11831 IEMOP_MNEMONIC("fstp m80r"); 11832 IEM_MC_BEGIN(3, 2); 11833 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 11834 IEM_MC_LOCAL(uint16_t, u16Fsw); 11835 IEM_MC_ARG_LOCAL_REF(uint16_t *, pu16Fsw, u16Fsw, 0); 11836 IEM_MC_ARG(PRTFLOAT80U, pr80Dst, 1); 11837 IEM_MC_ARG(PCRTFLOAT80U, pr80Value, 2); 11838 11839 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm); 11840 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 11841 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 11842 IEM_MC_MAYBE_RAISE_FPU_XCPT(); 11843 11844 IEM_MC_MEM_MAP(pr80Dst, IEM_ACCESS_DATA_W, pIemCpu->iEffSeg, GCPtrEffDst, 1 /*arg*/); 11845 IEM_MC_IF_FPUREG_NOT_EMPTY_REF_R80(pr80Value, 0) 11846 IEM_MC_CALL_FPU_AIMPL_3(iemAImpl_fst_r80_to_r80, pu16Fsw, pr80Dst, pr80Value); 11847 IEM_MC_MEM_COMMIT_AND_UNMAP_FOR_FPU_STORE(pr80Dst, IEM_ACCESS_DATA_W, u16Fsw); 11848 IEM_MC_UPDATE_FSW_WITH_MEM_OP_THEN_POP(u16Fsw, pIemCpu->iEffSeg, GCPtrEffDst); 11849 IEM_MC_ELSE() 11850 IEM_MC_IF_FCW_IM() 11851 IEM_MC_STORE_MEM_NEG_QNAN_R80_BY_REF(pr80Dst); 11852 IEM_MC_MEM_COMMIT_AND_UNMAP(pr80Dst, IEM_ACCESS_DATA_W); 11853 IEM_MC_ENDIF(); 11854 IEM_MC_FPU_STACK_UNDERFLOW_MEM_OP_THEN_POP(UINT8_MAX, pIemCpu->iEffSeg, GCPtrEffDst); 11855 IEM_MC_ENDIF(); 11856 IEM_MC_ADVANCE_RIP(); 11857 11858 IEM_MC_END(); 11859 return VINF_SUCCESS; 11860 } 11802 11861 11803 11862
Note:
See TracChangeset
for help on using the changeset viewer.