- Timestamp:
- Feb 24, 2022 10:28:32 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/types.h
r93115 r93906 1122 1122 1123 1123 1124 /** 1125 * Packed BCD 18-digit signed integer format (80-bit). 1126 */ 1127 #pragma pack(1) 1128 typedef union RTPBCD80U 1129 { 1130 /** Format using bitfields. */ 1131 RT_GCC_EXTENSION struct 1132 { 1133 # ifdef RT_BIG_ENDIAN 1134 /** The sign indicator. */ 1135 RT_GCC_EXTENSION uint8_t fSign : 1; 1136 /** Padding, non-zero if indefinite. */ 1137 RT_GCC_EXTENSION uint8_t uPad : 7; 1138 /** 18 packed BCD digits, two to a byte. */ 1139 uint8_t aBcdDigits[9]; 1140 # else 1141 /** 18 packed BCD digits, two to a byte. */ 1142 uint8_t aBcdDigits[9]; 1143 /** Padding, non-zero if indefinite. */ 1144 RT_GCC_EXTENSION uint8_t uPad : 7; 1145 /** The sign indicator. */ 1146 RT_GCC_EXTENSION uint8_t fSign : 1; 1147 # endif 1148 } s; 1149 1150 /** 64-bit view. */ 1151 uint64_t au64[1]; 1152 /** 32-bit view. */ 1153 uint32_t au32[2]; 1154 /** 16-bit view. */ 1155 uint16_t au16[5]; 1156 /** 8-bit view. */ 1157 uint8_t au8[10]; 1158 } RTPBCD80U; 1159 #pragma pack() 1160 /** Pointer to a packed BCD integer format union. */ 1161 typedef RTPBCD80U RT_FAR *PRTPBCD80U; 1162 /** Pointer to a const packed BCD integer format union. */ 1163 typedef const RTPBCD80U RT_FAR *PCRTPBCD80U; 1164 1165 1124 1166 /** Generic function type. 1125 1167 * @see PFNRT -
trunk/src/VBox/VMM/VMMAll/IEMAll.cpp
r93635 r93906 11911 11911 (a_pr80Dst)->au16[4] = UINT16_C(0xffff); \ 11912 11912 } while (0) 11913 #define IEM_MC_STORE_MEM_INDEF_D80_BY_REF(a_pd80Dst) \ 11914 do { \ 11915 (a_pd80Dst)->au64[0] = UINT64_C(0xc000000000000000); \ 11916 (a_pd80Dst)->au16[4] = UINT16_C(0xffff); \ 11917 } while (0) 11913 11918 11914 11919 #ifndef IEM_WITH_SETJMP -
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r93792 r93906 2521 2521 2522 2522 ;; 2523 ; Loads an 80-bit floating point register value in BCD format from memory. 2524 ; 2525 ; @param A0 FPU context (fxsave). 2526 ; @param A1 Pointer to a IEMFPURESULT for the output. 2527 ; @param A2 Pointer to the 80-bit BCD value to load. 2528 ; 2529 BEGINPROC_FASTCALL iemAImpl_fld_r80_from_d80, 12 2530 PROLOGUE_3_ARGS 2531 sub xSP, 20h 2532 2533 fninit 2534 FPU_LD_FXSTATE_FCW_AND_SAFE_FSW A0 2535 fbld tword [A2] 2536 2537 fnstsw word [A1 + IEMFPURESULT.FSW] 2538 fnclex 2539 fstp tword [A1 + IEMFPURESULT.r80Result] 2540 2541 fninit 2542 add xSP, 20h 2543 EPILOGUE_3_ARGS 2544 ENDPROC iemAImpl_fld_r80_from_d80 2545 2546 2547 ;; 2548 ; Store a 80-bit floating point register to memory as BCD 2549 ; 2550 ; @param A0 FPU context (fxsave). 2551 ; @param A1 Where to return the output FSW. 2552 ; @param A2 Where to store the 80-bit BCD value. 2553 ; @param A3 Pointer to the 80-bit register value. 2554 ; 2555 BEGINPROC_FASTCALL iemAImpl_fst_r80_to_d80, 16 2556 PROLOGUE_4_ARGS 2557 sub xSP, 20h 2558 2559 fninit 2560 fld tword [A3] 2561 FPU_LD_FXSTATE_FCW_AND_SAFE_FSW A0 2562 fbstp tword [A2] 2563 2564 fnstsw word [A1] 2565 2566 fninit 2567 add xSP, 20h 2568 EPILOGUE_4_ARGS 2569 ENDPROC iemAImpl_fst_r80_to_d80 2570 2571 2572 ;; 2523 2573 ; FPU instruction working on two 80-bit floating point values. 2524 2574 ; -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsOneByte.cpp.h
r93115 r93906 10105 10105 10106 10106 /** Opcode 0xdf !11/6. */ 10107 FNIEMOP_STUB_1(iemOp_fbstp_m80d, uint8_t, bRm); 10107 FNIEMOP_DEF_1(iemOp_fbstp_m80d, uint8_t, bRm) 10108 { 10109 IEMOP_MNEMONIC(fbstp_m80d, "fbstp m80d"); 10110 IEM_MC_BEGIN(3, 2); 10111 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 10112 IEM_MC_LOCAL(uint16_t, u16Fsw); 10113 IEM_MC_ARG_LOCAL_REF(uint16_t *, pu16Fsw, u16Fsw, 0); 10114 IEM_MC_ARG(PRTPBCD80U, pd80Dst, 1); 10115 IEM_MC_ARG(PCRTFLOAT80U, pr80Value, 2); 10116 10117 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 10118 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 10119 IEM_MC_MAYBE_RAISE_DEVICE_NOT_AVAILABLE(); 10120 IEM_MC_MAYBE_RAISE_FPU_XCPT(); 10121 10122 IEM_MC_MEM_MAP(pd80Dst, IEM_ACCESS_DATA_W, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 1 /*arg*/); 10123 IEM_MC_PREPARE_FPU_USAGE(); 10124 IEM_MC_IF_FPUREG_NOT_EMPTY_REF_R80(pr80Value, 0) 10125 IEM_MC_CALL_FPU_AIMPL_3(iemAImpl_fst_r80_to_d80, pu16Fsw, pd80Dst, pr80Value); 10126 IEM_MC_MEM_COMMIT_AND_UNMAP_FOR_FPU_STORE(pd80Dst, IEM_ACCESS_DATA_W, u16Fsw); 10127 IEM_MC_UPDATE_FSW_WITH_MEM_OP_THEN_POP(u16Fsw, pVCpu->iem.s.iEffSeg, GCPtrEffDst); 10128 IEM_MC_ELSE() 10129 IEM_MC_IF_FCW_IM() 10130 IEM_MC_STORE_MEM_INDEF_D80_BY_REF(pd80Dst); 10131 IEM_MC_MEM_COMMIT_AND_UNMAP(pd80Dst, IEM_ACCESS_DATA_W); 10132 IEM_MC_ENDIF(); 10133 IEM_MC_FPU_STACK_UNDERFLOW_MEM_OP_THEN_POP(UINT8_MAX, pVCpu->iem.s.iEffSeg, GCPtrEffDst); 10134 IEM_MC_ENDIF(); 10135 IEM_MC_ADVANCE_RIP(); 10136 10137 IEM_MC_END(); 10138 return VINF_SUCCESS; 10139 } 10108 10140 10109 10141 -
trunk/src/VBox/VMM/include/IEMInternal.h
r93862 r93906 1420 1420 PRTFLOAT80U pr80Dst, PCRTFLOAT80U pr80Src)); 1421 1421 1422 IEM_DECL_IMPL_DEF(void, iemAImpl_fld_r80_from_d80,(PCX86FXSTATE pFpuState, PIEMFPURESULT pFpuRes, PCRTPBCD80U pd80Val)); 1423 IEM_DECL_IMPL_DEF(void, iemAImpl_fst_r80_to_d80,(PCX86FXSTATE pFpuState, uint16_t *pu16FSW, 1424 PRTPBCD80U pd80Dst, PCRTFLOAT80U pr80Src)); 1425 1422 1426 /** @} */ 1423 1427
Note:
See TracChangeset
for help on using the changeset viewer.