VirtualBox

Changeset 100743 in vbox


Ignore:
Timestamp:
Jul 30, 2023 11:17:41 PM (16 months ago)
Author:
vboxsync
Message:

VMM/IEM: Split up IEMAllThrdTables.cpp into four files to speed up compilation, just like done in r158610 for the interpreter. bugref:10369

Location:
trunk/src/VBox/VMM
Files:
6 edited
3 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/Makefile.kmk

    r100740 r100743  
    252252 VBoxVMM_SOURCES += \
    253253        VMMAll/IEMAllThrdRecompiler.cpp \
    254         VMMAll/IEMAllThrdTables.cpp \
     254        VMMAll/IEMAllThrdTables1.cpp \
     255        VMMAll/IEMAllThrdTables2.cpp \
     256        VMMAll/IEMAllThrdTables3.cpp \
     257        VMMAll/IEMAllThrdTables4.cpp \
    255258        VMMAll/IEMAllThrdFuncs.cpp \
    256259        VMMAll/IEMAllThrdFuncsBltIn.cpp
     
    576579 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h \
    577580 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h \
    578  +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions.cpp.h: \
     581 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h \
     582 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h \
     583 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h \
     584 +| $(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h: \
    579585                $(PATH_SUB_CURRENT)/VMMAll/IEMAllThrdPython.py \
    580586                $(PATH_SUB_CURRENT)/VMMAll/IEMAllInstPython.py \
     
    599605        --out-funcs-hdr "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h.ts" \
    600606        --out-funcs-cpp "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
    601         --out-mod-input "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions.cpp.h.ts"
     607        --out-mod-input1 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
     608        --out-mod-input2 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
     609        --out-mod-input3 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
     610        --out-mod-input4 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts"
    602611        $(QUIET)$(CP) -v -f --changed -- \
    603                 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions.cpp.h.ts" \
    604                 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions.cpp.h"
     612                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
     613                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h"
     614        $(QUIET)$(CP) -v -f --changed -- \
     615                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
     616                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h"
     617        $(QUIET)$(CP) -v -f --changed -- \
     618                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
     619                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h"
     620        $(QUIET)$(CP) -v -f --changed -- \
     621                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \
     622                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h"
    605623        $(QUIET)$(CP) -v -f --changed -- \
    606624                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts" \
     
    610628                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.h"
    611629        $(QUIET)$(RM) -f -- \
    612                 "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions.cpp.h.ts" \
     630                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions1.cpp.h.ts" \
     631                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions2.cpp.h.ts" \
     632                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions3.cpp.h.ts" \
     633                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedInstructions4.cpp.h.ts" \
    613634                "$(VBoxVMM_0_OUTDIR)/CommonGenIncs/IEMThreadedFunctions.cpp.h.ts"
    614635
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py

    r100734 r100743  
    53745374    return 0;
    53755375
    5376 ## List of all main instruction files and their default maps.
    5377 g_aasAllInstrFilesAndDefaultMap = (
    5378     ( 'IEMAllInstCommon.cpp.h',    'one',        ),
    5379     ( 'IEMAllInstOneByte.cpp.h',   'one',        ),
    5380     ( 'IEMAllInstTwoByte0f.cpp.h', 'two0f',      ),
    5381     ( 'IEMAllInstThree0f38.cpp.h', 'three0f38', ),
    5382     ( 'IEMAllInstThree0f3a.cpp.h', 'three0f3a', ),
    5383     ( 'IEMAllInstVexMap1.cpp.h',   'vexmap1',    ),
    5384     ( 'IEMAllInstVexMap2.cpp.h',   'vexmap2',    ),
    5385     ( 'IEMAllInstVexMap3.cpp.h',   'vexmap3',    ),
    5386     ( 'IEMAllInst3DNow.cpp.h',     '3dnow',      ),
     5376## List of all main instruction files, their default maps and file sets (-1 means included it all sets).
     5377g_aaoAllInstrFilesAndDefaultMapAndSet = (
     5378    ( 'IEMAllInstCommon.cpp.h',    'one',       -1, ),
     5379    ( 'IEMAllInstOneByte.cpp.h',   'one',        1, ),
     5380    ( 'IEMAllInst3DNow.cpp.h',     '3dnow',      2, ),
     5381    ( 'IEMAllInstTwoByte0f.cpp.h', 'two0f',      2, ),
     5382    ( 'IEMAllInstThree0f38.cpp.h', 'three0f38',  3, ),
     5383    ( 'IEMAllInstThree0f3a.cpp.h', 'three0f3a',  3, ),
     5384    ( 'IEMAllInstVexMap1.cpp.h',   'vexmap1',    4, ),
     5385    ( 'IEMAllInstVexMap2.cpp.h',   'vexmap2',    4, ),
     5386    ( 'IEMAllInstVexMap3.cpp.h',   'vexmap3',    4, ),
    53875387);
    53885388
     
    54315431        sName = os.path.split(sFilename)[1].lower();
    54325432        sMap  = None;
    5433         for asCur in g_aasAllInstrFilesAndDefaultMap:
    5434             if asCur[0].lower() == sName:
    5435                 sMap = asCur[1];
     5433        for aoInfo in g_aaoAllInstrFilesAndDefaultMapAndSet:
     5434            if aoInfo[0].lower() == sName:
     5435                sMap = aoInfo[1];
    54365436                break;
    54375437        if not sMap:
     
    54495449    Raises exception on failure.
    54505450    """
    5451     return __parseFilesWorker(g_aasAllInstrFilesAndDefaultMap);
     5451    return __parseFilesWorker([aoInfo[0:2] for aoInfo in g_aaoAllInstrFilesAndDefaultMapAndSet]);
    54525452
    54535453
  • trunk/src/VBox/VMM/VMMAll/IEMAllIntprTables1.cpp

    r100740 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Emulation - Interpreter Tables - One Byte.
     3 * IEM - Instruction Decoding and Emulation - Interpreter Tables - One-Byte.
    44 */
    55
  • trunk/src/VBox/VMM/VMMAll/IEMAllIntprTables2.cpp

    r100740 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Emulation - Interpreter Tables - Two byte & 3DNow!
     3 * IEM - Instruction Decoding and Emulation - Interpreter Tables - Two-Byte & 3DNow!
    44 */
    55
  • trunk/src/VBox/VMM/VMMAll/IEMAllIntprTables3.cpp

    r100740 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Emulation - Interpreter Tables - Three byte.
     3 * IEM - Instruction Decoding and Emulation - Interpreter Tables - Three-Byte.
    44 */
    55
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py

    r100734 r100743  
    11861186        self.oOptions        = None     # type: argparse.Namespace
    11871187        self.aoParsers       = []       # type: list(IEMAllInstPython.SimpleParser)
     1188        self.aidxFirstFunctions = []    # type: list(int) ##< Runs parallel to aoParser giving the index of the first function.
    11881189
    11891190    #
     
    12151216                  % (cCount, dRawParamCounts.get(cCount, 0), dMinParamCounts.get(cCount, 0)),
    12161217                  file = sys.stderr);
     1218
     1219        # Populate aidxFirstFunctions.  This is ASSUMING that
     1220        # g_aoMcBlocks/self.aoThreadedFuncs are in self.aoParsers order.
     1221        iThreadedFunction       = 0;
     1222        oThreadedFunction       = self.getThreadedFunctionByIndex(0);
     1223        self.aidxFirstFunctions = [];
     1224        for oParser in self.aoParsers:
     1225            self.aidxFirstFunctions.append(iThreadedFunction);
     1226
     1227            while oThreadedFunction.oMcBlock.sSrcFile == oParser.sSrcFile:
     1228                iThreadedFunction += 1;
     1229                oThreadedFunction  = self.getThreadedFunctionByIndex(iThreadedFunction);
    12171230
    12181231        return True;
     
    15481561        return ThreadedFunction.dummyInstance();
    15491562
    1550     def generateModifiedInput(self, oOut):
     1563    def generateModifiedInput(self, oOut, idxFile):
    15511564        """
    15521565        Generates the combined modified input source/header file.
     
    15591572
    15601573        #
    1561         # ASSUMING that g_aoMcBlocks/self.aoThreadedFuncs are in self.aoParsers
    1562         # order, we iterate aoThreadedFuncs in parallel to the lines from the
    1563         # parsers and apply modifications where required.
    1564         #
    1565         iThreadedFunction = 0;
    1566         oThreadedFunction = self.getThreadedFunctionByIndex(0);
    1567         for oParser in self.aoParsers: # type: IEMAllInstPython.SimpleParser
     1574        # Iterate all parsers (input files) and output the ones related to the
     1575        # file set given by idxFile.
     1576        #
     1577        for idxParser, oParser in enumerate(self.aoParsers): # type: int, IEMAllInstPython.SimpleParser
     1578            # Is this included in the file set?
     1579            sSrcBaseFile = os.path.basename(oParser.sSrcFile).lower();
     1580            fInclude     = -1;
     1581            for aoInfo in iai.g_aaoAllInstrFilesAndDefaultMapAndSet:
     1582                if sSrcBaseFile == aoInfo[0].lower():
     1583                    fInclude = aoInfo[2] in (-1, idxFile);
     1584                    break;
     1585            if fInclude is not True:
     1586                assert fInclude is False;
     1587                continue;
     1588
     1589            # Output it.
    15681590            oOut.write("\n\n/* ****** BEGIN %s ******* */\n" % (oParser.sSrcFile,));
    15691591
    1570             iLine = 0;
     1592            iThreadedFunction = self.aidxFirstFunctions[idxParser];
     1593            oThreadedFunction = self.getThreadedFunctionByIndex(iThreadedFunction);
     1594            iLine             = 0;
    15711595            while iLine < len(oParser.asLines):
    15721596                sLine = oParser.asLines[iLine];
     
    16231647        return True;
    16241648
     1649    def generateModifiedInput1(self, oOut):
     1650        """
     1651        Generates the combined modified input source/header file, part 1.
     1652        Returns success indicator.
     1653        """
     1654        return self.generateModifiedInput(oOut, 1);
     1655
     1656    def generateModifiedInput2(self, oOut):
     1657        """
     1658        Generates the combined modified input source/header file, part 2.
     1659        Returns success indicator.
     1660        """
     1661        return self.generateModifiedInput(oOut, 2);
     1662
     1663    def generateModifiedInput3(self, oOut):
     1664        """
     1665        Generates the combined modified input source/header file, part 3.
     1666        Returns success indicator.
     1667        """
     1668        return self.generateModifiedInput(oOut, 3);
     1669
     1670    def generateModifiedInput4(self, oOut):
     1671        """
     1672        Generates the combined modified input source/header file, part 4.
     1673        Returns success indicator.
     1674        """
     1675        return self.generateModifiedInput(oOut, 4);
     1676
     1677
    16251678    #
    16261679    # Main
     
    16391692        oParser = argparse.ArgumentParser(add_help = False);
    16401693        oParser.add_argument('asInFiles',       metavar = 'input.cpp.h',        nargs = '*',
    1641                              default = [os.path.join(sScriptDir, asFM[0]) for asFM in iai.g_aasAllInstrFilesAndDefaultMap],
     1694                             default = [os.path.join(sScriptDir, aoInfo[0])
     1695                                        for aoInfo in iai.g_aaoAllInstrFilesAndDefaultMapAndSet],
    16421696                             help = "Selection of VMMAll/IEMAllInst*.cpp.h files to use as input.");
    16431697        oParser.add_argument('--out-funcs-hdr', metavar = 'file-funcs.h',       dest = 'sOutFileFuncsHdr', action = 'store',
     
    16451699        oParser.add_argument('--out-funcs-cpp', metavar = 'file-funcs.cpp',     dest = 'sOutFileFuncsCpp', action = 'store',
    16461700                             default = '-', help = 'The output C++ file for the functions.');
    1647         oParser.add_argument('--out-mod-input', metavar = 'file-instr.cpp.h',   dest = 'sOutFileModInput', action = 'store',
    1648                              default = '-', help = 'The output C++/header file for the modified input instruction files.');
     1701        oParser.add_argument('--out-mod-input1', metavar = 'file-instr.cpp.h',   dest = 'sOutFileModInput1', action = 'store',
     1702                             default = '-', help = 'The output C++/header file for modified input instruction files part 1.');
     1703        oParser.add_argument('--out-mod-input2', metavar = 'file-instr.cpp.h',   dest = 'sOutFileModInput2', action = 'store',
     1704                             default = '-', help = 'The output C++/header file for modified input instruction files part 2.');
     1705        oParser.add_argument('--out-mod-input3', metavar = 'file-instr.cpp.h',   dest = 'sOutFileModInput3', action = 'store',
     1706                             default = '-', help = 'The output C++/header file for modified input instruction files part 3.');
     1707        oParser.add_argument('--out-mod-input4', metavar = 'file-instr.cpp.h',   dest = 'sOutFileModInput4', action = 'store',
     1708                             default = '-', help = 'The output C++/header file for modified input instruction files part 4.');
    16491709        oParser.add_argument('--help', '-h', '-?', action = 'help', help = 'Display help and exit.');
    16501710        oParser.add_argument('--version', '-V', action = 'version',
     
    16631723            #
    16641724            aaoOutputFiles = (
    1665                  ( self.oOptions.sOutFileFuncsHdr, self.generateThreadedFunctionsHeader ),
    1666                  ( self.oOptions.sOutFileFuncsCpp, self.generateThreadedFunctionsSource ),
    1667                  ( self.oOptions.sOutFileModInput, self.generateModifiedInput ),
     1725                 ( self.oOptions.sOutFileFuncsHdr,  self.generateThreadedFunctionsHeader ),
     1726                 ( self.oOptions.sOutFileFuncsCpp,  self.generateThreadedFunctionsSource ),
     1727                 ( self.oOptions.sOutFileModInput1, self.generateModifiedInput1 ),
     1728                 ( self.oOptions.sOutFileModInput2, self.generateModifiedInput2 ),
     1729                 ( self.oOptions.sOutFileModInput3, self.generateModifiedInput3 ),
     1730                 ( self.oOptions.sOutFileModInput4, self.generateModifiedInput4 ),
    16681731            );
    16691732            fRc = True;
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdTables1.cpp

    r100742 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables.
     3 * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables - One-Byte.
    44 */
    55
     
    3232 */
    3333#define IEM_WITH_ONE_BYTE_TABLE
    34 #define IEM_WITH_TWO_BYTE_TABLE
    35 #define IEM_WITH_THREE_BYTE_TABLES
    36 #define IEM_WITH_3DNOW_BYTE_TABLE
    37 #define IEM_WITH_VEX_TABLES
    38 #include "IEMThreadedInstructions.cpp.h"
     34#include "IEMThreadedInstructions1.cpp.h"
    3935
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdTables2.cpp

    r100742 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables.
     3 * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables - Two-Byte & 3DNow!
    44 */
    55
     
    3131 * Include the "annotated" IEMAllInst*.cpp.h files.
    3232 */
    33 #define IEM_WITH_ONE_BYTE_TABLE
    3433#define IEM_WITH_TWO_BYTE_TABLE
    35 #define IEM_WITH_THREE_BYTE_TABLES
    3634#define IEM_WITH_3DNOW_BYTE_TABLE
    37 #define IEM_WITH_VEX_TABLES
    38 #include "IEMThreadedInstructions.cpp.h"
     35#include "IEMThreadedInstructions2.cpp.h"
    3936
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdTables3.cpp

    r100742 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables.
     3 * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables - Three-Byte.
    44 */
    55
     
    3131 * Include the "annotated" IEMAllInst*.cpp.h files.
    3232 */
    33 #define IEM_WITH_ONE_BYTE_TABLE
    34 #define IEM_WITH_TWO_BYTE_TABLE
    3533#define IEM_WITH_THREE_BYTE_TABLES
    36 #define IEM_WITH_3DNOW_BYTE_TABLE
    37 #define IEM_WITH_VEX_TABLES
    38 #include "IEMThreadedInstructions.cpp.h"
     34#include "IEMThreadedInstructions3.cpp.h"
    3935
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdTables4.cpp

    r100742 r100743  
    11/* $Id$ */
    22/** @file
    3  * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables.
     3 * IEM - Instruction Decoding and Threaded Recompilation, Instruction Tables - VEX.
    44 */
    55
     
    3131 * Include the "annotated" IEMAllInst*.cpp.h files.
    3232 */
    33 #define IEM_WITH_ONE_BYTE_TABLE
    34 #define IEM_WITH_TWO_BYTE_TABLE
    35 #define IEM_WITH_THREE_BYTE_TABLES
    36 #define IEM_WITH_3DNOW_BYTE_TABLE
    3733#define IEM_WITH_VEX_TABLES
    38 #include "IEMThreadedInstructions.cpp.h"
     34#include "IEMThreadedInstructions4.cpp.h"
    3935
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette