Changeset 66114 in vbox
- Timestamp:
- Mar 15, 2017 3:41:58 PM (8 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsOneByte.cpp.h
r66113 r66114 52 52 * @opstats add_Eb_Gb 53 53 * @opgroup op_gen_arith_bin 54 * @optest op1=1 op2=1 -> op1=2 efl&|=nv,pl,nz,na,pe 54 * @optest op1=1 op2=1 -> op1=2 efl&|=nv,pl,nz,na,pe,nc 55 * @optest efl|=cf op1=1 op2=2 -> op1=3 efl&|=nv,pl,nz,na,po,nc 56 * @optest op1=254 op2=1 -> op1=255 efl&|=nv,ng,nz,na,po,nc 57 * @optest op1=128 op2=128 -> op1=0 efl&|=ov,pl,zf,na,po,cf 55 58 */ 56 59 FNIEMOP_DEF(iemOp_add_Eb_Gb) -
trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py
r66113 r66114 579 579 assert sHex[:2] == '0x'; 580 580 sHex = ''.join([self.kdHexInv[sDigit] for sDigit in sHex[2:]]); 581 if fSignExtend and sHex[0] not in [ '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']: 582 sHex = 'f' + sHex; 581 583 582 584 cDigits = len(sHex); … … 644 646 aoSet = TestType.get(self, '0x%x' % (fSet,)); 645 647 if fClear != 0: 646 aoClear = TestType.get(self, '%#x' % ( ~fClear))648 aoClear = TestType.get(self, '%#x' % (fClear,)) 647 649 assert self.isAndOrPair(sValue) is True; 648 650 return (aoClear[0], aoSet[0]); … … 667 669 ## Assigned operators. 668 670 kasOperators = [ 669 '&|=', # Special AND +OR operator for use with EFLAGS.671 '&|=', # Special AND(INV)+OR operator for use with EFLAGS. 670 672 '&~=', 671 673 '&=', … … 951 953 self.sRawIemOpFlags = None; 952 954 self.sRawOldOpcodes = None; 955 self.asCopyTests = []; 953 956 ## @} 954 957 … … 1059 1062 g_aoAllInstructions = []; # type: Instruction 1060 1063 1064 ## All the instructions indexed by statistics name (opstat). 1065 g_dAllInstructionsByStat = {}; # type: Instruction 1066 1061 1067 ## Instruction maps. 1062 1068 g_dInstructionMaps = { … … 1188 1194 '@opinvlstyle': self.parseTagOpUnusedInvalid, 1189 1195 '@optest': self.parseTagOpTest, 1196 '@opcopytests': self.parseTagOpCopyTests, 1190 1197 '@opstats': self.parseTagOpStats, 1191 1198 '@opfunction': self.parseTagOpFunction, … … 1342 1349 for oMap in oInstr.aoMaps: 1343 1350 oMap.aoInstructions.append(oInstr); 1351 1352 # 1353 # Check the opstat value and add it to the opstat indexed dictionary. 1354 # 1355 if oInstr.sStats: 1356 if oInstr.sStats not in g_dAllInstructionsByStat: 1357 g_dAllInstructionsByStat[oInstr.sStats] = oInstr; 1358 else: 1359 self.error('Duplicate opstat value "%s"\nnew: %s\nold: %s' 1360 % (oInstr.sStats, oInstr, g_dAllInstructionsByStat[oInstr.sStats],)); 1344 1361 1345 1362 #self.debug('%d..%d: %s; %d @op tags' % (oInstr.iLineCreated, oInstr.iLineCompleted, oInstr.sFunction, oInstr.cOpTags)); … … 2058 2075 return True; 2059 2076 2077 def parseTagOpCopyTests(self, sTag, aasSections, iTagLine, iEndLine): 2078 """ 2079 Tag: \@opcopytests 2080 Value: <opstat value> [..] 2081 Example: \@opcopytests add_Eb_Gb 2082 2083 Trick to avoid duplicating tests for different encodings of the same 2084 operation. 2085 """ 2086 oInstr = self.ensureInstructionForOpTag(iTagLine); 2087 2088 # Flatten, validate and append the copy job to the instruction. We execute 2089 # them after parsing all the input so we can handle forward references. 2090 asToCopy = self.flattenAllSections(aasSections).split(); 2091 if not asToCopy: 2092 return self.errorComment(iTagLine, '%s: requires at least on reference value' % (sTag,)); 2093 for sToCopy in asToCopy: 2094 if sToCopy not in oInstr.asCopyTests: 2095 if self.oReStatsName.match(sToCopy): 2096 oInstr.asCopyTests.append(sToCopy); 2097 else: 2098 self.errorComment(iTagLine, '%s: invalid instruction reference (opstat) "%s" (valid: %s)' 2099 % (sTag, sToCopy, self.oReStatsName.pattern)); 2100 else: 2101 self.errorComment(iTagLine, '%s: ignoring duplicate "%s"' % (sTag, sToCopy,)); 2102 2103 _ = iEndLine; 2104 return True; 2105 2060 2106 def parseTagOpFunction(self, sTag, aasSections, iTagLine, iEndLine): 2061 2107 """ … … 2611 2657 2612 2658 2659 def __doTestCopying(): 2660 """ 2661 Executes the asCopyTests instructions. 2662 """ 2663 asErrors = []; 2664 for oDstInstr in g_aoAllInstructions: 2665 if oDstInstr.asCopyTests: 2666 for sSrcInstr in oDstInstr.asCopyTests: 2667 oSrcInstr = g_dAllInstructionsByStat.get(sSrcInstr, None); 2668 if oSrcInstr and oSrcInstr != oDstInstr: 2669 oDstInstr.aoTests.extend(oSrcInstr.aoTests); 2670 elif oSrcInstr: 2671 asErrors.append('%s:%s: error: @opcopytests reference "%s" matches the destination\n' 2672 % ( oDstInstr.sSrcFile, oDstInstr.iLineCreated, sSrcInstr)); 2673 else: 2674 asErrors.append('%s:%s: error: @opcopytests reference "%s" not found\n' 2675 % ( oDstInstr.sSrcFile, oDstInstr.iLineCreated, sSrcInstr)); 2676 2677 if asErrors: 2678 sys.stderr.write(u''.join(asErrors)); 2679 return len(asErrors); 2680 2681 2613 2682 def __parseAll(): 2614 2683 """ … … 2624 2693 ]: 2625 2694 cErrors += __parseFileByName(os.path.join(sSrcDir, sName), sDefaultMap); 2695 cErrors += __doTestCopying(); 2696 2626 2697 2627 2698 if cErrors != 0: -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py
r66113 r66114 149 149 sOp = oOperation.sOp; 150 150 if sOp == '&|=': 151 sOp = '|=' if len(aaoValues) == 1 else '& =';151 sOp = '|=' if len(aaoValues) == 1 else '&~='; 152 152 153 153 for fSignExtend, abValue in aaoValues: … … 432 432 '{', 433 433 ]; 434 fAdvanceMnemonic = True; 434 435 for oInstr in self.aoInstructions: 435 asLines.append(' \"%s\"' % (oInstr.oInstr.sMnemonic,)); 436 if fAdvanceMnemonic: 437 asLines.append(' \"%s\"' % (oInstr.oInstr.sMnemonic,)); 438 fAdvanceMnemonic = oInstr.fAdvanceMnemonic; 436 439 asLines += [ 437 440 '};', -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66113 r66114 999 999 switch (cbDst) 1000 1000 { 1001 case 1: BS3CG1_DPRINTF(("dbg: --> %s: %#04RX 32\n", g_aszBs3Cg1DstFields[idxField].sz, *PtrField.pu8));break;1002 case 2: BS3CG1_DPRINTF(("dbg: --> %s: %#06RX 32\n", g_aszBs3Cg1DstFields[idxField].sz, *PtrField.pu16));break;1001 case 1: BS3CG1_DPRINTF(("dbg: --> %s: %#04RX8\n", g_aszBs3Cg1DstFields[idxField].sz, *PtrField.pu8)); break; 1002 case 2: BS3CG1_DPRINTF(("dbg: --> %s: %#06RX16\n", g_aszBs3Cg1DstFields[idxField].sz, *PtrField.pu16)); break; 1003 1003 case 4: BS3CG1_DPRINTF(("dbg: --> %s: %#010RX32\n", g_aszBs3Cg1DstFields[idxField].sz, *PtrField.pu32)); break; 1004 1004 default: BS3CG1_DPRINTF(("dbg: --> %s: %#018RX64\n", g_aszBs3Cg1DstFields[idxField].sz, *PtrField.pu64)); break; … … 1228 1228 This.Ctx.cr2.u = This.uCodePgFlat + X86_PAGE_SIZE; 1229 1229 This.Ctx.rflags.u32 &= ~X86_EFL_RF; 1230 This.Ctx.rflags.u32 |= X86_EFL_RF & This.TrapFrame.Ctx.rflags.u32;1230 This.Ctx.rflags.u32 |= This.TrapFrame.Ctx.rflags.u32 & X86_EFL_RF; 1231 1231 if (Bs3Cg1RunContextModifier(&This, &This.Ctx, pHdr, 1232 1232 pHdr->cbSelector + pHdr->cbInput, pHdr->cbOutput,
Note:
See TracChangeset
for help on using the changeset viewer.