Changeset 66286 in vbox
- Timestamp:
- Mar 28, 2017 10:17:15 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114211
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py
r66283 r66286 312 312 if oInstr.sPrefix: 313 313 if oInstr.sPrefix == 'none': 314 self.sPfxKind = 'BS3CG PFXKIND_NO_F2_F3_66';314 self.sPfxKind = 'BS3CG1PFXKIND_NO_F2_F3_66'; 315 315 else: 316 self.sPfxKind = 'BS3CG PFXKIND_REQ_' + oInstr.sPrefix[-2:].upper();316 self.sPfxKind = 'BS3CG1PFXKIND_REQ_' + oInstr.sPrefix[-2:].upper(); 317 317 elif oInstr.sEncoding == 'ModR/M': 318 318 if 'ignores_op_size' not in oInstr.dHints: 319 self.sPfxKind = 'BS3CG PFXKIND_MODRM';319 self.sPfxKind = 'BS3CG1PFXKIND_MODRM'; 320 320 else: 321 self.sPfxKind = 'BS3CG PFXKIND_MODRM_NO_OP_SIZES';321 self.sPfxKind = 'BS3CG1PFXKIND_MODRM_NO_OP_SIZES'; 322 322 else: 323 323 self.sPfxKind = '0'; … … 332 332 self.sCpu += 'ANY'; 333 333 334 if oInstr.sXcptType: 335 self.sXcptType = 'BS3CG1XCPTTYPE_' + oInstr.sXcptType.upper(); 336 else: 337 self.sXcptType = 'BS3CG1XCPTTYPE_NONE'; 334 338 335 339 def getOperands(self): … … 348 352 ' /* enmPrefixKind = */ (unsigned)%s,' % (self.sPfxKind,), 349 353 ' /* enmCpuTest = */ (unsigned)%s,' % (self.sCpu,), 354 ' /* enmXcptType = */ (unsigned)%s,' % (self.sXcptType,), 350 355 ' /* uUnused = */ 0,', 351 356 ' /* fFlags = */ %s' % (' | '.join(self.asFlags) if self.asFlags else '0'), -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66283 r66286 123 123 BS3CG1CPU enmCpuTest; 124 124 /** Prefix sensitivity and requirements. */ 125 BS3CGPFXKIND enmPrefixKind; 125 BS3CG1PFXKIND enmPrefixKind; 126 /** Exception type (SSE, AVX). */ 127 BS3CG1XCPTTYPE enmXcptType; 126 128 /** Per operand flags. */ 127 129 BS3CG1OP aenmOperands[4]; … … 224 226 uint8_t bValueXcpt; 225 227 /** @} */ 228 /** Alignment exception expected by the encoder. 229 * UINT8_MAX if no special exception expected. */ 230 uint8_t bAlignmentXcpt; 226 231 227 232 /** The context we're working on. */ … … 918 923 }; 919 924 920 static const uint16_t g_afPfxKindToIgnoredFlags[BS3CG PFXKIND_END] =925 static const uint16_t g_afPfxKindToIgnoredFlags[BS3CG1PFXKIND_END] = 921 926 { 922 /* [BS3CG PFXKIND_INVALID] = */ UINT16_MAX,923 /* [BS3CG PFXKIND_MODRM] = */ 0,924 /* [BS3CG PFXKIND_MODRM_NO_OP_SIZES] = */ BS3CG1_PF_OZ | BS3CG1_PF_W,927 /* [BS3CG1PFXKIND_INVALID] = */ UINT16_MAX, 928 /* [BS3CG1PFXKIND_MODRM] = */ 0, 929 /* [BS3CG1PFXKIND_MODRM_NO_OP_SIZES] = */ BS3CG1_PF_OZ | BS3CG1_PF_W, 925 930 }; 926 931 927 932 #endif 933 934 935 /** 936 * Checks if >= 16 byte SSE/AVX alignment are exempted for the exception type. 937 * 938 * @returns true / false. 939 * @param enmXcptType The type to check. 940 */ 941 static bool Bs3Cg1XcptTypeIsUnaligned(BS3CG1XCPTTYPE enmXcptType) 942 { 943 switch (enmXcptType) 944 { 945 case BS3CG1XCPTTYPE_4UA: 946 case BS3CG1XCPTTYPE_5: 947 return true; 948 default: 949 return false; 950 } 951 } 928 952 929 953 … … 932 956 switch (pThis->enmPrefixKind) 933 957 { 934 case BS3CG PFXKIND_REQ_66:958 case BS3CG1PFXKIND_REQ_66: 935 959 pThis->abCurInstr[offDst] = 0x66; 936 960 break; 937 case BS3CG PFXKIND_REQ_F2:961 case BS3CG1PFXKIND_REQ_F2: 938 962 pThis->abCurInstr[offDst] = 0xf2; 939 963 break; 940 case BS3CG PFXKIND_REQ_F3:964 case BS3CG1PFXKIND_REQ_F3: 941 965 pThis->abCurInstr[offDst] = 0xf3; 942 966 break; … … 1053 1077 unsigned off; 1054 1078 unsigned cbOp; 1079 1080 pThis->bAlignmentXcpt = UINT8_MAX; 1081 1055 1082 switch (pThis->enmEncoding) 1056 1083 { … … 1227 1254 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 16, 0, BS3CG1OPLOC_MEM_RW); 1228 1255 } 1229 //else if (iEncoding == 2) 1230 //{ 1231 // pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3; 1232 // off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1233 // off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 1 /*cbMissalign*/, BS3CG1OPLOC_MEM_RW); 1234 //} 1256 else if (iEncoding == 2) 1257 { 1258 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3; 1259 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 1260 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 1 /*cbMissalign*/, BS3CG1OPLOC_MEM_RW); 1261 if (!Bs3Cg1XcptTypeIsUnaligned(pThis->enmXcptType)) 1262 pThis->bAlignmentXcpt = X86_XCPT_GP; 1263 } 1235 1264 else 1236 1265 break; … … 2184 2213 if (!fInvalidInstr) 2185 2214 { 2186 bExpectedXcpt = pThis->bValueXcpt; 2215 bExpectedXcpt = pThis->bAlignmentXcpt; 2216 if (bExpectedXcpt == UINT8_MAX) 2217 bExpectedXcpt = pThis->bValueXcpt; 2187 2218 if (bExpectedXcpt == UINT8_MAX) 2188 2219 { … … 2706 2737 pThis->enmEncoding = (BS3CG1ENC)pInstr->enmEncoding; 2707 2738 pThis->enmCpuTest = (BS3CG1CPU)pInstr->enmCpuTest; 2708 pThis->enmPrefixKind = (BS3CG1CPU)pInstr->enmPrefixKind; 2739 pThis->enmPrefixKind = (BS3CG1PFXKIND)pInstr->enmPrefixKind; 2740 pThis->enmXcptType = (BS3CG1XCPTTYPE)pInstr->enmXcptType; 2709 2741 pThis->cchMnemonic = pInstr->cchMnemonic; 2710 2742 if (pThis->fAdvanceMnemonic) -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66283 r66286 96 96 * Prefix sensitivitiy kind. 97 97 */ 98 typedef enum BS3CG PFXKIND99 { 100 BS3CG PFXKIND_INVALID = 0,101 102 BS3CG PFXKIND_NO_F2_F3_66, /**< No 66, F2 or F3 prefixes allowed as that would alter the meaning. */103 BS3CG PFXKIND_REQ_F2, /**< Requires F2 (REPNE) prefix as part of the instr encoding. */104 BS3CG PFXKIND_REQ_F3, /**< Requires F3 (REPE) prefix as part of the instr encoding. */105 BS3CG PFXKIND_REQ_66, /**< Requires 66 (OP SIZE) prefix as part of the instr encoding. */98 typedef enum BS3CG1PFXKIND 99 { 100 BS3CG1PFXKIND_INVALID = 0, 101 102 BS3CG1PFXKIND_NO_F2_F3_66, /**< No 66, F2 or F3 prefixes allowed as that would alter the meaning. */ 103 BS3CG1PFXKIND_REQ_F2, /**< Requires F2 (REPNE) prefix as part of the instr encoding. */ 104 BS3CG1PFXKIND_REQ_F3, /**< Requires F3 (REPE) prefix as part of the instr encoding. */ 105 BS3CG1PFXKIND_REQ_66, /**< Requires 66 (OP SIZE) prefix as part of the instr encoding. */ 106 106 107 107 /** @todo more work to be done here... */ 108 BS3CG PFXKIND_MODRM,109 BS3CG PFXKIND_MODRM_NO_OP_SIZES,110 111 BS3CG PFXKIND_END112 } BS3CG PFXKIND;108 BS3CG1PFXKIND_MODRM, 109 BS3CG1PFXKIND_MODRM_NO_OP_SIZES, 110 111 BS3CG1PFXKIND_END 112 } BS3CG1PFXKIND; 113 113 114 114 /** … … 132 132 BS3CG1CPU_END 133 133 } BS3CG1CPU; 134 135 136 /** 137 * SSE & AVX exception types. 138 */ 139 typedef enum BS3CG1XCPTTYPE 140 { 141 BS3CG1XCPTTYPE_NONE = 0, 142 /* SSE: */ 143 BS3CG1XCPTTYPE_1, 144 BS3CG1XCPTTYPE_2, 145 BS3CG1XCPTTYPE_3, 146 BS3CG1XCPTTYPE_4, 147 BS3CG1XCPTTYPE_4UA, 148 BS3CG1XCPTTYPE_5, 149 BS3CG1XCPTTYPE_6, 150 BS3CG1XCPTTYPE_7, 151 BS3CG1XCPTTYPE_8, 152 BS3CG1XCPTTYPE_11, 153 BS3CG1XCPTTYPE_12, 154 /* EVEX: */ 155 BS3CG1XCPTTYPE_E1, 156 BS3CG1XCPTTYPE_E1NF, 157 BS3CG1XCPTTYPE_E2, 158 BS3CG1XCPTTYPE_E3, 159 BS3CG1XCPTTYPE_E3NF, 160 BS3CG1XCPTTYPE_E4, 161 BS3CG1XCPTTYPE_E4NF, 162 BS3CG1XCPTTYPE_E5, 163 BS3CG1XCPTTYPE_E5NF, 164 BS3CG1XCPTTYPE_E6, 165 BS3CG1XCPTTYPE_E6NF, 166 BS3CG1XCPTTYPE_E7NF, 167 BS3CG1XCPTTYPE_E9, 168 BS3CG1XCPTTYPE_E9NF, 169 BS3CG1XCPTTYPE_E10, 170 BS3CG1XCPTTYPE_E11, 171 BS3CG1XCPTTYPE_E12, 172 BS3CG1XCPTTYPE_E12NF, 173 BS3CG1XCPTTYPE_END 174 } BS3CG1XCPTTYPE; 175 AssertCompile(BS3CG1XCPTTYPE_END <= 32); 176 134 177 135 178 /** … … 150 193 /** BS3CG1ENC values. */ 151 194 uint32_t enmEncoding : 10; 152 /** BS3CG PFXKIND values. */195 /** BS3CG1PFXKIND values. */ 153 196 uint32_t enmPrefixKind : 4; 154 197 /** CPU test / CPU ID bit test (BS3CG1CPU). */ 155 198 uint32_t enmCpuTest : 6; 199 /** Exception type (BS3CG1XCPTTYPE) */ 200 uint32_t enmXcptType : 5; 156 201 /** Currently unused bits. */ 157 uint32_t uUnused : 12;202 uint32_t uUnused : 7; 158 203 /** BS3CG1INSTR_F_XXX. */ 159 204 uint32_t fFlags;
Note:
See TracChangeset
for help on using the changeset viewer.