Changeset 67082 in vbox for trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
- Timestamp:
- May 25, 2017 10:39:07 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r67081 r67082 2233 2233 2234 2234 2235 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_VsdZx_WO_Wsd__OR__MODRM_VqZx_WO_Wq(PBS3CG1STATE pThis, 2236 unsigned iEncoding) 2235 static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_Vsomething_Wsomething_OR_ViceVersa(PBS3CG1STATE pThis, unsigned iEncoding) 2237 2236 { 2238 2237 unsigned off; 2239 if (iEncoding == 0)2240 { 2241 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));2242 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);2243 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0_LO;2244 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1_LO_ZX;2245 }2246 else if (iEncoding == 1)2247 {2248 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2_LO_ZX;2249 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));2250 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 8, 0, BS3CG1OPLOC_MEM);2251 }2252 else if (iEncoding == 2)2253 {2254 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3_LO_ZX;2255 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));2256 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 8, 1 /*cbMisalign*/, BS3CG1OPLOC_MEM);2257 }2258 else2259 return 0;2238 switch (iEncoding) 2239 { 2240 case 0: 2241 pThis->aOperands[pThis->iRmOp].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationReg; 2242 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 2243 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0); 2244 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 0; 2245 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 1; 2246 break; 2247 case 1: 2248 pThis->aOperands[pThis->iRmOp].enmLocation = pThis->aOperands[pThis->iRmOp].enmLocationMem; 2249 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 2250 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, off, 2 /*iReg*/); 2251 break; 2252 case 2: 2253 off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0)); 2254 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaultsMisaligned(pThis, off, 3 /*iReg*/, 1 /*cbMisalign*/); 2255 break; 2256 default: 2257 return 0; 2258 } 2260 2259 pThis->cbCurInstr = off; 2261 2260 return iEncoding + 1; … … 2279 2278 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 7; 2280 2279 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6; 2281 break; 2280 iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0; 2281 break; 2282 case 2: 2283 off = Bs3Cg1InsertReqPrefix(pThis, 0); 2284 pThis->abCurInstr[off++] = REX_WRBX; 2285 off = Bs3Cg1InsertOpcodes(pThis, off); 2286 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 6, 7); 2287 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 7; /* no +8 here */ 2288 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 6 + 8; 2289 break; 2290 2282 2291 default: 2283 2292 return 0; … … 3956 3965 case BS3CG1ENC_MODRM_VssZx_WO_Wss: 3957 3966 return Bs3Cg1EncodeNext_MODRM_VssZx_WO_Wss(pThis, iEncoding); 3958 case BS3CG1ENC_MODRM_VsdZx_WO_Wsd:3959 case BS3CG1ENC_MODRM_VqZx_WO_Wq:3960 return Bs3Cg1EncodeNext_MODRM_VsdZx_WO_Wsd__OR__MODRM_VqZx_WO_Wq(pThis, iEncoding);3961 3967 3962 3968 case BS3CG1ENC_FIXED: … … 4308 4314 case BS3CG1ENC_MODRM_VsdZx_WO_Wsd: 4309 4315 case BS3CG1ENC_MODRM_VqZx_WO_Wq: 4316 pThis->pfnEncoder = Bs3Cg1EncodeNext_MODRM_Vsomething_Wsomething_OR_ViceVersa; 4317 pThis->iRegOp = 0; 4310 4318 pThis->iRmOp = 1; 4311 pThis->iRegOp = 0;4312 4319 pThis->aOperands[0].cbOp = 8; 4313 4320 pThis->aOperands[1].cbOp = 8; 4314 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX; 4315 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 4321 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX; 4322 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 4323 pThis->aOperands[1].enmLocationReg = BS3CG1OPLOC_CTX; 4324 pThis->aOperands[1].enmLocationMem = BS3CG1OPLOC_MEM; 4325 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0_LO_ZX; 4326 pThis->aOperands[1].idxFieldBase = BS3CG1DST_XMM0_LO; 4316 4327 break; 4317 4328
Note:
See TracChangeset
for help on using the changeset viewer.