VirtualBox

Changeset 100859 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 11, 2023 11:43:38 AM (18 months ago)
Author:
vboxsync
Message:

VMM/IEM: Stack MC rework preps. bugref:10369

Location:
trunk/src/VBox/VMM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py

    r100856 r100859  
    521521        'IEM_MC_STORE_MEM_U256':                  (  0, 'IEM_MC_STORE_MEM_FLAT_U256' ),
    522522        'IEM_MC_STORE_MEM_U256_ALIGN_AVX':        (  0, 'IEM_MC_STORE_MEM_FLAT_U256_ALIGN_AVX' ),
    523         'IEM_MC_PUSH_U16':                        ( -1, 'IEM_MC_FLAT_PUSH_U16' ),
    524         'IEM_MC_PUSH_U32':                        ( -1, 'IEM_MC_FLAT_PUSH_U32' ),
    525         'IEM_MC_PUSH_U32_SREG':                   ( -1, 'IEM_MC_FLAT_PUSH_U32_SREG' ),
    526         'IEM_MC_PUSH_U64':                        ( -1, 'IEM_MC_FLAT_PUSH_U64' ),
    527         'IEM_MC_POP_U16':                         ( -1, 'IEM_MC_FLAT_POP_U16' ),
    528         'IEM_MC_POP_U32':                         ( -1, 'IEM_MC_FLAT_POP_U32' ),
    529         'IEM_MC_POP_U64':                         ( -1, 'IEM_MC_FLAT_POP_U64' ),
    530         'IEM_MC_POP_EX_U16':                      ( -1, 'IEM_MC_FLAT_POP_EX_U16' ),
    531         'IEM_MC_POP_EX_U32':                      ( -1, 'IEM_MC_FLAT_POP_EX_U32' ),
    532         'IEM_MC_POP_EX_U64':                      ( -1, 'IEM_MC_FLAT_POP_EX_U64' ),
    533523        'IEM_MC_MEM_MAP':                         (  2, 'IEM_MC_MEM_FLAT_MAP' ),
    534524        'IEM_MC_MEM_MAP_U8_RW':                   (  2, 'IEM_MC_MEM_FLAT_MAP_U8_RW' ),
     
    548538
    549539    kdMemMcToFlatInfoStack = {
    550         'IEM_MC_PUSH_U16':                        (  'IEM_MC_PUSH_FLAT32_U16', 'IEM_MC_PUSH_FLAT64_U16', ),
    551         'IEM_MC_PUSH_U32':                        (  'IEM_MC_PUSH_FLAT32_U32', 'IEM_MC_PUSH_FLAT64_U32', ),
    552         'IEM_MC_PUSH_U64':                        (  'IEM_MC_PUSH_U64',        'IEM_MC_PUSH_FLAT64_U64', ),
    553         'IEM_MC_POP_U16':                         (  'IEM_MC_POP_FLAT32_U16',  'IEM_MC_POP_FLAT64_U16', ),
    554         'IEM_MC_POP_U32':                         (  'IEM_MC_POP_FLAT32_U32',  'IEM_MC_POP_FLAT64_U32', ),
    555         'IEM_MC_POP_U64':                         (  'IEM_MC_POP_U64',         'IEM_MC_POP_FLAT64_U64', ),
     540        'IEM_MC_PUSH_U16':                        (  'IEM_MC_FLAT32_PUSH_U16',      'IEM_MC_FLAT64_PUSH_U16', ),
     541        'IEM_MC_PUSH_U32':                        (  'IEM_MC_FLAT32_PUSH_U32',      'IEM_MC_PUSH_U32', ),
     542        'IEM_MC_PUSH_U64':                        (  'IEM_MC_PUSH_U64',             'IEM_MC_FLAT64_PUSH_U64', ),
     543        'IEM_MC_PUSH_U32_SREG':                   (  'IEM_MC_FLAT32_PUSH_U32_SREG', 'IEM_MC_PUSH_U32_SREG' ),
     544        'IEM_MC_POP_U16':                         (  'IEM_MC_FLAT32_POP_U16',       'IEM_MC_FLAT64_POP_U16', ),
     545        'IEM_MC_POP_U32':                         (  'IEM_MC_FLAT32_POP_U32',       'IEM_MC_POP_U32', ),
     546        'IEM_MC_POP_U64':                         (  'IEM_MC_POP_U64',              'IEM_MC_FLAT64_POP_U64', ),
    556547    };
    557548
     
    656647                      and (   oNewStmt.sName.startswith('IEM_MC_FETCH_MEM')
    657648                           or (oNewStmt.sName.startswith('IEM_MC_STORE_MEM_') and oNewStmt.sName.find('_BY_REF') < 0)
    658                            or oNewStmt.sName.startswith('IEM_MC_MEM_MAP')
    659                            or (oNewStmt.sName.startswith('IEM_MC_PUSH') and oNewStmt.sName.find('_FPU') < 0)
    660                            or oNewStmt.sName.startswith('IEM_MC_POP') )):
     649                           or oNewStmt.sName.startswith('IEM_MC_MEM_MAP') )):
    661650                    idxEffSeg = self.kdMemMcToFlatInfo[oNewStmt.sName][0];
    662651                    if idxEffSeg != -1:
     
    667656                        oNewStmt.asParams.pop(idxEffSeg);
    668657                    oNewStmt.sName = self.kdMemMcToFlatInfo[oNewStmt.sName][1];
     658
     659                # ... PUSH and POP also needs flat variants, but these differ a little.
     660                elif (    self.sVariation in (self.ksVariation_64, self.ksVariation_32_Flat,)
     661                      and (   (oNewStmt.sName.startswith('IEM_MC_PUSH') and oNewStmt.sName.find('_FPU') < 0)
     662                           or oNewStmt.sName.startswith('IEM_MC_POP'))):
     663                    oNewStmt.sName = self.kdMemMcToFlatInfoStack[oNewStmt.sName][int(self.sVariation == self.ksVariation_64)];
     664
    669665
    670666                # Process branches of conditionals recursively.
  • trunk/src/VBox/VMM/include/IEMMc.h

    r100854 r100859  
    12851285
    12861286/* Regular stack push and pop: */
    1287 #define IEM_MC_PUSH_U16(a_u16Value) \
    1288     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU16(pVCpu, (a_u16Value)))
    1289 #define IEM_MC_PUSH_U32(a_u32Value) \
    1290     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32(pVCpu, (a_u32Value)))
    1291 #define IEM_MC_PUSH_U32_SREG(a_u32Value) \
    1292     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32SReg(pVCpu, (a_u32Value)))
    1293 #define IEM_MC_PUSH_U64(a_u64Value) \
    1294     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU64(pVCpu, (a_u64Value)))
    1295 
    1296 #define IEM_MC_POP_U16(a_pu16Value) \
    1297     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16(pVCpu, (a_pu16Value)))
    1298 #define IEM_MC_POP_U32(a_pu32Value) \
    1299     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU32(pVCpu, (a_pu32Value)))
    1300 #define IEM_MC_POP_U64(a_pu64Value) \
    1301     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU64(pVCpu, (a_pu64Value)))
    1302 
    1303 #define IEM_MC_POP_EX_U16(a_pu16Value, a_) \
    1304     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16Ex(pVCpu, (a_pu16Value), (a_pNewRsp)))
    1305 #define IEM_MC_POP_EX_U32(a_pu32Value) \
    1306     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU32(pVCpu, (a_pu32Value)))
    1307 #define IEM_MC_POP_EX_U64(a_pu64Value) \
    1308     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU64(pVCpu, (a_pu64Value)))
    1309 
    1310 /* Flat stack push and pop: */
    1311 #define IEM_MC_FLAT_PUSH_U16(a_u16Value) \
    1312     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU16(pVCpu, (a_u16Value)))
    1313 #define IEM_MC_FLAT_PUSH_U32(a_u32Value) \
    1314     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32(pVCpu, (a_u32Value)))
    1315 #define IEM_MC_FLAT_PUSH_U32_SREG(a_u32Value) \
    1316     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32SReg(pVCpu, (a_u32Value)))
    1317 #define IEM_MC_FLAT_PUSH_U64(a_u64Value) \
    1318     IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU64(pVCpu, (a_u64Value)))
    1319 
    1320 #define IEM_MC_FLAT_POP_U16(a_pu16Value) \
    1321     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16(pVCpu, (a_pu16Value)))
    1322 #define IEM_MC_FLAT_POP_U32(a_pu32Value) \
    1323     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU32(pVCpu, (a_pu32Value)))
    1324 #define IEM_MC_FLAT_POP_U64(a_pu64Value) \
    1325     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU64(pVCpu, (a_pu64Value)))
    1326 
    1327 #define IEM_MC_FLAT_POP_EX_U16(a_pu16Value, a_) \
    1328     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16Ex(pVCpu, (a_pu16Value), (a_pNewRsp)))
    1329 #define IEM_MC_FLAT_POP_EX_U32(a_pu32Value) \
    1330     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU32(pVCpu, (a_pu32Value)))
    1331 #define IEM_MC_FLAT_POP_EX_U64(a_pu64Value) \
    1332     IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU64(pVCpu, (a_pu64Value)))
     1287#define IEM_MC_PUSH_U16(a_u16Value)             IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU16(pVCpu, (a_u16Value)))
     1288#define IEM_MC_PUSH_U32(a_u32Value)             IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32(pVCpu, (a_u32Value)))
     1289#define IEM_MC_PUSH_U32_SREG(a_u32Value)        IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32SReg(pVCpu, (a_u32Value)))
     1290#define IEM_MC_PUSH_U64(a_u64Value)             IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU64(pVCpu, (a_u64Value)))
     1291
     1292#define IEM_MC_POP_U16(a_pu16Value)             IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16(pVCpu, (a_pu16Value)))
     1293#define IEM_MC_POP_U32(a_pu32Value)             IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU32(pVCpu, (a_pu32Value)))
     1294#define IEM_MC_POP_U64(a_pu64Value)             IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU64(pVCpu, (a_pu64Value)))
     1295
     1296/* 32-bit flat stack push and pop: */
     1297#define IEM_MC_FLAT32_PUSH_U16(a_u16Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU16(pVCpu, (a_u16Value)))
     1298#define IEM_MC_FLAT32_PUSH_U32(a_u32Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32(pVCpu, (a_u32Value)))
     1299#define IEM_MC_FLAT32_PUSH_U32_SREG(a_u32Value) IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU32SReg(pVCpu, (a_u32Value)))
     1300
     1301#define IEM_MC_FLAT32_POP_U16(a_pu16Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16(pVCpu, (a_pu16Value)))
     1302#define IEM_MC_FLAT32_POP_U32(a_pu32Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU32(pVCpu, (a_pu32Value)))
     1303
     1304/* 64-bit flat stack push and pop: */
     1305#define IEM_MC_FLAT64_PUSH_U16(a_u16Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU16(pVCpu, (a_u16Value)))
     1306#define IEM_MC_FLAT64_PUSH_U64(a_u64Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPushU64(pVCpu, (a_u64Value)))
     1307
     1308#define IEM_MC_FLAT64_POP_U16(a_pu16Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU16(pVCpu, (a_pu16Value)))
     1309#define IEM_MC_FLAT64_POP_U64(a_pu64Value)      IEM_MC_RETURN_ON_FAILURE(iemMemStackPopU64(pVCpu, (a_pu64Value)))
    13331310
    13341311
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