Changeset 100745 in vbox
- Timestamp:
- Jul 31, 2023 9:40:58 AM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllThrdPython.py
r100744 r100745 1044 1044 return aoStmts; 1045 1045 1046 # Generate the case statements.1047 # pylintx: disable=x1048 1046 dByVari = self.dVariations; 1049 aoCases = []; 1050 if ThreadedFunctionVariation.ksVariation_64_Addr32 in dByVari: 1051 aoCases.append(Case('IEMMODE_64BIT', [ 1052 iai.McCppCond('RT_LIKELY(pVCpu->iem.s.enmEffAddrMode == IEMMODE_64BIT)', fDecode = True, cchIndent = 8, 1053 aoIfBranch = dByVari[ThrdFnVar.ksVariation_64].emitThreadedCallStmts(0), 1054 aoElseBranch = dByVari[ThrdFnVar.ksVariation_64_Addr32].emitThreadedCallStmts(0)), 1055 ])); 1056 elif ThrdFnVar.ksVariation_64 in dByVari: 1057 aoCases.append(Case('IEMMODE_64BIT', dByVari[ThrdFnVar.ksVariation_64].emitThreadedCallStmts(8))); 1058 1059 if ThrdFnVar.ksVariation_32_Addr16 in dByVari: 1060 aoCases.extend([ 1061 Case('IEMMODE_32BIT | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK', [ 1062 iai.McCppCond('RT_LIKELY(pVCpu->iem.s.enmEffAddrMode == IEMMODE_32BIT)', fDecode = True, cchIndent = 8, 1063 aoIfBranch = dByVari[ThrdFnVar.ksVariation_32_Flat].emitThreadedCallStmts(0), 1064 aoElseBranch = dByVari[ThrdFnVar.ksVariation_32_Addr16].emitThreadedCallStmts(0)), 1065 ]), 1066 Case('IEMMODE_32BIT', [ 1067 iai.McCppCond('RT_LIKELY(pVCpu->iem.s.enmEffAddrMode == IEMMODE_32BIT)', fDecode = True, cchIndent = 8, 1068 aoIfBranch = dByVari[ThrdFnVar.ksVariation_32].emitThreadedCallStmts(0), 1069 aoElseBranch = dByVari[ThrdFnVar.ksVariation_32_Addr16].emitThreadedCallStmts(0)), 1070 ]), 1071 ]); 1072 elif ThrdFnVar.ksVariation_32 in dByVari: 1073 aoCases.append(Case('IEMMODE_32BIT', dByVari[ThrdFnVar.ksVariation_32].emitThreadedCallStmts(8))); 1074 1075 if ThrdFnVar.ksVariation_16_Addr32 in dByVari: 1076 aoCases.append(Case('IEMMODE_16BIT', [ 1077 iai.McCppCond('RT_LIKELY(pVCpu->iem.s.enmEffAddrMode == IEMMODE_16BIT)', fDecode = True, cchIndent = 8, 1078 aoIfBranch = dByVari[ThrdFnVar.ksVariation_16].emitThreadedCallStmts(0), 1079 aoElseBranch = dByVari[ThrdFnVar.ksVariation_16_Addr32].emitThreadedCallStmts(0)), 1080 ])); 1081 elif ThrdFnVar.ksVariation_16 in dByVari: 1082 aoCases.append(Case('IEMMODE_16BIT', dByVari[ThrdFnVar.ksVariation_16].emitThreadedCallStmts(8))); 1083 1084 if ThrdFnVar.ksVariation_16_Pre386 in dByVari: 1085 aoCases.append(Case('IEMMODE_16BIT | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK', 1086 dByVari[ThrdFnVar.ksVariation_16_Pre386].emitThreadedCallStmts(8))); 1087 1088 # Generate the switch statement. 1089 sExecMask = 'IEM_F_MODE_CPUMODE_MASK'; 1047 1048 # Determine what we're switch on. 1049 # This ASSUMES that (IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK | IEM_F_MODE_CPUMODE_MASK) == 7! 1050 fSimple = True; 1051 sSwitchValue = 'pVCpu->iem.s.fExec & IEM_F_MODE_CPUMODE_MASK'; 1090 1052 if ( ThrdFnVar.ksVariation_64_Addr32 in dByVari 1091 1053 or ThrdFnVar.ksVariation_32_Addr16 in dByVari 1092 1054 or ThrdFnVar.ksVariation_32_Flat in dByVari 1093 1055 or ThrdFnVar.ksVariation_16_Addr32 in dByVari): 1094 sExecMask = '(IEM_F_MODE_CPUMODE_MASK | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK)'; 1095 1056 sSwitchValue = '(pVCpu->iem.s.fExec & (IEM_F_MODE_CPUMODE_MASK | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK))'; 1057 sSwitchValue += ' | (pVCpu->iem.s.enmEffAddrMode == (pVCpu->iem.s.fExec & IEM_F_MODE_CPUMODE_MASK) ? 0 : 8)'; 1058 fSimple = False; 1059 1060 # Generate the case statements. 1061 # pylintx: disable=x 1062 aoCases = []; 1063 if ThreadedFunctionVariation.ksVariation_64_Addr32 in dByVari: 1064 assert not fSimple; 1065 aoCases.extend([ 1066 Case('IEMMODE_64BIT', dByVari[ThrdFnVar.ksVariation_64].emitThreadedCallStmts(8)), 1067 Case('IEMMODE_64BIT | 8', dByVari[ThrdFnVar.ksVariation_64_Addr32].emitThreadedCallStmts(8)), 1068 ]); 1069 elif ThrdFnVar.ksVariation_64 in dByVari: 1070 assert fSimple; 1071 aoCases.append(Case('IEMMODE_64BIT', dByVari[ThrdFnVar.ksVariation_64].emitThreadedCallStmts(8))); 1072 1073 if ThrdFnVar.ksVariation_32_Addr16 in dByVari: 1074 assert not fSimple; 1075 aoCases.extend([ 1076 Case('IEMMODE_32BIT | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK', 1077 dByVari[ThrdFnVar.ksVariation_32_Flat].emitThreadedCallStmts(8)), 1078 Case('IEMMODE_32BIT', 1079 dByVari[ThrdFnVar.ksVariation_32].emitThreadedCallStmts(8)), 1080 Case('IEMMODE_32BIT | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK | 8', 1081 dByVari[ThrdFnVar.ksVariation_32_Addr16].emitThreadedCallStmts(8)), 1082 Case('IEMMODE_32BIT | 8', 1083 dByVari[ThrdFnVar.ksVariation_32_Addr16].emitThreadedCallStmts(8)), 1084 ]); 1085 elif ThrdFnVar.ksVariation_32 in dByVari: 1086 assert fSimple; 1087 aoCases.append(Case('IEMMODE_32BIT', dByVari[ThrdFnVar.ksVariation_32].emitThreadedCallStmts(8))); 1088 1089 if ThrdFnVar.ksVariation_16_Addr32 in dByVari: 1090 assert not fSimple; 1091 aoCases.extend([ 1092 Case('IEMMODE_16BIT', dByVari[ThrdFnVar.ksVariation_16].emitThreadedCallStmts(8)), 1093 Case('IEMMODE_16BIT | 8', dByVari[ThrdFnVar.ksVariation_16_Addr32].emitThreadedCallStmts(8)), 1094 ]); 1095 elif ThrdFnVar.ksVariation_16 in dByVari: 1096 assert fSimple; 1097 aoCases.append(Case('IEMMODE_16BIT', dByVari[ThrdFnVar.ksVariation_16].emitThreadedCallStmts(8))); 1098 1099 if ThrdFnVar.ksVariation_16_Pre386 in dByVari: 1100 aoCases.append(Case('IEMMODE_16BIT | IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK', 1101 dByVari[ThrdFnVar.ksVariation_16_Pre386].emitThreadedCallStmts(8))); 1102 1103 # Generate the switch statement. 1096 1104 aoStmts = [ 1097 iai.McCppGeneric('switch ( pVCpu->iem.s.fExec & %s)' % (sExecMask,)),1105 iai.McCppGeneric('switch (%s)' % (sSwitchValue,)), 1098 1106 iai.McCppGeneric('{'), 1099 1107 ]; … … 1573 1581 """ 1574 1582 # 1575 # File header .1583 # File header and assert assumptions. 1576 1584 # 1577 1585 oOut.write('\n'.join(self.generateLicenseHeader())); 1586 oOut.write('AssertCompile((IEM_F_MODE_X86_FLAT_OR_PRE_386_MASK | IEM_F_MODE_CPUMODE_MASK) == 7);\n'); 1578 1587 1579 1588 #
Note:
See TracChangeset
for help on using the changeset viewer.