Changeset 46733 in vbox for trunk/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py
- Timestamp:
- Jun 22, 2013 7:35:34 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/testcase/Instructions/InstructionTestGen.py
r46731 r46733 114 114 g_asGRegs16 = ('ax', 'cx', 'dx', 'bx', 'sp', 'bp', 'si', 'di', 115 115 'r8w', 'r9w', 'r10w', 'r11w', 'r12w', 'r13w', 'r14w', 'r15w'); 116 g_asGRegs8 116 g_asGRegs8_86 = ('al', 'cl', 'dl', 'bl', 'ah', 'ah', 'dh', 'bh'); 117 117 g_asGRegs8_64 = ('al', 'cl', 'dl', 'bl', 'spl', 'bpl', 'sil', 'dil', # pylint: disable=C0103 118 118 'r8b', 'r9b', 'r10b', 'r11b', 'r12b', 'r13b', 'r14b', 'r15b'); … … 372 372 oGen.write(' %s %s, %s\n' % (self.sInstr, g_asGRegs16[iOp1], g_asGRegs16[iOp2])); 373 373 elif cbEffOp == 1: 374 oGen.write(' %s %s, %s\n' % (self.sInstr, g_asGRegs8 [iOp1], g_asGRegs8[iOp2]));374 oGen.write(' %s %s, %s\n' % (self.sInstr, g_asGRegs8_64[iOp1], g_asGRegs8_64[iOp2])); 375 375 else: 376 376 assert False; … … 382 382 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs64[iOp1],)); 383 383 elif cbEffOp == 4: 384 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs 64[iOp1],));384 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs32[iOp1],)); 385 385 elif cbEffOp == 2: 386 386 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs16[iOp1],)); 387 387 elif cbEffOp == 1: 388 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs8 [iOp1],));388 oGen.write(' %s %s, [' % (self.sInstr, g_asGRegs8_64[iOp1],)); 389 389 else: 390 390 assert False; 391 391 392 if iOp2 == 5and iMod == 0:392 if (iOp2 == 5 or iOp2 == 13) and iMod == 0: 393 393 oGen.write('VBINSTST_NAME(g_u%sData)' % (cbEffOp * 8,)) 394 394 if oGen.oTarget.is64Bit(): … … 451 451 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(iOp1, iOp2),)); 452 452 453 iMod = 2; 454 for offDisp in (127, -128): 455 oGen.write(' call VBINSTST_NAME(Common_LoadKnownValues)\n'); 456 self.generateMemSetupPureRM(oGen, cAddrBits, cbEffOp, iOp2, iMod, uInput, offDisp); 457 self.writeInstrGregPureRM(cbEffOp, iOp1, cAddrBits, iOp2, iMod, offDisp, oGen); 458 oGen.pushConst(uResult); 459 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(iOp1, iOp2),)); 460 461 iMod = 2; 462 for offDisp in (2147483647, -2147483648): 463 oGen.write(' call VBINSTST_NAME(Common_LoadKnownValues)\n'); 464 self.generateMemSetupPureRM(oGen, cAddrBits, cbEffOp, iOp2, iMod, uInput, offDisp); 465 self.writeInstrGregPureRM(cbEffOp, iOp1, cAddrBits, iOp2, iMod, offDisp, oGen); 466 oGen.pushConst(uResult); 467 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(iOp1, iOp2),)); 453 if iOp2 != 5 and iOp2 != 13: 454 iMod = 1; 455 for offDisp in (127, -128): 456 oGen.write(' call VBINSTST_NAME(Common_LoadKnownValues)\n'); 457 self.generateMemSetupPureRM(oGen, cAddrBits, cbEffOp, iOp2, iMod, uInput, offDisp); 458 self.writeInstrGregPureRM(cbEffOp, iOp1, cAddrBits, iOp2, iMod, offDisp, oGen); 459 oGen.pushConst(uResult); 460 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(iOp1, iOp2),)); 461 462 iMod = 2; 463 for offDisp in (2147483647, -2147483648): 464 oGen.write(' call VBINSTST_NAME(Common_LoadKnownValues)\n'); 465 self.generateMemSetupPureRM(oGen, cAddrBits, cbEffOp, iOp2, iMod, uInput, offDisp); 466 self.writeInstrGregPureRM(cbEffOp, iOp1, cAddrBits, iOp2, iMod, offDisp, oGen); 467 oGen.pushConst(uResult); 468 oGen.write(' call VBINSTST_NAME(%s)\n' % (oGen.needGRegChecker(iOp1, iOp2),)); 468 469 469 470 return True; … … 524 525 pass; # SIB 525 526 break; ## remove me! 526 break; ## remove me!527 break; ## remove me!527 #break; ## remove me! 528 #break; ## remove me! 528 529 529 530 return True; … … 558 559 if cbEffOp == 2: 559 560 return (uCur & 0xffffffffffff0000) | (uInput & UINT16_MAX); 560 assert cbEffOp == 1; 561 assert cbEffOp == 1; _ = oGen; 561 562 return (uCur & 0xffffffffffffff00) | (uInput & UINT8_MAX); 562 563 … … 846 847 elif cAddrBits == 32: asAddrGRegs = g_asGRegs32; 847 848 else: asAddrGRegs = g_asGRegs16; 848 iBaseReg 849 iBaseReg = asAddrGRegs.index(sBaseReg); 849 850 850 851 i = 3; 851 offDisp= None;852 u32Disp = None; 852 853 if i < len(asParams) and len(asParams[i]) == 10: 853 854 u32Disp = long(asParams[i], 16); … … 861 862 i += 1; 862 863 863 iScale 864 iScale = 1; 864 865 if i < len(asParams): 865 866 iScale = int(asParams[i]); assert iScale in [2, 4, 8]; 866 867 i += 1; 868 869 assert i == len(asParams), 'i=%d len=%d len[i]=%d (%s)' % (i, len(asParams), len(asParams[i]), asParams[i],); 867 870 868 871 # Prologue. … … 873 876 ' push %s\n' 874 877 % (sName, self.oTarget.asGRegs[iTmpReg1], )); 878 self.write('; cAddrBits=%s cEffOpBits=%s iBaseReg=%s u32Disp=%s iIndexReg=%s iScale=%s\n' 879 % (cAddrBits, cEffOpBits, iBaseReg, u32Disp, iIndexReg, iScale,)); 875 880 876 881 # Figure out what to use. … … 886 891 else: 887 892 assert cEffOpBits == 8; 888 sTmpReg1 = g_asGRegs8 [iTmpReg1];893 sTmpReg1 = g_asGRegs8_64[iTmpReg1]; 889 894 sDataVar = 'VBINSTST_NAME(g_u8Data)'; 890 895 … … 904 909 905 910 # Adjust for disposition and scaling. 906 if offDisp is not None:911 if u32Disp is not None: 907 912 self.write(' sub %s, %d\n' % ( sBaseReg, convU32ToSigned(u32Disp), )); 908 913 if iIndexReg is not None: … … 941 946 self.write(' pop %s\n' 942 947 ' MY_POP_FLAGS\n' 943 ' ret \n'948 ' ret sCB\n' 944 949 'VBINSTST_ENDPROC Common_MemSetup_%s\n' 945 950 % ( self.oTarget.asGRegs[iTmpReg1], sName,));
Note:
See TracChangeset
for help on using the changeset viewer.