Changeset 108876 in vbox for trunk/src/VBox/VMM/VMMAll/target-armv8/bsd-spec-analyze.py
- Timestamp:
- Apr 8, 2025 1:04:50 AM (2 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168326
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/target-armv8/bsd-spec-analyze.py
r108875 r108876 1144 1144 cInstructions = len(self.aoInstructions) 1145 1145 if cInstructions <= 4: 1146 #assert len(self.dChildren) == 0;1146 assert not self.dChildren; 1147 1147 uCost = 0; 1148 1148 # Special case: 1 instruction - leaf. … … 1157 1157 else: 1158 1158 self.fChildMask = DecoderNode.kChildMaskMultipleOpcodeValueIfs; 1159 for i, oInstr in enumerate(self.aoInstructions):1160 self.dChildren[i] = DecoderNode([oInstr], oInstr.fFixedMask, oInstr.fFixedMask);1161 1159 uCost = 32 * cInstructions * 2; # 32 = kCostMultipleOpcodeValueIfs 1162 return uCost #<< uDepth;1160 return uCost; 1163 1161 1164 1162 # … … 1241 1239 uCostTmp = 256; # 256 = kCostIndirectCall 1242 1240 uCostTmp += (len(aaiMaskToIdxAlgo) - 1) * 2; # 2 = kCostPerExtraIndexStep 1243 #uCostTmp <<= uDepth; # Make the cost exponentially higher with depth. (?)1244 1241 if uCostTmp >= uCostBest: 1245 1242 #if uDepth <= 2: … … 1275 1272 cNominalFill = 1 << (cMaskBits - 1); # 50% full or better is great. 1276 1273 if len(daoTmp) < cNominalFill: 1277 uCostTmp += ((cNominalFill - len(daoTmp)) * 2) #<< uDepth;# 2 = kCostUnusedTabEntry1274 uCostTmp += ((cNominalFill - len(daoTmp)) * 2); # 2 = kCostUnusedTabEntry 1278 1275 if uCostTmp >= uCostBest: 1279 1276 #if uDepth <= 2: … … 1502 1499 Handles a leaf node. 1503 1500 """ 1504 assert not oNode.dChildren; 1501 assert not oNode.dChildren, \ 1502 'fChildMask=%#x dChildren=%s aoInstr=%s' % (oNode.fChildMask, oNode.dChildren, oNode.aoInstructions,); 1505 1503 1506 1504 asLines = [ … … 1527 1525 Recursively generates the decoder code. 1528 1526 """ 1529 assert oNode.fChildMask != 0 and oNode.fChildMask < (1 << 24), \1527 assert oNode.fChildMask != 0 and oNode.fChildMask not in (0x7fffffff, 0xffffffff, 0x4fffffff), \ 1530 1528 'fChildMask=%s #dChildren=%s aoInstr=%s' % (oNode.fChildMask, len(oNode.dChildren), oNode.aoInstructions,); 1531 1529 asLines = []; … … 1533 1531 # First recurse. 1534 1532 for oChildNode in oNode.dChildren.values(): 1535 if oChildNode.fChildMask == DecoderNode.kChildMaskMultipleOpcodeValueIfs: 1533 if oChildNode.dChildren: 1534 asLines += self.generateDecoderCode(oChildNode, uDepth + 1); 1535 elif oChildNode.fChildMask == DecoderNode.kChildMaskMultipleOpcodeValueIfs: 1536 assert len(oChildNode.aoInstructions) > 1; 1536 1537 asLines += self.generateDecoderCodeMultiIfFunc(oChildNode, uDepth + 1); 1537 elif oChildNode.fChildMask != DecoderNode.kChildMaskOpcodeValueIf:1538 assert oChildNode.dChildren;1539 asLines += self.generateDecoderCode(oChildNode, uDepth + 1);1540 1538 else: 1541 assert not oChildNode.dChildren; 1539 assert len(oChildNode.aoInstructions) == 1; 1540 assert oChildNode.fChildMask in [DecoderNode.kChildMaskOpcodeValueIf, 0]; 1542 1541 1543 1542 # Generate the function. … … 1570 1569 assert aaiAlgo, 'fChildMask=%s #children=%s instrs=%s' % (oNode.fChildMask, len(oNode.dChildren), oNode.aoInstructions,); 1571 1570 asIdx = [ 1572 ' uintptr_t const idx = ((uOpcode >> %2u) & %#010x) /* bit % u L %u -> 0 */'1571 ' uintptr_t const idx = ((uOpcode >> %2u) & %#010x) /* bit %2u L %u -> 0 */' 1573 1572 % (aaiAlgo[0][0], aaiAlgo[0][2], aaiAlgo[0][0], aaiAlgo[0][2].bit_count(), ), 1574 1573 ]; 1575 1574 for iSrcBit, iDstBit, fMask in aaiAlgo[1:]: 1576 asIdx.append(' | ((uOpcode >> %2u) & %#010x) /* bit % u L %u -> %u */'1575 asIdx.append(' | ((uOpcode >> %2u) & %#010x) /* bit %2u L %u -> %u */' 1577 1576 % (iSrcBit - iDstBit, fMask << iDstBit, iSrcBit, fMask.bit_count(), iDstBit)); 1578 1577 asIdx[-1] += ';';
Note:
See TracChangeset
for help on using the changeset viewer.