Changeset 47135 in vbox for trunk/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py
- Timestamp:
- Jul 14, 2013 4:43:54 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py
r47132 r47135 384 384 return False; 385 385 386 def gregNameBits(self, iReg, cBits): 387 """ Gets the name of the given register for the specified width (bits). """ 388 return gregName(iReg, cBits, self.is64Bit()); 389 390 def gregNameBytes(self, iReg, cbWidth): 391 """ Gets the name of the given register for the specified with (in bytes). """ 392 return gregName(iReg, cbWidth * 8, self.is64Bit()); 393 394 386 395 387 396 … … 392 401 'bs2-r0-64': TargetEnv('bs2-r0-64', TargetEnv.ksInstrSet_64, TargetEnv.ksCpuMode_Long, 0), 393 402 'bs2-r0-64-big': TargetEnv('bs2-r0-64-big', TargetEnv.ksInstrSet_64, TargetEnv.ksCpuMode_Long, 0), 403 'bs2-r0-32-big': TargetEnv('bs2-r0-32-big', TargetEnv.ksInstrSet_32, TargetEnv.ksCpuMode_Protect, 0), 394 404 }; 395 405 … … 1238 1248 oGen.write(' push %s\n' % (oGen.oTarget.asGRegs[X86_GREG_xAX],)); 1239 1249 oGen.write(' VBINSTST_TRAP_INSTR X86_XCPT_DE, 0, %-4s %s\n' 1240 % (self.sInstr, gregName(iOp2, cbEffOp * 8),));1250 % (self.sInstr, oGen.gregNameBytes(iOp2, cbEffOp),)); 1241 1251 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(X86_GREG_xAX, X86_GREG_xDX, iOp2),)); 1242 1252 return True; … … 1244 1254 def generateOneDivideErrorTestGreg8Bit(self, oGen, cbEffOp, iOp2, iDividend, iDivisor): 1245 1255 """ Generate code of one '[I]DIV AX,<GREG>' test that causes #DE (8-bit). """ 1256 if not oGen.oTarget.is64Bit() and iOp2 == 4: # Avoid AH. 1257 iOp2 = 5; 1258 1246 1259 cbMaxOp = oGen.oTarget.getMaxOpBytes(); 1247 1260 fMaxOp = UINT64_MAX if cbMaxOp == 8 else UINT32_MAX; assert cbMaxOp in [8, 4]; … … 1264 1277 oGen.write(' push sAX\n'); 1265 1278 oGen.write(' VBINSTST_TRAP_INSTR X86_XCPT_DE, 0, %-4s %s\n' 1266 % (self.sInstr, gregName(iOp2, cbEffOp * 8),));1279 % (self.sInstr, oGen.gregNameBytes(iOp2, cbEffOp),)); 1267 1280 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(X86_GREG_xAX, iOp2X),)); 1268 1281 return; … … 1279 1292 iOp2 = oGen.oTarget.randGRegNoSp(); 1280 1293 1281 for cbEffOp in ( 8, 4, 2, 1 ):1294 for cbEffOp in [1]:#( 8, 4, 2, 1 ): 1282 1295 if cbEffOp > oGen.oTarget.getMaxOpBytes(): 1283 1296 continue; … … 1299 1312 #oGen.write(' int3\n'); 1300 1313 1301 self.generateStandardTests(oGen);1314 #self.generateStandardTests(oGen); 1302 1315 self.generateDivideErrorTests(oGen); 1303 1316 … … 1314 1327 # 1315 1328 g_aoInstructionTests = [ 1316 InstrTest_Mov_Gv_Ev(),1317 # InstrTest_MovSxD_Gv_Ev(),1329 #InstrTest_Mov_Gv_Ev(), 1330 ##InstrTest_MovSxD_Gv_Ev(), 1318 1331 InstrTest_DivIDiv(fIsIDiv = False), 1319 InstrTest_DivIDiv(fIsIDiv = True),1332 #InstrTest_DivIDiv(fIsIDiv = True), 1320 1333 ]; 1321 1334 … … 1525 1538 """ Checks if we're in tiny mode.""" 1526 1539 return self.oOptions.sTestSize == InstructionTestGen.ksTestSize_Tiny; 1540 1541 1542 # 1543 # Forwarding calls for oTarget to shorted typing and lessen the attacks 1544 # on the right margin. 1545 # 1546 1547 def gregNameBits(self, iReg, cBitsWide): 1548 """ Target: Get the name of a general register for the given size (in bits). """ 1549 return self.oTarget.gregNameBits(iReg, cBitsWide); 1550 1551 def gregNameBytes(self, iReg, cbWide): 1552 """ Target: Get the name of a general register for the given size (in bytes). """ 1553 return self.oTarget.gregNameBytes(iReg, cbWide); 1554 1555 def is64Bit(self): 1556 """ Target: Is the target 64-bit? """ 1557 return self.oTarget.is64Bit(); 1527 1558 1528 1559
Note:
See TracChangeset
for help on using the changeset viewer.