Changeset 37008 in vbox
- Timestamp:
- May 9, 2011 8:51:42 AM (14 years ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructions.cpp.h
r37007 r37008 8365 8365 /** Macro used by iemOp_scasb_AL_Xb and iemOp_scaswd_eAX_Xv */ 8366 8366 #define IEM_SCAS_CASE(ValBits, AddrBits) \ 8367 IEM_MC_BEGIN( 1, 2); \8367 IEM_MC_BEGIN(3, 2); \ 8368 8368 IEM_MC_ARG(uint##ValBits##_t *, puRax, 0); \ 8369 8369 IEM_MC_ARG(uint##ValBits##_t, uValue, 1); \ … … 10610 10610 { 10611 10611 IEMOP_HLP_NO_LOCK_PREFIX(); 10612 IEM_MC_BEGIN( 3, 1);10612 IEM_MC_BEGIN(4, 1); 10613 10613 IEM_MC_ARG(uint16_t *, pu16AX, 0); 10614 10614 IEM_MC_ARG(uint16_t *, pu16DX, 1); … … 10635 10635 { 10636 10636 IEMOP_HLP_NO_LOCK_PREFIX(); 10637 IEM_MC_BEGIN( 3, 1);10637 IEM_MC_BEGIN(4, 1); 10638 10638 IEM_MC_ARG(uint32_t *, pu32AX, 0); 10639 10639 IEM_MC_ARG(uint32_t *, pu32DX, 1); … … 10660 10660 { 10661 10661 IEMOP_HLP_NO_LOCK_PREFIX(); 10662 IEM_MC_BEGIN( 3, 1);10662 IEM_MC_BEGIN(4, 1); 10663 10663 IEM_MC_ARG(uint64_t *, pu64AX, 0); 10664 10664 IEM_MC_ARG(uint64_t *, pu64DX, 1); … … 10693 10693 { 10694 10694 IEMOP_HLP_NO_LOCK_PREFIX(); 10695 IEM_MC_BEGIN( 3, 2);10695 IEM_MC_BEGIN(4, 2); 10696 10696 IEM_MC_ARG(uint16_t *, pu16AX, 0); 10697 10697 IEM_MC_ARG(uint16_t *, pu16DX, 1); … … 10720 10720 { 10721 10721 IEMOP_HLP_NO_LOCK_PREFIX(); 10722 IEM_MC_BEGIN( 3, 2);10722 IEM_MC_BEGIN(4, 2); 10723 10723 IEM_MC_ARG(uint32_t *, pu32AX, 0); 10724 10724 IEM_MC_ARG(uint32_t *, pu32DX, 1); … … 10747 10747 { 10748 10748 IEMOP_HLP_NO_LOCK_PREFIX(); 10749 IEM_MC_BEGIN( 3, 2);10749 IEM_MC_BEGIN(4, 2); 10750 10750 IEM_MC_ARG(uint64_t *, pu64AX, 0); 10751 10751 IEM_MC_ARG(uint64_t *, pu64DX, 1); -
trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp
r37006 r37008 156 156 157 157 158 #define IEM_REPEAT_0(a_Callback, a_User) do { } while (0) 159 #define IEM_REPEAT_1(a_Callback, a_User) a_Callback##_CALLBACK(0, a_User) 160 #define IEM_REPEAT_2(a_Callback, a_User) IEM_REPEAT_1(a_Callback, a_User); a_Callback##_CALLBACK(1, a_User) 161 #define IEM_REPEAT_3(a_Callback, a_User) IEM_REPEAT_2(a_Callback, a_User); a_Callback##_CALLBACK(2, a_User) 162 #define IEM_REPEAT_4(a_Callback, a_User) IEM_REPEAT_3(a_Callback, a_User); a_Callback##_CALLBACK(3, a_User) 163 #define IEM_REPEAT_5(a_Callback, a_User) IEM_REPEAT_4(a_Callback, a_User); a_Callback##_CALLBACK(4, a_User) 164 #define IEM_REPEAT_6(a_Callback, a_User) IEM_REPEAT_5(a_Callback, a_User); a_Callback##_CALLBACK(5, a_User) 165 #define IEM_REPEAT_7(a_Callback, a_User) IEM_REPEAT_6(a_Callback, a_User); a_Callback##_CALLBACK(6, a_User) 166 #define IEM_REPEAT_8(a_Callback, a_User) IEM_REPEAT_7(a_Callback, a_User); a_Callback##_CALLBACK(7, a_User) 167 #define IEM_REPEAT_9(a_Callback, a_User) IEM_REPEAT_8(a_Callback, a_User); a_Callback##_CALLBACK(8, a_User) 168 #define IEM_REPEAT(a_cTimes, a_Callback, a_User) RT_CONCAT(IEM_REPEAT_,a_cTimes)(a_Callback, a_User) 169 170 171 158 172 /** @name Microcode test stubs 159 173 * @{ */ 160 174 161 #define IEM_MC_BEGIN(cArgs, cLocals) { 162 #define IEM_MC_END() } 175 #define IEM_ARG_CHECK_CALLBACK(a_idx, a_User) int RT_CONCAT(iArgCheck_,a_idx) 176 #define IEM_MC_BEGIN(a_cArgs, a_cLocals) \ 177 { \ 178 const uint8_t cArgs = (a_cArgs); NOREF(cArgs); \ 179 const uint8_t cLocals = (a_cArgs); NOREF(cLocals); \ 180 IEM_REPEAT(a_cArgs, IEM_ARG_CHECK, 0); \ 181 182 #define IEM_MC_END() \ 183 } 184 163 185 #define IEM_MC_PAUSE() do {} while (0) 164 186 #define IEM_MC_CONTINUE() do {} while (0) … … 175 197 #define IEM_MC_RAISE_GP0_IF_CPL_NOT_ZERO() do {} while (0) 176 198 177 #define IEM_MC_LOCAL(a_Type, a_Name) a_Type a_Name; NOREF(a_Name) 178 #define IEM_MC_LOCAL_CONST(a_Type, a_Name, a_Value) a_Type const a_Name = (a_Value); NOREF(a_Name) 179 #define IEM_MC_REF_LOCAL(a_pRefArg, a_Local) (a_pRefArg) = &(a_Local) 180 #define IEM_MC_ARG(a_Type, a_Name, a_iArg) a_Type a_Name; NOREF(a_Name) 199 #define IEM_MC_LOCAL(a_Type, a_Name) \ 200 a_Type a_Name; NOREF(a_Name) 201 #define IEM_MC_LOCAL_CONST(a_Type, a_Name, a_Value) \ 202 a_Type const a_Name = (a_Value); \ 203 NOREF(a_Name) 204 #define IEM_MC_REF_LOCAL(a_pRefArg, a_Local) \ 205 (a_pRefArg) = &(a_Local) 206 207 #define IEM_MC_ARG(a_Type, a_Name, a_iArg) \ 208 RT_CONCAT(iArgCheck_,a_iArg) = 1; NOREF(RT_CONCAT(iArgCheck_,a_iArg)); \ 209 int RT_CONCAT3(iArgCheck_,a_iArg,a_Name); NOREF(RT_CONCAT3(iArgCheck_,a_iArg,a_Name)); \ 210 AssertCompile((a_iArg) < cArgs); \ 211 a_Type a_Name; \ 212 NOREF(a_Name) 181 213 #define IEM_MC_ARG_CONST(a_Type, a_Name, a_Value, a_iArg) \ 214 RT_CONCAT(iArgCheck_, a_iArg) = 1; NOREF(RT_CONCAT(iArgCheck_,a_iArg)); \ 215 int RT_CONCAT3(iArgCheck_,a_iArg,a_Name); NOREF(RT_CONCAT3(iArgCheck_,a_iArg,a_Name)); \ 216 AssertCompile((a_iArg) < cArgs); \ 182 217 a_Type const a_Name = (a_Value); \ 183 218 NOREF(a_Name) 184 219 #define IEM_MC_ARG_LOCAL_EFLAGS(a_pName, a_Name, a_iArg) \ 220 RT_CONCAT(iArgCheck_, a_iArg) = 1; NOREF(RT_CONCAT(iArgCheck_,a_iArg)); \ 221 int RT_CONCAT3(iArgCheck_,a_iArg,a_Name); NOREF(RT_CONCAT3(iArgCheck_,a_iArg,a_Name)); \ 222 AssertCompile((a_iArg) < cArgs); \ 185 223 uint32_t a_Name; \ 186 224 uint32_t *a_pName = &a_Name; \ 187 225 NOREF(a_pName) 226 188 227 #define IEM_MC_COMMIT_EFLAGS(a_EFlags) CHK_TYPE(uint32_t, a_EFlags) 189 228 #define IEM_MC_ASSIGN(a_VarOrArg, a_CVariableOrConst) (a_VarOrArg) = (0) … … 239 278 #define IEM_MC_SUB_GREG_U64(a_iGReg, a_u64Value) do { CHK_CONST(uint64_t, a_u64Value); } while (0) 240 279 280 #ifdef _MSC_VER 281 #define IEM_MC_ADD_GREG_U8_TO_LOCAL(a_u16Value, a_iGReg) do { (a_u8Value) += 1; /*CHK_CONST(uint8_t, a_u8Value); */ } while (0) 282 #define IEM_MC_ADD_GREG_U16_TO_LOCAL(a_u16Value, a_iGReg) do { (a_u16Value) += 1; /*CHK_CONST(uint16_t, a_u16Value);*/ } while (0) 283 #define IEM_MC_ADD_GREG_U32_TO_LOCAL(a_u32Value, a_iGReg) do { (a_u32Value) += 1; /*CHK_CONST(uint32_t, a_u32Value);*/ } while (0) 284 #define IEM_MC_ADD_GREG_U64_TO_LOCAL(a_u64Value, a_iGReg) do { (a_u64Value) += 1; /*CHK_CONST(uint64_t, a_u64Value);*/ } while (0) 285 #else 241 286 #define IEM_MC_ADD_GREG_U8_TO_LOCAL(a_u16Value, a_iGReg) do { (a_u8Value) += 1; CHK_CONST(uint8_t, a_u8Value); } while (0) 242 287 #define IEM_MC_ADD_GREG_U16_TO_LOCAL(a_u16Value, a_iGReg) do { (a_u16Value) += 1; CHK_CONST(uint16_t, a_u16Value); } while (0) 243 288 #define IEM_MC_ADD_GREG_U32_TO_LOCAL(a_u32Value, a_iGReg) do { (a_u32Value) += 1; CHK_CONST(uint32_t, a_u32Value); } while (0) 244 289 #define IEM_MC_ADD_GREG_U64_TO_LOCAL(a_u64Value, a_iGReg) do { (a_u64Value) += 1; CHK_CONST(uint64_t, a_u64Value); } while (0) 290 #endif 245 291 #define IEM_MC_ADD_LOCAL_S16_TO_EFF_ADDR(a_EffAddr, a_i16) do { (a_EffAddr) += (a_i16); CHK_GCPTR(a_EffAddr); } while (0) 246 292 #define IEM_MC_ADD_LOCAL_S32_TO_EFF_ADDR(a_EffAddr, a_i32) do { (a_EffAddr) += (a_i32); CHK_GCPTR(a_EffAddr); } while (0)
Note:
See TracChangeset
for help on using the changeset viewer.