Changeset 66935 in vbox for trunk/src/VBox/ValidationKit/bootsectors
- Timestamp:
- May 17, 2017 12:09:30 PM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py
r66810 r66935 302 302 self.asOpcodes = oMap.asLeadOpcodes + [ '0x%02x' % (oInstr.getOpcodeByte(),) ]; 303 303 self.sEncoding = iai.g_kdEncodings[oInstr.sEncoding][0]; 304 304 305 for oOp in oInstr.aoOperands: 305 306 self.sEncoding += '_' + oOp.sType; 306 307 if oInstr.fUnused: 308 print('DEBUG: Unused Bs3Cg1Instruction: %s\n' % (oInstr.sEncoding,)); 307 309 if oInstr.sInvalidStyle == 'immediate' and oInstr.sSubOpcode: 308 310 self.sEncoding += '_MOD_EQ_3' if oInstr.sSubOpcode == '11 mr/reg' else '_MOD_NE_3'; -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66932 r66935 2062 2062 off = Bs3Cg1InsertReqPrefix(pThis, 0); 2063 2063 off = Bs3Cg1InsertOpcodes(pThis, off); 2064 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 0, iEncoding );2064 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 0, iEncoding & 7); 2065 2065 } 2066 2066 else … … 3143 3143 } 3144 3144 3145 3146 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_VEX_MODRM_MOD_EQ_3(PBS3CG1STATE pThis, unsigned iEncoding) 3147 { 3148 unsigned off; 3149 if (iEncoding < 8) 3150 { 3151 if (iEncoding & 1) 3152 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 3153 else 3154 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3155 off = Bs3Cg1InsertOpcodes(pThis, off); 3156 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, iEncoding, 1); 3157 } 3158 else if (iEncoding < 16) 3159 { 3160 if (iEncoding & 1) 3161 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/); 3162 else 3163 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3164 off = Bs3Cg1InsertOpcodes(pThis, off); 3165 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, iEncoding & 7, 1); 3166 } 3167 else if (iEncoding < 24) 3168 { 3169 if (iEncoding & 1) 3170 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 3171 else 3172 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 3173 off = Bs3Cg1InsertOpcodes(pThis, off); 3174 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 0, iEncoding & 7); 3175 } 3176 else if (iEncoding < 32) 3177 { 3178 if (iEncoding & 1) 3179 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, (iEncoding & 3) != 0 /*L*/, 1 /*~R*/); 3180 else 3181 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, (iEncoding & 2) != 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 3182 1 /*~B*/, (iEncoding & 4) != 0 /*W*/); 3183 off = Bs3Cg1InsertOpcodes(pThis, off); 3184 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 0, iEncoding & 7); 3185 } 3186 else 3187 return 0; 3188 pThis->cbCurInstr = off; 3189 3190 return iEncoding + 1; 3191 } 3192 3193 3194 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_VEX_MODRM_MOD_NE_3(PBS3CG1STATE pThis, unsigned iEncoding) 3195 { 3196 unsigned off; 3197 if (iEncoding < 8) 3198 { 3199 unsigned iMod = iEncoding % 3; 3200 if (iEncoding & 1) 3201 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, (iEncoding & 2) != 0 /*L*/, 1 /*~R*/); 3202 else 3203 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, (iEncoding & 2) != 0 /*L*/, 1 /*~R*/, 3204 1 /*~X*/, 1 /*~B*/, (iEncoding & 4) != 0 /*W*/); 3205 off = Bs3Cg1InsertOpcodes(pThis, off); 3206 pThis->abCurInstr[off++] = X86_MODRM_MAKE(iMod, 0, 1); 3207 if (iMod >= 1) 3208 pThis->abCurInstr[off++] = 0x7f; 3209 if (iMod == 2) 3210 { 3211 pThis->abCurInstr[off++] = 0x5f; 3212 if (!BS3_MODE_IS_16BIT_CODE(pThis->bMode)) 3213 { 3214 pThis->abCurInstr[off++] = 0x3f; 3215 pThis->abCurInstr[off++] = 0x1f; 3216 } 3217 } 3218 } 3219 else 3220 return 0; 3221 pThis->cbCurInstr = off; 3222 return iEncoding + 1; 3223 } 3224 3145 3225 #endif /* BS3CG1_WITH_VEX */ 3146 3226 … … 3227 3307 return Bs3Cg1EncodeNext_FIXED_rAX_Iz(pThis, iEncoding); 3228 3308 3229 case BS3CG1ENC_MODRM_MOD_EQ_3:3230 return Bs3Cg1EncodeNext_MODRM_MOD_EQ_3(pThis, iEncoding);3231 case BS3CG1ENC_MODRM_MOD_NE_3:3232 return Bs3Cg1EncodeNext_MODRM_MOD_NE_3(pThis, iEncoding);3233 3234 3309 /* 3235 3310 * VEX stuff … … 3468 3543 break; 3469 3544 3545 /* Unused or invalid instructions mostly. */ 3470 3546 case BS3CG1ENC_MODRM_MOD_EQ_3: 3547 pThis->pfnEncoder = Bs3Cg1EncodeNext_MODRM_MOD_EQ_3; 3548 break; 3471 3549 case BS3CG1ENC_MODRM_MOD_NE_3: 3472 /* Unused or invalid instructions mostly. */3550 pThis->pfnEncoder = Bs3Cg1EncodeNext_MODRM_MOD_NE_3; 3473 3551 break; 3474 3552 … … 3570 3648 break; 3571 3649 3650 case BS3CG1ENC_VEX_MODRM_Vq_WO_HqHi_Mq: 3651 pThis->pfnEncoder = Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_Hsomething_Msomething_Wip_OR_ViceVersa; 3652 pThis->iRegOp = 0; 3653 pThis->iRmOp = 2; 3654 pThis->aOperands[0].cbOp = 16; 3655 pThis->aOperands[1].cbOp = 8; 3656 pThis->aOperands[2].cbOp = 8; 3657 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3658 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 3659 pThis->aOperands[2].enmLocation = BS3CG1OPLOC_MEM; 3660 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0; 3661 pThis->aOperands[1].idxFieldBase = BS3CG1DST_XMM0_HI; 3662 pThis->aOperands[2].idxFieldBase = BS3CG1DST_INVALID; 3663 break; 3664 3572 3665 case BS3CG1ENC_VEX_MODRM_Md_WO_Vss: 3573 3666 pThis->pfnEncoder = Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_Msomething_Wip_Lig_OR_ViceVersa; … … 3637 3730 break; 3638 3731 3732 3733 /* Unused or invalid instructions mostly. */ 3734 case BS3CG1ENC_VEX_MODRM_MOD_EQ_3: 3735 pThis->pfnEncoder = Bs3Cg1EncodeNext_VEX_MODRM_MOD_EQ_3; 3736 break; 3737 case BS3CG1ENC_VEX_MODRM_MOD_NE_3: 3738 pThis->pfnEncoder = Bs3Cg1EncodeNext_VEX_MODRM_MOD_NE_3; 3739 break; 3639 3740 3640 3741 #endif /* BS3CG1_WITH_VEX */ … … 4179 4280 /* FPU and FXSAVE format. */ 4180 4281 else if ( pThis->pExtCtx->enmMethod != BS3EXTCTXMETHOD_ANCIENT 4181 && offField - sizeof(BS3REGCTX) < = RT_UOFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[15]))4282 && offField - sizeof(BS3REGCTX) < RT_UOFFSET_AFTER(BS3EXTCTX, Ctx.x87.aXMM[15])) 4182 4283 { 4183 4284 if (!pThis->fWorkExtCtx) -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66932 r66935 64 64 BS3CG1OP_HdqCsd, 65 65 BS3CG1OP_HdqCq, 66 BS3CG1OP_HqHi, 66 67 BS3CG1OP_Nq, 67 68 BS3CG1OP_Pq_WO, … … 155 156 BS3CG1ENC_VEX_MODRM_Vq_WO_HdqCq_UqHi, 156 157 BS3CG1ENC_VEX_MODRM_Vq_WO_HdqCq_Mq, 158 BS3CG1ENC_VEX_MODRM_Vq_WO_HqHi_Mq, 157 159 BS3CG1ENC_VEX_MODRM_VssZx_WO_Md, 158 160 BS3CG1ENC_VEX_MODRM_VsdZx_WO_Mq, … … 169 171 BS3CG1ENC_FIXED_rAX_Iz, 170 172 173 171 174 BS3CG1ENC_MODRM_MOD_EQ_3, /**< Unused or invalid instruction. */ 172 175 BS3CG1ENC_MODRM_MOD_NE_3, /**< Unused or invalid instruction. */ 176 BS3CG1ENC_VEX_MODRM_MOD_EQ_3, /**< Unused or invalid instruction. */ 177 BS3CG1ENC_VEX_MODRM_MOD_NE_3, /**< Unused or invalid instruction. */ 173 178 174 179 BS3CG1ENC_END
Note:
See TracChangeset
for help on using the changeset viewer.