Changeset 101275 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Sep 26, 2023 11:44:36 PM (15 months ago)
- Location:
- trunk/src/VBox/VMM
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/Makefile.kmk
r101229 r101275 580 580 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h \ 581 581 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h 582 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER 583 VBoxVMM_INTERMEDIATES += \ 584 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h \ 585 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h 586 endif 582 587 VBoxVMM_CLEAN += \ 583 588 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts \ … … 587 592 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h \ 588 593 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h \ 589 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h 594 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h \ 595 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h \ 596 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h 590 597 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts) 591 598 $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts \ 592 599 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \ 593 600 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h \ 601 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h,) \ 602 +| $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h,) \ 594 603 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h \ 595 604 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h \ … … 619 628 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS) 620 629 $(REDIRECT) -0 /dev/null -- $(VBOX_BLD_PYTHON) $< $(filter %.cpp.h,$^) \ 621 --out-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \ 622 --out-funcs-cpp "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \ 623 --out-mod-input1 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \ 624 --out-mod-input2 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \ 625 --out-mod-input3 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \ 626 --out-mod-input4 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" 630 --out-thrd-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \ 631 --out-thrd-funcs-cpp "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \ 632 --out-mod-input1 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \ 633 --out-mod-input2 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \ 634 --out-mod-input3 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \ 635 --out-mod-input4 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \ 636 $(if-expr defined(VBOX_WITH_IEM_NATIVE_RECOMPILER), \ 637 --native-arch "$(KBUILD_TARGET_ARCH)" \ 638 --out-n8ve-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \ 639 --out-n8ve-funcs-cpp "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h.ts" \ 640 ,) 627 641 $(QUIET)$(CP) -v -f --changed -- \ 628 642 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \ … … 643 657 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \ 644 658 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h" 659 ifdef VBOX_WITH_IEM_NATIVE_RECOMPILER 660 $(QUIET)$(CP) -v -f --changed -- \ 661 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \ 662 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h" 663 $(QUIET)$(CP) -v -f --changed -- \ 664 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h.ts" \ 665 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h" 666 endif 645 667 $(QUIET)$(RM) -f -- \ 646 668 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \ … … 648 670 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \ 649 671 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \ 650 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" 672 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \ 673 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.h.ts" \ 674 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMNativeFunctions.cpp.h.ts" 651 675 652 676 foobared: $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts … … 1075 1099 endef # def_vbox_vmm_py_check 1076 1100 1077 $(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstPython.py IEMAllThrdPython.py ) \1101 $(foreach py, $(addprefix $(PATH_SUB_CURRENT)/VMMAll/, IEMAllInstPython.py IEMAllThrdPython.py IEMAllN8vePython.py ) \ 1078 1102 , $(eval $(def_vbox_vmm_py_check))) 1079 1103 -
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r101261 r101275 85 85 #include "IEMThreadedFunctions.h" 86 86 #include "IEMN8veRecompiler.h" 87 #include "IEMNativeFunctions.h" 87 88 88 89 … … 1807 1808 1808 1809 1810 /* 1811 * Include g_apfnIemNativeRecompileFunctions and associated functions. 1812 * 1813 * This should probably live in it's own file later, but lets see what the 1814 * compile times turn out to be first. 1815 */ 1816 #include "IEMNativeFunctions.cpp.h" 1817 1818 1809 1819 /** 1810 1820 * Recompiles the given threaded TB into a native one. … … 1845 1855 while (cCallsLeft-- > 0) 1846 1856 { 1847 off = iemNativeEmitThreadedCall(pReNative, off, pCallEntry); 1857 PFNIEMNATIVERECOMPFUNC const pfnRecom = g_apfnIemNativeRecompileFunctions[pCallEntry->enmFunction]; 1858 if (pfnRecom) /** @todo stats on this. */ 1859 off = pfnRecom(pReNative, off, pCallEntry); 1860 else 1861 off = iemNativeEmitThreadedCall(pReNative, off, pCallEntry); 1848 1862 AssertReturn(off != UINT32_MAX, pTb); 1849 1863 -
trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py
r101182 r101275 43 43 44 44 import IEMAllInstPython as iai; 45 import IEMAllN8vePython as ian; 45 46 46 47 … … 289 290 self.iEnumValue = -1; 290 291 292 ## Native recompilation details for this variation. 293 self.oNativeRecomp = None; 294 291 295 def getIndexName(self): 292 296 sName = self.oParent.oMcBlock.sFunction; … … 297 301 return 'kIemThreadedFunc_%s_%s%s' % ( sName, self.oParent.oMcBlock.iInFunction, self.sVariation, ); 298 302 299 def get FunctionName(self):303 def getThreadedFunctionName(self): 300 304 sName = self.oParent.oMcBlock.sFunction; 301 305 if sName.startswith('iemOp_'): … … 304 308 return 'iemThreadedFunc_%s%s' % ( sName, self.sVariation, ); 305 309 return 'iemThreadedFunc_%s_%s%s' % ( sName, self.oParent.oMcBlock.iInFunction, self.sVariation, ); 310 311 def getNativeFunctionName(self): 312 return 'iemNativeRecompFunc_' + self.getThreadedFunctionName()[len('iemThreadedFunc_'):]; 306 313 307 314 # … … 1494 1501 # 1495 1502 1496 def processInputFiles(self ):1503 def processInputFiles(self, sNativeRecompilerArch = None): 1497 1504 """ 1498 1505 Process the input files. … … 1530 1537 iThreadedFunction += 1; 1531 1538 oThreadedFunction = self.getThreadedFunctionByIndex(iThreadedFunction); 1539 1540 # Analyze the threaded functions and their variations for native recompilation. 1541 if sNativeRecompilerArch: 1542 cTotal = 0; 1543 cNative = 0; 1544 for oThreadedFunction in self.aoThreadedFuncs: 1545 for oVariation in oThreadedFunction.aoVariations: 1546 cTotal += 1; 1547 oVariation.oNativeRecomp = ian.analyzeVariantForNativeRecomp(oVariation, sNativeRecompilerArch); 1548 if oVariation.oNativeRecomp and oVariation.oNativeRecomp.isRecompilable(): 1549 cNative += 1; 1550 print('debug: %.1f%% / %u out of %u threaded function variations are recompilable' 1551 % (cNative * 100.0 / cTotal, cNative, cTotal)); 1532 1552 1533 1553 return True; … … 1635 1655 asLines += [' kIemThreadedFunc_BltIn_%s,' % (sFuncNm,) for sFuncNm, _ in self.katBltIns]; 1636 1656 1637 iThreadedFunction = 1 ;1657 iThreadedFunction = 1 + len(self.katBltIns); 1638 1658 for sVariation in ThreadedFunctionVariation.kasVariationsEmitOrder: 1639 1659 asLines += [ … … 1675 1695 32: "UINT64_C(0xffffffff)", 1676 1696 }; 1697 1698 def generateFunctionParameterUnpacking(self, oVariation, oOut, asParams): 1699 """ 1700 Outputs code for unpacking parameters. 1701 This is shared by the threaded and native code generators. 1702 """ 1703 aasVars = []; 1704 for aoRefs in oVariation.dParamRefs.values(): 1705 oRef = aoRefs[0]; 1706 if oRef.sType[0] != 'P': 1707 cBits = g_kdTypeInfo[oRef.sType][0]; 1708 sType = g_kdTypeInfo[oRef.sType][2]; 1709 else: 1710 cBits = 64; 1711 sType = oRef.sType; 1712 1713 sTypeDecl = sType + ' const'; 1714 1715 if cBits == 64: 1716 assert oRef.offNewParam == 0; 1717 if sType == 'uint64_t': 1718 sUnpack = '%s;' % (asParams[oRef.iNewParam],); 1719 else: 1720 sUnpack = '(%s)%s;' % (sType, asParams[oRef.iNewParam],); 1721 elif oRef.offNewParam == 0: 1722 sUnpack = '(%s)(%s & %s);' % (sType, asParams[oRef.iNewParam], self.ksBitsToIntMask[cBits]); 1723 else: 1724 sUnpack = '(%s)((%s >> %s) & %s);' \ 1725 % (sType, asParams[oRef.iNewParam], oRef.offNewParam, self.ksBitsToIntMask[cBits]); 1726 1727 sComment = '/* %s - %s ref%s */' % (oRef.sOrgRef, len(aoRefs), 's' if len(aoRefs) != 1 else '',); 1728 1729 aasVars.append([ '%s:%02u' % (oRef.iNewParam, oRef.offNewParam), 1730 sTypeDecl, oRef.sNewName, sUnpack, sComment ]); 1731 acchVars = [0, 0, 0, 0, 0]; 1732 for asVar in aasVars: 1733 for iCol, sStr in enumerate(asVar): 1734 acchVars[iCol] = max(acchVars[iCol], len(sStr)); 1735 sFmt = ' %%-%ss %%-%ss = %%-%ss %%s\n' % (acchVars[1], acchVars[2], acchVars[3]); 1736 for asVar in sorted(aasVars): 1737 oOut.write(sFmt % (asVar[1], asVar[2], asVar[3], asVar[4],)); 1738 return True; 1739 1740 kasThreadedParamNames = ('uParam0', 'uParam1', 'uParam2'); 1677 1741 def generateThreadedFunctionsSource(self, oOut): 1678 1742 """ … … 1711 1775 ' (macro expansion)' if oMcBlock.iBeginLine == oMcBlock.iEndLine else '') 1712 1776 + ' */\n' 1713 + 'static IEM_DECL_IEMTHREADEDFUNC_DEF(' + oVariation.get FunctionName() + ')\n'1777 + 'static IEM_DECL_IEMTHREADEDFUNC_DEF(' + oVariation.getThreadedFunctionName() + ')\n' 1714 1778 + '{\n'); 1715 1779 1716 aasVars = []; 1717 for aoRefs in oVariation.dParamRefs.values(): 1718 oRef = aoRefs[0]; 1719 if oRef.sType[0] != 'P': 1720 cBits = g_kdTypeInfo[oRef.sType][0]; 1721 sType = g_kdTypeInfo[oRef.sType][2]; 1722 else: 1723 cBits = 64; 1724 sType = oRef.sType; 1725 1726 sTypeDecl = sType + ' const'; 1727 1728 if cBits == 64: 1729 assert oRef.offNewParam == 0; 1730 if sType == 'uint64_t': 1731 sUnpack = 'uParam%s;' % (oRef.iNewParam,); 1732 else: 1733 sUnpack = '(%s)uParam%s;' % (sType, oRef.iNewParam,); 1734 elif oRef.offNewParam == 0: 1735 sUnpack = '(%s)(uParam%s & %s);' % (sType, oRef.iNewParam, self.ksBitsToIntMask[cBits]); 1736 else: 1737 sUnpack = '(%s)((uParam%s >> %s) & %s);' \ 1738 % (sType, oRef.iNewParam, oRef.offNewParam, self.ksBitsToIntMask[cBits]); 1739 1740 sComment = '/* %s - %s ref%s */' % (oRef.sOrgRef, len(aoRefs), 's' if len(aoRefs) != 1 else '',); 1741 1742 aasVars.append([ '%s:%02u' % (oRef.iNewParam, oRef.offNewParam), 1743 sTypeDecl, oRef.sNewName, sUnpack, sComment ]); 1744 acchVars = [0, 0, 0, 0, 0]; 1745 for asVar in aasVars: 1746 for iCol, sStr in enumerate(asVar): 1747 acchVars[iCol] = max(acchVars[iCol], len(sStr)); 1748 sFmt = ' %%-%ss %%-%ss = %%-%ss %%s\n' % (acchVars[1], acchVars[2], acchVars[3]); 1749 for asVar in sorted(aasVars): 1750 oOut.write(sFmt % (asVar[1], asVar[2], asVar[3], asVar[4],)); 1780 # Unpack parameters. 1781 self.generateFunctionParameterUnpacking(oVariation, oOut, self.kasThreadedParamNames); 1751 1782 1752 1783 # RT_NOREF for unused parameters. 1753 1784 if oVariation.cMinParams < g_kcThreadedParams: 1754 oOut.write(' RT_NOREF(' 1755 + ', '.join(['uParam%u' % (i,) for i in range(oVariation.cMinParams, g_kcThreadedParams)]) 1756 + ');\n'); 1785 oOut.write(' RT_NOREF(' + ', '.join(self.kasThreadedParamNames[oVariation.cMinParams:]) + ');\n'); 1757 1786 1758 1787 # Now for the actual statements. … … 1803 1832 asArgCntTab.append(' %d, /*BltIn_%s*/' % (cArgs, sFuncNm,)); 1804 1833 1805 iThreadedFunction = 1 ;1834 iThreadedFunction = 1 + len(self.katBltIns); 1806 1835 for sVariation in ThreadedFunctionVariation.kasVariationsEmitOrder: 1807 1836 for asTable in aasTables: … … 1817 1846 iThreadedFunction += 1; 1818 1847 assert oVariation.iEnumValue == iThreadedFunction; 1819 sName = oVariation.get FunctionName();1848 sName = oVariation.getThreadedFunctionName(); 1820 1849 asFuncTable.append(' /*%4u*/ %s,' % (iThreadedFunction, sName,)); 1821 1850 asNameTable.append(' /*%4u*/ "%s",' % (iThreadedFunction, sName,)); … … 1845 1874 return True; 1846 1875 1876 def generateNativeFunctionsHeader(self, oOut): 1877 """ 1878 Generates the native recompiler functions header file. 1879 Returns success indicator. 1880 """ 1881 if not self.oOptions.sNativeRecompilerArch: 1882 return True; 1883 1884 asLines = self.generateLicenseHeader(); 1885 1886 # Prototype the function table. 1887 asLines += [ 1888 'extern const PFNIEMNATIVERECOMPFUNC g_apfnIemNativeRecompileFunctions[kIemThreadedFunc_End];', 1889 '', 1890 ]; 1891 1892 oOut.write('\n'.join(asLines)); 1893 return True; 1894 1895 def generateNativeFunctionsSource(self, oOut): 1896 """ 1897 Generates the native recompiler functions source file. 1898 Returns success indicator. 1899 """ 1900 if not self.oOptions.sNativeRecompilerArch: 1901 return True; 1902 1903 # 1904 # The file header. 1905 # 1906 oOut.write('\n'.join(self.generateLicenseHeader())); 1907 1908 # 1909 # Emit the functions. 1910 # 1911 for sVariation in ThreadedFunctionVariation.kasVariationsEmitOrder: 1912 sVarName = ThreadedFunctionVariation.kdVariationNames[sVariation]; 1913 oOut.write( '\n' 1914 + '\n' 1915 + '\n' 1916 + '\n' 1917 + '/*' + '*' * 128 + '\n' 1918 + '* Variation: ' + sVarName + ' ' * (129 - len(sVarName) - 15) + '*\n' 1919 + '*' * 128 + '*/\n'); 1920 1921 for oThreadedFunction in self.aoThreadedFuncs: 1922 oVariation = oThreadedFunction.dVariations.get(sVariation, None) # type: ThreadedFunctionVariation 1923 if oVariation and oVariation.oNativeRecomp and oVariation.oNativeRecomp.isRecompilable(): 1924 oMcBlock = oThreadedFunction.oMcBlock; 1925 1926 # Function header 1927 oOut.write( '\n' 1928 + '\n' 1929 + '/**\n' 1930 + ' * #%u: %s at line %s offset %s in %s%s\n' 1931 % (oVariation.iEnumValue, oMcBlock.sFunction, oMcBlock.iBeginLine, oMcBlock.offBeginLine, 1932 os.path.split(oMcBlock.sSrcFile)[1], 1933 ' (macro expansion)' if oMcBlock.iBeginLine == oMcBlock.iEndLine else '') 1934 + ' */\n' 1935 + 'static IEM_DECL_IEMNATIVERECOMPFUNC_DEF(' + oVariation.getNativeFunctionName() + ')\n' 1936 + '{\n'); 1937 1938 # Unpack parameters. 1939 self.generateFunctionParameterUnpacking(oVariation, oOut, 1940 ('pCallEntry->auParams[0]', 1941 'pCallEntry->auParams[1]', 1942 'pCallEntry->auParams[2]',)); 1943 1944 # Now for the actual statements. 1945 oOut.write(oVariation.oNativeRecomp.renderCode(cchIndent = 4)); 1946 1947 oOut.write('}\n'); 1948 1949 # 1950 # Output the function table. 1951 # 1952 oOut.write( '\n' 1953 + '\n' 1954 + '/*\n' 1955 + ' * Function table running parallel to g_apfnIemThreadedFunctions and friends.\n' 1956 + ' */\n' 1957 + 'const PFNIEMNATIVERECOMPFUNC g_apfnIemNativeRecompileFunctions[kIemThreadedFunc_End] =\n' 1958 + '{\n' 1959 + ' /*Invalid*/ NULL,' 1960 + '\n' 1961 + ' /*\n' 1962 + ' * Predefined.\n' 1963 + ' */\n' 1964 ); 1965 for sFuncNm, _ in self.katBltIns: 1966 oOut.write(' NULL, /*BltIn_%s*/\n' % (sFuncNm,)) 1967 1968 iThreadedFunction = 1 + len(self.katBltIns); 1969 for sVariation in ThreadedFunctionVariation.kasVariationsEmitOrder: 1970 oOut.write( ' /*\n' 1971 + ' * Variation: ' + ThreadedFunctionVariation.kdVariationNames[sVariation] + '\n' 1972 + ' */\n'); 1973 for oThreadedFunction in self.aoThreadedFuncs: 1974 oVariation = oThreadedFunction.dVariations.get(sVariation, None); 1975 if oVariation: 1976 iThreadedFunction += 1; 1977 assert oVariation.iEnumValue == iThreadedFunction; 1978 sName = oVariation.getNativeFunctionName(); 1979 if oVariation.oNativeRecomp and oVariation.oNativeRecomp.isRecompilable(): 1980 oOut.write(' /*%4u*/ %s,\n' % (iThreadedFunction, sName,)); 1981 else: 1982 oOut.write(' /*%4u*/ NULL /*%s*/,\n' % (iThreadedFunction, sName,)); 1983 1984 oOut.write( '};\n' 1985 + '\n'); 1986 return True; 1987 1988 1847 1989 def getThreadedFunctionByIndex(self, idx): 1848 1990 """ … … 1985 2127 sScriptDir = os.path.dirname(__file__); 1986 2128 oParser = argparse.ArgumentParser(add_help = False); 1987 oParser.add_argument('asInFiles', metavar = 'input.cpp.h', nargs = '*', 2129 oParser.add_argument('asInFiles', 2130 metavar = 'input.cpp.h', 2131 nargs = '*', 1988 2132 default = [os.path.join(sScriptDir, aoInfo[0]) 1989 2133 for aoInfo in iai.g_aaoAllInstrFilesAndDefaultMapAndSet], 1990 help = "Selection of VMMAll/IEMAllInst*.cpp.h files to use as input."); 1991 oParser.add_argument('--out-funcs-hdr', metavar = 'file-funcs.h', dest = 'sOutFileFuncsHdr', action = 'store', 1992 default = '-', help = 'The output header file for the functions.'); 1993 oParser.add_argument('--out-funcs-cpp', metavar = 'file-funcs.cpp', dest = 'sOutFileFuncsCpp', action = 'store', 1994 default = '-', help = 'The output C++ file for the functions.'); 1995 oParser.add_argument('--out-mod-input1', metavar = 'file-instr.cpp.h', dest = 'sOutFileModInput1', action = 'store', 1996 default = '-', help = 'The output C++/header file for modified input instruction files part 1.'); 1997 oParser.add_argument('--out-mod-input2', metavar = 'file-instr.cpp.h', dest = 'sOutFileModInput2', action = 'store', 1998 default = '-', help = 'The output C++/header file for modified input instruction files part 2.'); 1999 oParser.add_argument('--out-mod-input3', metavar = 'file-instr.cpp.h', dest = 'sOutFileModInput3', action = 'store', 2000 default = '-', help = 'The output C++/header file for modified input instruction files part 3.'); 2001 oParser.add_argument('--out-mod-input4', metavar = 'file-instr.cpp.h', dest = 'sOutFileModInput4', action = 'store', 2002 default = '-', help = 'The output C++/header file for modified input instruction files part 4.'); 2003 oParser.add_argument('--help', '-h', '-?', action = 'help', help = 'Display help and exit.'); 2004 oParser.add_argument('--version', '-V', action = 'version', 2134 help = "Selection of VMMAll/IEMAllInst*.cpp.h files to use as input."); 2135 oParser.add_argument('--out-thrd-funcs-hdr', 2136 metavar = 'file-thrd-funcs.h', 2137 dest = 'sOutFileThrdFuncsHdr', 2138 action = 'store', 2139 default = '-', 2140 help = 'The output header file for the threaded functions.'); 2141 oParser.add_argument('--out-thrd-funcs-cpp', 2142 metavar = 'file-thrd-funcs.cpp', 2143 dest = 'sOutFileThrdFuncsCpp', 2144 action = 'store', 2145 default = '-', 2146 help = 'The output C++ file for the threaded functions.'); 2147 oParser.add_argument('--out-n8ve-funcs-hdr', 2148 metavar = 'file-n8tv-funcs.h', 2149 dest = 'sOutFileN8veFuncsHdr', 2150 action = 'store', 2151 default = '-', 2152 help = 'The output header file for the native recompiler functions.'); 2153 oParser.add_argument('--out-n8ve-funcs-cpp', 2154 metavar = 'file-n8tv-funcs.cpp', 2155 dest = 'sOutFileN8veFuncsCpp', 2156 action = 'store', 2157 default = '-', 2158 help = 'The output C++ file for the native recompiler functions.'); 2159 oParser.add_argument('--native-arch', 2160 metavar = 'arch', 2161 dest = 'sNativeRecompilerArch', 2162 action = 'store', 2163 default = None, 2164 help = 'The host architecture for the native recompiler. No default as it enables/disables ' 2165 + 'generating the files related to native recompilation.'); 2166 oParser.add_argument('--out-mod-input1', 2167 metavar = 'file-instr.cpp.h', 2168 dest = 'sOutFileModInput1', 2169 action = 'store', 2170 default = '-', 2171 help = 'The output C++/header file for modified input instruction files part 1.'); 2172 oParser.add_argument('--out-mod-input2', 2173 metavar = 'file-instr.cpp.h', 2174 dest = 'sOutFileModInput2', 2175 action = 'store', 2176 default = '-', 2177 help = 'The output C++/header file for modified input instruction files part 2.'); 2178 oParser.add_argument('--out-mod-input3', 2179 metavar = 'file-instr.cpp.h', 2180 dest = 'sOutFileModInput3', 2181 action = 'store', 2182 default = '-', 2183 help = 'The output C++/header file for modified input instruction files part 3.'); 2184 oParser.add_argument('--out-mod-input4', 2185 metavar = 'file-instr.cpp.h', 2186 dest = 'sOutFileModInput4', 2187 action = 'store', 2188 default = '-', 2189 help = 'The output C++/header file for modified input instruction files part 4.'); 2190 oParser.add_argument('--help', '-h', '-?', 2191 action = 'help', 2192 help = 'Display help and exit.'); 2193 oParser.add_argument('--version', '-V', 2194 action = 'version', 2005 2195 version = 'r%s (IEMAllThreadedPython.py), r%s (IEMAllInstPython.py)' 2006 2196 % (__version__.split()[1], iai.__version__.split()[1],), 2007 help = 'Displays the version/revision of the script and exit.');2197 help = 'Displays the version/revision of the script and exit.'); 2008 2198 self.oOptions = oParser.parse_args(asArgs[1:]); 2009 2199 print("oOptions=%s" % (self.oOptions,)); … … 2012 2202 # Process the instructions specified in the IEM sources. 2013 2203 # 2014 if self.processInputFiles( ):2204 if self.processInputFiles(self.oOptions.sNativeRecompilerArch): 2015 2205 # 2016 2206 # Generate the output files. 2017 2207 # 2018 2208 aaoOutputFiles = ( 2019 ( self.oOptions.sOutFileFuncsHdr, self.generateThreadedFunctionsHeader ), 2020 ( self.oOptions.sOutFileFuncsCpp, self.generateThreadedFunctionsSource ), 2021 ( self.oOptions.sOutFileModInput1, self.generateModifiedInput1 ), 2022 ( self.oOptions.sOutFileModInput2, self.generateModifiedInput2 ), 2023 ( self.oOptions.sOutFileModInput3, self.generateModifiedInput3 ), 2024 ( self.oOptions.sOutFileModInput4, self.generateModifiedInput4 ), 2209 ( self.oOptions.sOutFileThrdFuncsHdr, self.generateThreadedFunctionsHeader ), 2210 ( self.oOptions.sOutFileThrdFuncsCpp, self.generateThreadedFunctionsSource ), 2211 ( self.oOptions.sOutFileN8veFuncsHdr, self.generateNativeFunctionsHeader ), 2212 ( self.oOptions.sOutFileN8veFuncsCpp, self.generateNativeFunctionsSource ), 2213 ( self.oOptions.sOutFileModInput1, self.generateModifiedInput1 ), 2214 ( self.oOptions.sOutFileModInput2, self.generateModifiedInput2 ), 2215 ( self.oOptions.sOutFileModInput3, self.generateModifiedInput3 ), 2216 ( self.oOptions.sOutFileModInput4, self.generateModifiedInput4 ), 2025 2217 ); 2026 2218 fRc = True; -
trunk/src/VBox/VMM/include/IEMN8veRecompiler.h
r101248 r101275 260 260 261 261 262 /** 263 * Native recompiler worker for a threaded function. 264 * 265 * @returns New code buffer offset, UINT32_MAX in case of failure. 266 * @param pReNative The native recompiler state. 267 * @param off The current code buffer offset. 268 * @param pCallEntry The threaded call entry. 269 * 270 * @note This is not allowed to throw anything atm. 271 */ 272 typedef DECLCALLBACKTYPE(uint32_t, FNIEMNATIVERECOMPFUNC,(PIEMRECOMPILERSTATE pReNative, uint32_t off, 273 PCIEMTHRDEDCALLENTRY pCallEntry)); 274 /** Pointer to a native recompiler worker for a threaded function. */ 275 typedef FNIEMNATIVERECOMPFUNC *PFNIEMNATIVERECOMPFUNC; 276 277 /** Defines a native recompiler worker for a threaded function. */ 278 #define IEM_DECL_IEMNATIVERECOMPFUNC_DEF(a_Name) \ 279 DECLCALLBACK(uint32_t) a_Name(PIEMRECOMPILERSTATE pReNative, uint32_t off, PCIEMTHRDEDCALLENTRY pCallEntry) 280 /** Prototypes a native recompiler function for a threaded function. */ 281 #define IEM_DECL_IEMNATIVERECOMPFUNC_PROTO(a_Name) FNIEMNATIVERECOMPFUNC a_Name 282 262 283 263 284 DECLHIDDEN(uint32_t) iemNativeMakeLabel(PIEMRECOMPILERSTATE pReNative, IEMNATIVELABELTYPE enmType,
Note:
See TracChangeset
for help on using the changeset viewer.