Changeset 99305 in vbox
- Timestamp:
- Apr 6, 2023 1:53:28 AM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h
r99287 r99305 8979 8979 8980 8980 /** 8981 * Common workerfor iemOp_bt_Ev_Gv, iemOp_btc_Ev_Gv, iemOp_btr_Ev_Gv and8981 * Body for iemOp_bt_Ev_Gv, iemOp_btc_Ev_Gv, iemOp_btr_Ev_Gv and 8982 8982 * iemOp_bts_Ev_Gv. 8983 8983 */ 8984 FNIEMOP_DEF_1(iemOpCommonBit_Ev_Gv, PCIEMOPBINSIZES, pImpl) 8985 { 8986 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); 8987 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF); 8988 8989 if (IEM_IS_MODRM_REG_MODE(bRm)) 8990 { 8991 /* register destination. */ 8992 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 8993 switch (pVCpu->iem.s.enmEffOpSize) 8994 { 8995 case IEMMODE_16BIT: 8996 IEM_MC_BEGIN(3, 0); 8997 IEM_MC_ARG(uint16_t *, pu16Dst, 0); 8998 IEM_MC_ARG(uint16_t, u16Src, 1); 8999 IEM_MC_ARG(uint32_t *, pEFlags, 2); 9000 9001 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 9002 IEM_MC_AND_LOCAL_U16(u16Src, 0xf); 9003 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); 9004 IEM_MC_REF_EFLAGS(pEFlags); 9005 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU16, pu16Dst, u16Src, pEFlags); 9006 9007 IEM_MC_ADVANCE_RIP_AND_FINISH(); 9008 IEM_MC_END(); 9009 break; 9010 9011 case IEMMODE_32BIT: 9012 IEM_MC_BEGIN(3, 0); 9013 IEM_MC_ARG(uint32_t *, pu32Dst, 0); 9014 IEM_MC_ARG(uint32_t, u32Src, 1); 9015 IEM_MC_ARG(uint32_t *, pEFlags, 2); 9016 9017 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 9018 IEM_MC_AND_LOCAL_U32(u32Src, 0x1f); 9019 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); 9020 IEM_MC_REF_EFLAGS(pEFlags); 9021 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU32, pu32Dst, u32Src, pEFlags); 9022 9023 IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(pu32Dst); 9024 IEM_MC_ADVANCE_RIP_AND_FINISH(); 9025 IEM_MC_END(); 9026 break; 9027 9028 case IEMMODE_64BIT: 9029 IEM_MC_BEGIN(3, 0); 9030 IEM_MC_ARG(uint64_t *, pu64Dst, 0); 9031 IEM_MC_ARG(uint64_t, u64Src, 1); 9032 IEM_MC_ARG(uint32_t *, pEFlags, 2); 9033 9034 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 9035 IEM_MC_AND_LOCAL_U64(u64Src, 0x3f); 9036 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); 9037 IEM_MC_REF_EFLAGS(pEFlags); 9038 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU64, pu64Dst, u64Src, pEFlags); 9039 9040 IEM_MC_ADVANCE_RIP_AND_FINISH(); 9041 IEM_MC_END(); 9042 break; 9043 9044 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 9045 } 9046 } 9047 else 9048 { 9049 /* memory destination. */ 9050 9051 uint32_t fAccess; 9052 if (pImpl->pfnLockedU16) 9053 fAccess = IEM_ACCESS_DATA_RW; 9054 else /* BT */ 9055 fAccess = IEM_ACCESS_DATA_R; 9056 9057 /** @todo test negative bit offsets! */ 9058 switch (pVCpu->iem.s.enmEffOpSize) 9059 { 9060 case IEMMODE_16BIT: 9061 IEM_MC_BEGIN(3, 2); 9062 IEM_MC_ARG(uint16_t *, pu16Dst, 0); 9063 IEM_MC_ARG(uint16_t, u16Src, 1); 9064 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); 9065 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 9066 IEM_MC_LOCAL(int16_t, i16AddrAdj); 9067 9068 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 9069 if (pImpl->pfnLockedU16) 9070 IEMOP_HLP_DONE_DECODING(); 9071 else 9072 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 9073 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 9074 IEM_MC_ASSIGN(i16AddrAdj, u16Src); 9075 IEM_MC_AND_ARG_U16(u16Src, 0x0f); 9076 IEM_MC_SAR_LOCAL_S16(i16AddrAdj, 4); 9077 IEM_MC_SHL_LOCAL_S16(i16AddrAdj, 1); 9078 IEM_MC_ADD_LOCAL_S16_TO_EFF_ADDR(GCPtrEffDst, i16AddrAdj); 9079 IEM_MC_FETCH_EFLAGS(EFlags); 9080 9081 IEM_MC_MEM_MAP(pu16Dst, fAccess, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); 9082 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK)) 9083 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU16, pu16Dst, u16Src, pEFlags); 9084 else 9085 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnLockedU16, pu16Dst, u16Src, pEFlags); 9086 IEM_MC_MEM_COMMIT_AND_UNMAP(pu16Dst, fAccess); 9087 9088 IEM_MC_COMMIT_EFLAGS(EFlags); 9089 IEM_MC_ADVANCE_RIP_AND_FINISH(); 9090 IEM_MC_END(); 9091 break; 9092 9093 case IEMMODE_32BIT: 9094 IEM_MC_BEGIN(3, 2); 9095 IEM_MC_ARG(uint32_t *, pu32Dst, 0); 9096 IEM_MC_ARG(uint32_t, u32Src, 1); 9097 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); 9098 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 9099 IEM_MC_LOCAL(int32_t, i32AddrAdj); 9100 9101 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 9102 if (pImpl->pfnLockedU16) 9103 IEMOP_HLP_DONE_DECODING(); 9104 else 9105 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 9106 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 9107 IEM_MC_ASSIGN(i32AddrAdj, u32Src); 9108 IEM_MC_AND_ARG_U32(u32Src, 0x1f); 9109 IEM_MC_SAR_LOCAL_S32(i32AddrAdj, 5); 9110 IEM_MC_SHL_LOCAL_S32(i32AddrAdj, 2); 9111 IEM_MC_ADD_LOCAL_S32_TO_EFF_ADDR(GCPtrEffDst, i32AddrAdj); 9112 IEM_MC_FETCH_EFLAGS(EFlags); 9113 9114 IEM_MC_MEM_MAP(pu32Dst, fAccess, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); 9115 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK)) 9116 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU32, pu32Dst, u32Src, pEFlags); 9117 else 9118 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnLockedU32, pu32Dst, u32Src, pEFlags); 9119 IEM_MC_MEM_COMMIT_AND_UNMAP(pu32Dst, fAccess); 9120 9121 IEM_MC_COMMIT_EFLAGS(EFlags); 9122 IEM_MC_ADVANCE_RIP_AND_FINISH(); 9123 IEM_MC_END(); 9124 break; 9125 9126 case IEMMODE_64BIT: 9127 IEM_MC_BEGIN(3, 2); 9128 IEM_MC_ARG(uint64_t *, pu64Dst, 0); 9129 IEM_MC_ARG(uint64_t, u64Src, 1); 9130 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); 9131 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); 9132 IEM_MC_LOCAL(int64_t, i64AddrAdj); 9133 9134 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); 9135 if (pImpl->pfnLockedU16) 9136 IEMOP_HLP_DONE_DECODING(); 9137 else 9138 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); 9139 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, bRm)); 9140 IEM_MC_ASSIGN(i64AddrAdj, u64Src); 9141 IEM_MC_AND_ARG_U64(u64Src, 0x3f); 9142 IEM_MC_SAR_LOCAL_S64(i64AddrAdj, 6); 9143 IEM_MC_SHL_LOCAL_S64(i64AddrAdj, 3); 9144 IEM_MC_ADD_LOCAL_S64_TO_EFF_ADDR(GCPtrEffDst, i64AddrAdj); 9145 IEM_MC_FETCH_EFLAGS(EFlags); 9146 9147 IEM_MC_MEM_MAP(pu64Dst, fAccess, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); 9148 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK)) 9149 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnNormalU64, pu64Dst, u64Src, pEFlags); 9150 else 9151 IEM_MC_CALL_VOID_AIMPL_3(pImpl->pfnLockedU64, pu64Dst, u64Src, pEFlags); 9152 IEM_MC_MEM_COMMIT_AND_UNMAP(pu64Dst, fAccess); 9153 9154 IEM_MC_COMMIT_EFLAGS(EFlags); 9155 IEM_MC_ADVANCE_RIP_AND_FINISH(); 9156 IEM_MC_END(); 9157 break; 9158 9159 IEM_NOT_REACHED_DEFAULT_CASE_RET(); 9160 } 9161 } 9162 } 8984 #define IEMOP_BODY_BIT_Ev_Gv(a_fnNormalU16, a_fnNormalU32, a_fnNormalU64, a_fRW) \ 8985 uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm); \ 8986 IEMOP_VERIFICATION_UNDEFINED_EFLAGS(X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF); \ 8987 \ 8988 if (IEM_IS_MODRM_REG_MODE(bRm)) \ 8989 { \ 8990 /* register destination. */ \ 8991 IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX(); \ 8992 switch (pVCpu->iem.s.enmEffOpSize) \ 8993 { \ 8994 case IEMMODE_16BIT: \ 8995 IEM_MC_BEGIN(3, 0); \ 8996 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \ 8997 IEM_MC_ARG(uint16_t, u16Src, 1); \ 8998 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 8999 \ 9000 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9001 IEM_MC_AND_LOCAL_U16(u16Src, 0xf); \ 9002 IEM_MC_REF_GREG_U16(pu16Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 9003 IEM_MC_REF_EFLAGS(pEFlags); \ 9004 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU16, pu16Dst, u16Src, pEFlags); \ 9005 \ 9006 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9007 IEM_MC_END(); \ 9008 break; \ 9009 \ 9010 case IEMMODE_32BIT: \ 9011 IEM_MC_BEGIN(3, 0); \ 9012 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \ 9013 IEM_MC_ARG(uint32_t, u32Src, 1); \ 9014 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 9015 \ 9016 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9017 IEM_MC_AND_LOCAL_U32(u32Src, 0x1f); \ 9018 IEM_MC_REF_GREG_U32(pu32Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 9019 IEM_MC_REF_EFLAGS(pEFlags); \ 9020 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU32, pu32Dst, u32Src, pEFlags); \ 9021 \ 9022 IEM_MC_CLEAR_HIGH_GREG_U64_BY_REF(pu32Dst); \ 9023 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9024 IEM_MC_END(); \ 9025 break; \ 9026 \ 9027 case IEMMODE_64BIT: \ 9028 IEM_MC_BEGIN(3, 0); \ 9029 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \ 9030 IEM_MC_ARG(uint64_t, u64Src, 1); \ 9031 IEM_MC_ARG(uint32_t *, pEFlags, 2); \ 9032 \ 9033 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9034 IEM_MC_AND_LOCAL_U64(u64Src, 0x3f); \ 9035 IEM_MC_REF_GREG_U64(pu64Dst, IEM_GET_MODRM_RM(pVCpu, bRm)); \ 9036 IEM_MC_REF_EFLAGS(pEFlags); \ 9037 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU64, pu64Dst, u64Src, pEFlags); \ 9038 \ 9039 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9040 IEM_MC_END(); \ 9041 break; \ 9042 \ 9043 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \ 9044 } \ 9045 } \ 9046 else \ 9047 { \ 9048 /* memory destination. */ \ 9049 /** @todo test negative bit offsets! */ \ 9050 if (!(pVCpu->iem.s.fPrefixes & IEM_OP_PRF_LOCK)) \ 9051 { \ 9052 switch (pVCpu->iem.s.enmEffOpSize) \ 9053 { \ 9054 case IEMMODE_16BIT: \ 9055 IEM_MC_BEGIN(3, 2); \ 9056 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \ 9057 IEM_MC_ARG(uint16_t, u16Src, 1); \ 9058 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 9059 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 9060 IEM_MC_LOCAL(int16_t, i16AddrAdj); \ 9061 \ 9062 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ 9063 IEMOP_HLP_DONE_DECODING(); \ 9064 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9065 IEM_MC_ASSIGN(i16AddrAdj, u16Src); \ 9066 IEM_MC_AND_ARG_U16(u16Src, 0x0f); \ 9067 IEM_MC_SAR_LOCAL_S16(i16AddrAdj, 4); \ 9068 IEM_MC_SHL_LOCAL_S16(i16AddrAdj, 1); \ 9069 IEM_MC_ADD_LOCAL_S16_TO_EFF_ADDR(GCPtrEffDst, i16AddrAdj); \ 9070 IEM_MC_FETCH_EFLAGS(EFlags); \ 9071 \ 9072 IEM_MC_MEM_MAP(pu16Dst, a_fRW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); \ 9073 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU16, pu16Dst, u16Src, pEFlags); \ 9074 IEM_MC_MEM_COMMIT_AND_UNMAP(pu16Dst, a_fRW); \ 9075 \ 9076 IEM_MC_COMMIT_EFLAGS(EFlags); \ 9077 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9078 IEM_MC_END(); \ 9079 break; \ 9080 \ 9081 case IEMMODE_32BIT: \ 9082 IEM_MC_BEGIN(3, 2); \ 9083 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \ 9084 IEM_MC_ARG(uint32_t, u32Src, 1); \ 9085 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 9086 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 9087 IEM_MC_LOCAL(int32_t, i32AddrAdj); \ 9088 \ 9089 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ 9090 IEMOP_HLP_DONE_DECODING(); \ 9091 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9092 IEM_MC_ASSIGN(i32AddrAdj, u32Src); \ 9093 IEM_MC_AND_ARG_U32(u32Src, 0x1f); \ 9094 IEM_MC_SAR_LOCAL_S32(i32AddrAdj, 5); \ 9095 IEM_MC_SHL_LOCAL_S32(i32AddrAdj, 2); \ 9096 IEM_MC_ADD_LOCAL_S32_TO_EFF_ADDR(GCPtrEffDst, i32AddrAdj); \ 9097 IEM_MC_FETCH_EFLAGS(EFlags); \ 9098 \ 9099 IEM_MC_MEM_MAP(pu32Dst, a_fRW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); \ 9100 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU32, pu32Dst, u32Src, pEFlags); \ 9101 IEM_MC_MEM_COMMIT_AND_UNMAP(pu32Dst, a_fRW); \ 9102 \ 9103 IEM_MC_COMMIT_EFLAGS(EFlags); \ 9104 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9105 IEM_MC_END(); \ 9106 break; \ 9107 \ 9108 case IEMMODE_64BIT: \ 9109 IEM_MC_BEGIN(3, 2); \ 9110 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \ 9111 IEM_MC_ARG(uint64_t, u64Src, 1); \ 9112 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 9113 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 9114 IEM_MC_LOCAL(int64_t, i64AddrAdj); \ 9115 \ 9116 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ 9117 IEMOP_HLP_DONE_DECODING(); \ 9118 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9119 IEM_MC_ASSIGN(i64AddrAdj, u64Src); \ 9120 IEM_MC_AND_ARG_U64(u64Src, 0x3f); \ 9121 IEM_MC_SAR_LOCAL_S64(i64AddrAdj, 6); \ 9122 IEM_MC_SHL_LOCAL_S64(i64AddrAdj, 3); \ 9123 IEM_MC_ADD_LOCAL_S64_TO_EFF_ADDR(GCPtrEffDst, i64AddrAdj); \ 9124 IEM_MC_FETCH_EFLAGS(EFlags); \ 9125 \ 9126 IEM_MC_MEM_MAP(pu64Dst, a_fRW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); \ 9127 IEM_MC_CALL_VOID_AIMPL_3(a_fnNormalU64, pu64Dst, u64Src, pEFlags); \ 9128 IEM_MC_MEM_COMMIT_AND_UNMAP(pu64Dst, a_fRW); \ 9129 \ 9130 IEM_MC_COMMIT_EFLAGS(EFlags); \ 9131 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9132 IEM_MC_END(); \ 9133 break; \ 9134 \ 9135 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \ 9136 } \ 9137 } \ 9138 else \ 9139 { \ 9140 (void)0 9141 9142 #define IEMOP_BODY_BIT_Ev_Gv_NO_LOCK() \ 9143 IEMOP_HLP_DONE_DECODING(); \ 9144 return IEMOP_RAISE_INVALID_LOCK_PREFIX(); \ 9145 } \ 9146 } \ 9147 (void)0 9148 9149 #define IEMOP_BODY_BIT_Ev_Gv_LOCKED(a_fnLockedU16, a_fnLockedU32, a_fnLockedU64) \ 9150 switch (pVCpu->iem.s.enmEffOpSize) \ 9151 { \ 9152 case IEMMODE_16BIT: \ 9153 IEM_MC_BEGIN(3, 2); \ 9154 IEM_MC_ARG(uint16_t *, pu16Dst, 0); \ 9155 IEM_MC_ARG(uint16_t, u16Src, 1); \ 9156 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 9157 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 9158 IEM_MC_LOCAL(int16_t, i16AddrAdj); \ 9159 \ 9160 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ 9161 IEMOP_HLP_DONE_DECODING(); \ 9162 IEM_MC_FETCH_GREG_U16(u16Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9163 IEM_MC_ASSIGN(i16AddrAdj, u16Src); \ 9164 IEM_MC_AND_ARG_U16(u16Src, 0x0f); \ 9165 IEM_MC_SAR_LOCAL_S16(i16AddrAdj, 4); \ 9166 IEM_MC_SHL_LOCAL_S16(i16AddrAdj, 1); \ 9167 IEM_MC_ADD_LOCAL_S16_TO_EFF_ADDR(GCPtrEffDst, i16AddrAdj); \ 9168 IEM_MC_FETCH_EFLAGS(EFlags); \ 9169 \ 9170 IEM_MC_MEM_MAP(pu16Dst, IEM_ACCESS_DATA_RW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); \ 9171 IEM_MC_CALL_VOID_AIMPL_3(a_fnLockedU16, pu16Dst, u16Src, pEFlags); \ 9172 IEM_MC_MEM_COMMIT_AND_UNMAP(pu16Dst, IEM_ACCESS_DATA_RW); \ 9173 \ 9174 IEM_MC_COMMIT_EFLAGS(EFlags); \ 9175 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9176 IEM_MC_END(); \ 9177 break; \ 9178 \ 9179 case IEMMODE_32BIT: \ 9180 IEM_MC_BEGIN(3, 2); \ 9181 IEM_MC_ARG(uint32_t *, pu32Dst, 0); \ 9182 IEM_MC_ARG(uint32_t, u32Src, 1); \ 9183 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 9184 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 9185 IEM_MC_LOCAL(int32_t, i32AddrAdj); \ 9186 \ 9187 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ 9188 IEMOP_HLP_DONE_DECODING(); \ 9189 IEM_MC_FETCH_GREG_U32(u32Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9190 IEM_MC_ASSIGN(i32AddrAdj, u32Src); \ 9191 IEM_MC_AND_ARG_U32(u32Src, 0x1f); \ 9192 IEM_MC_SAR_LOCAL_S32(i32AddrAdj, 5); \ 9193 IEM_MC_SHL_LOCAL_S32(i32AddrAdj, 2); \ 9194 IEM_MC_ADD_LOCAL_S32_TO_EFF_ADDR(GCPtrEffDst, i32AddrAdj); \ 9195 IEM_MC_FETCH_EFLAGS(EFlags); \ 9196 \ 9197 IEM_MC_MEM_MAP(pu32Dst, IEM_ACCESS_DATA_RW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); \ 9198 IEM_MC_CALL_VOID_AIMPL_3(a_fnLockedU32, pu32Dst, u32Src, pEFlags); \ 9199 IEM_MC_MEM_COMMIT_AND_UNMAP(pu32Dst, IEM_ACCESS_DATA_RW); \ 9200 \ 9201 IEM_MC_COMMIT_EFLAGS(EFlags); \ 9202 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9203 IEM_MC_END(); \ 9204 break; \ 9205 \ 9206 case IEMMODE_64BIT: \ 9207 IEM_MC_BEGIN(3, 2); \ 9208 IEM_MC_ARG(uint64_t *, pu64Dst, 0); \ 9209 IEM_MC_ARG(uint64_t, u64Src, 1); \ 9210 IEM_MC_ARG_LOCAL_EFLAGS( pEFlags, EFlags, 2); \ 9211 IEM_MC_LOCAL(RTGCPTR, GCPtrEffDst); \ 9212 IEM_MC_LOCAL(int64_t, i64AddrAdj); \ 9213 \ 9214 IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffDst, bRm, 0); \ 9215 IEMOP_HLP_DONE_DECODING(); \ 9216 IEM_MC_FETCH_GREG_U64(u64Src, IEM_GET_MODRM_REG(pVCpu, bRm)); \ 9217 IEM_MC_ASSIGN(i64AddrAdj, u64Src); \ 9218 IEM_MC_AND_ARG_U64(u64Src, 0x3f); \ 9219 IEM_MC_SAR_LOCAL_S64(i64AddrAdj, 6); \ 9220 IEM_MC_SHL_LOCAL_S64(i64AddrAdj, 3); \ 9221 IEM_MC_ADD_LOCAL_S64_TO_EFF_ADDR(GCPtrEffDst, i64AddrAdj); \ 9222 IEM_MC_FETCH_EFLAGS(EFlags); \ 9223 \ 9224 IEM_MC_MEM_MAP(pu64Dst, IEM_ACCESS_DATA_RW, pVCpu->iem.s.iEffSeg, GCPtrEffDst, 0); \ 9225 IEM_MC_CALL_VOID_AIMPL_3(a_fnLockedU64, pu64Dst, u64Src, pEFlags); \ 9226 IEM_MC_MEM_COMMIT_AND_UNMAP(pu64Dst, IEM_ACCESS_DATA_RW); \ 9227 \ 9228 IEM_MC_COMMIT_EFLAGS(EFlags); \ 9229 IEM_MC_ADVANCE_RIP_AND_FINISH(); \ 9230 IEM_MC_END(); \ 9231 break; \ 9232 \ 9233 IEM_NOT_REACHED_DEFAULT_CASE_RET(); \ 9234 } \ 9235 } \ 9236 } \ 9237 (void)0 9163 9238 9164 9239 … … 9168 9243 IEMOP_MNEMONIC(bt_Ev_Gv, "bt Ev,Gv"); 9169 9244 IEMOP_HLP_MIN_386(); 9170 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_bt); 9245 IEMOP_BODY_BIT_Ev_Gv(iemAImpl_bt_u16, iemAImpl_bt_u32, iemAImpl_bt_u64, IEM_ACCESS_DATA_R); 9246 IEMOP_BODY_BIT_Ev_Gv_NO_LOCK(); 9171 9247 } 9172 9248 … … 9518 9594 IEMOP_MNEMONIC(bts_Ev_Gv, "bts Ev,Gv"); 9519 9595 IEMOP_HLP_MIN_386(); 9520 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_bts); 9596 IEMOP_BODY_BIT_Ev_Gv( iemAImpl_bts_u16, iemAImpl_bts_u32, iemAImpl_bts_u64, IEM_ACCESS_DATA_RW); 9597 IEMOP_BODY_BIT_Ev_Gv_LOCKED(iemAImpl_bts_u16_locked, iemAImpl_bts_u32_locked, iemAImpl_bts_u64_locked); 9521 9598 } 9522 9599 … … 10339 10416 IEMOP_MNEMONIC(btr_Ev_Gv, "btr Ev,Gv"); 10340 10417 IEMOP_HLP_MIN_386(); 10341 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_btr); 10418 IEMOP_BODY_BIT_Ev_Gv( iemAImpl_btr_u16, iemAImpl_btr_u32, iemAImpl_btr_u64, IEM_ACCESS_DATA_RW); 10419 IEMOP_BODY_BIT_Ev_Gv_LOCKED(iemAImpl_btr_u16_locked, iemAImpl_btr_u32_locked, iemAImpl_btr_u64_locked); 10342 10420 } 10343 10421 … … 10749 10827 IEMOP_MNEMONIC(btc_Ev_Gv, "btc Ev,Gv"); 10750 10828 IEMOP_HLP_MIN_386(); 10751 return FNIEMOP_CALL_1(iemOpCommonBit_Ev_Gv, &g_iemAImpl_btc); 10829 IEMOP_BODY_BIT_Ev_Gv( iemAImpl_btc_u16, iemAImpl_btc_u32, iemAImpl_btc_u64, IEM_ACCESS_DATA_RW); 10830 IEMOP_BODY_BIT_Ev_Gv_LOCKED(iemAImpl_btc_u16_locked, iemAImpl_btc_u32_locked, iemAImpl_btc_u64_locked); 10752 10831 } 10753 10832
Note:
See TracChangeset
for help on using the changeset viewer.