Changeset 46746 in vbox for trunk/src/VBox/VMM/testcase/Instructions
- Timestamp:
- Jun 23, 2013 7:45:11 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 86672
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py
r46744 r46746 102 102 g_asGRegs16 = ('ax', 'cx', 'dx', 'bx', 'sp', 'bp', 'si', 'di', 103 103 'r8w', 'r9w', 'r10w', 'r11w', 'r12w', 'r13w', 'r14w', 'r15w'); 104 g_asGRegs8 = ('al', 'cl', 'dl', 'bl', 'ah', ' ah', 'dh', 'bh');104 g_asGRegs8 = ('al', 'cl', 'dl', 'bl', 'ah', 'ch', 'dh', 'bh'); 105 105 g_asGRegs8Rex = ('al', 'cl', 'dl', 'bl', 'spl', 'bpl', 'sil', 'dil', 106 106 'r8b', 'r9b', 'r10b', 'r11b', 'r12b', 'r13b', 'r14b', 'r15b'); … … 146 146 bRex = bOtherRexPrefixes; 147 147 if iReg >= 8: 148 bRex = bRex |X86_OP_REX_R;148 bRex |= X86_OP_REX_R; 149 149 if iRm >= 8: 150 bRex = bRex |X86_OP_REX_B;150 bRex |= X86_OP_REX_B; 151 151 if bRex == 0: 152 152 return []; … … 364 364 365 365 366 367 366 class InstrTest_MemOrGreg_2_Greg(InstrTestBase): 368 367 """ … … 374 373 InstrTestBase.__init__(self, sName, sInstr); 375 374 self.fnCalcResult = fnCalcResult; 376 self.acbOpVars = [ 1, 2, 4, 8 ] if not acbOpVars else list(acbOpVars);375 self.acbOpVars = [ 1, 2, 4, 8 ] if not acbOpVars else list(acbOpVars); 377 376 378 377 def writeInstrGregGreg(self, cbEffOp, iOp1, iOp2, oGen): … … 390 389 return True; 391 390 391 392 392 def writeInstrGregPureRM(self, cbEffOp, iOp1, cAddrBits, iOp2, iMod, offDisp, oGen): 393 393 """ Writes the instruction with two general registers as operands. """ 394 if cbEffOp == 8: 394 if iOp2 == 13 and iMod == 0 and cAddrBits == 64: # Alt rip encoding, yasm isn't helping, do what we can. 395 if cbEffOp == 2: 396 oGen.write(' db %#04x\n' % (X86_OP_PRF_SIZE_OP,)); 397 bRex = X86_OP_REX_B; 398 if iOp1 >= 8: 399 bRex |= X86_OP_REX_R; 400 if cbEffOp == 8: 401 bRex |= X86_OP_REX_W; 402 oGen.write(' db %#04x\n' % (bRex,)); 403 if cbEffOp == 1: 404 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs8[iOp1 & 0x7],)); 405 else: 406 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs32[iOp1 & 0x7],)); 407 elif cbEffOp == 8: 395 408 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs64[iOp1],)); 396 409 elif cbEffOp == 4: … … 446 459 % (oGen.needGRegMemSetup(cAddrBits, cbEffOp, iOp2, offDisp),)); 447 460 else: 448 ## @todo generate REX.B=1 variant.449 461 oGen.write(' call VBINSTST_NAME(Common_SetupMemReadU%u)\n' % (cbEffOp*8,)); 450 462 oGen.write(' push %s\n' % (oGen.oTarget.asGRegs[iOp2],)); … … 501 513 502 514 # Register tests 503 if False:515 if True: 504 516 for cbEffOp in self.acbOpVars: 505 517 if cbEffOp > cbMaxOp: … … 518 530 519 531 # Memory test. 520 for cbEffOp in self.acbOpVars: 521 if cbEffOp > cbMaxOp: 522 continue; 523 for iOp1 in oOp1MemRange: 524 if oGen.oTarget.asGRegsNoSp[iOp1] is None: 532 if True: 533 for cbEffOp in self.acbOpVars: 534 if cbEffOp > cbMaxOp: 525 535 continue; 526 for cAddrBits in oGen.oTarget.getAddrModes(): 527 for iOp2 in range(len(oGen.oTarget.asGRegs)): 528 if iOp2 != 4: 529 530 for uInput in (auLongInputs if iOp1 == iLongOp1 and False else auShortInputs): 531 oGen.newSubTest(); 532 if iOp1 == iOp2 and iOp2 != 5 and iOp2 != 13 and cbEffOp != cbMaxOp: 533 continue; # Don't know the high bit of the address ending up the result - skip it. 534 uResult = self.fnCalcResult(cbEffOp, uInput, oGen.auRegValues[iOp1], oGen); 535 self.generateOneStdTestGregMemNoSib(oGen, cAddrBits, cbEffOp, cbMaxOp, 536 iOp1, iOp2, uInput, uResult); 537 else: 538 pass; # SIB 536 for iOp1 in oOp1MemRange: 537 if oGen.oTarget.asGRegsNoSp[iOp1] is None: 538 continue; 539 for cAddrBits in oGen.oTarget.getAddrModes(): 540 for iOp2 in range(len(oGen.oTarget.asGRegs)): 541 if iOp2 != 4: 542 543 for uInput in (auLongInputs if iOp1 == iLongOp1 and False else auShortInputs): 544 oGen.newSubTest(); 545 if iOp1 == iOp2 and iOp2 != 5 and iOp2 != 13 and cbEffOp != cbMaxOp: 546 continue; # Don't know the high bit of the address ending up the result - skip it. 547 uResult = self.fnCalcResult(cbEffOp, uInput, oGen.auRegValues[iOp1], oGen); 548 self.generateOneStdTestGregMemNoSib(oGen, cAddrBits, cbEffOp, cbMaxOp, 549 iOp1, iOp2, uInput, uResult); 550 else: 551 pass; # SIB 539 552 540 553 return True;
Note:
See TracChangeset
for help on using the changeset viewer.