Changeset 66906 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- May 16, 2017 9:58:00 AM (8 years ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c
r66901 r66906 197 197 * Set to BS3CG1DST_INVALID if memory or immediate. */ 198 198 uint8_t idxField; 199 /** The base BS3CG1DST value for this field. 200 * Used only by some generalized encoders when dealing with 201 * registers. */ 202 uint8_t idxFieldBase; 199 203 /** Depends on enmLocation. 200 204 * - BS3CG1OPLOC_IMM: offset relative to start of the instruction. … … 2386 2390 2387 2391 2388 static unsigned Bs3Cg1EncodeNext_VEX_MODRM_Vs s_WO_HdqCss_Wss(PBS3CG1STATE pThis, unsigned iEncoding)2392 static unsigned Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_HdqCsomething_Usomething(PBS3CG1STATE pThis, unsigned iEncoding) 2389 2393 { 2390 2394 unsigned off; … … 2395 2399 off = Bs3Cg1InsertOpcodes(pThis, off); 2396 2400 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2397 pThis->aOperands[0].idxField = BS3CG1DST_XMM2;2398 pThis->aOperands[1].idxField = BS3CG1DST_XMM0;2399 pThis->aOperands[2].idxField = BS3CG1DST_XMM1_DW0;2401 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2402 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0; 2403 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2400 2404 break; 2401 2405 case 1: … … 2403 2407 off = Bs3Cg1InsertOpcodes(pThis, off); 2404 2408 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 1); 2405 pThis->aOperands[0].idxField = BS3CG1DST_XMM3;2406 pThis->aOperands[1].idxField = BS3CG1DST_XMM7;2407 pThis->aOperands[2].idxField = BS3CG1DST_XMM1_DW0;2409 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 3; 2410 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 7; 2411 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2408 2412 break; 2409 2413 case 2: … … 2414 2418 off = Bs3Cg1InsertOpcodes(pThis, off); 2415 2419 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2); 2416 pThis->aOperands[0].idxField = BS3CG1DST_XMM11;2417 pThis->aOperands[1].idxField = BS3CG1DST_XMM15;2418 pThis->aOperands[2].idxField = BS3CG1DST_XMM2_DW0;2420 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 11; 2421 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 15; 2422 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 2; 2419 2423 break; 2420 2424 } … … 2425 2429 off = Bs3Cg1InsertOpcodes(pThis, off); 2426 2430 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2427 pThis->aOperands[0].idxField = BS3CG1DST_XMM2;2428 pThis->aOperands[1].idxField = BS3CG1DST_XMM0;2429 pThis->aOperands[2].idxField = BS3CG1DST_XMM1_DW0;2431 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2432 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0; 2433 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2430 2434 break; 2431 2435 case 4: … … 2433 2437 off = Bs3Cg1InsertOpcodes(pThis, off); 2434 2438 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2435 pThis->aOperands[0].idxField = BS3CG1DST_XMM2;2436 pThis->aOperands[1].idxField = BS3CG1DST_XMM0;2437 pThis->aOperands[2].idxField = BS3CG1DST_XMM1_DW0;2439 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2440 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0; 2441 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2438 2442 break; 2439 2443 case 5: … … 2441 2445 off = Bs3Cg1InsertOpcodes(pThis, off); 2442 2446 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2443 pThis->aOperands[0].idxField = BS3CG1DST_XMM2;2444 pThis->aOperands[1].idxField = BS3CG1DST_XMM3;2445 pThis->aOperands[2].idxField = BS3CG1DST_XMM1_DW0;2447 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2448 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 3; 2449 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2446 2450 break; 2447 2451 case 6: … … 2449 2453 off = Bs3Cg1InsertOpcodes(pThis, off); 2450 2454 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2451 pThis->aOperands[0].idxField = BS3CG1DST_XMM2; 2452 pThis->aOperands[1].idxField = BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? BS3CG1DST_XMM15 : BS3CG1DST_XMM7; 2453 pThis->aOperands[2].idxField = BS3CG1DST_XMM1_DW0; 2455 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2456 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7); 2457 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2458 break; 2459 case 7: 2460 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2461 off = Bs3Cg1InsertOpcodes(pThis, off); 2462 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1); 2463 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2464 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7); 2465 pThis->aOperands[2].idxField = pThis->aOperands[2].idxFieldBase + 1; 2454 2466 break; 2455 2467 default: … … 2461 2473 2462 2474 2463 static unsigned Bs3Cg1EncodeNext_VEX_MODRM_Vs sZx_WO_Wss(PBS3CG1STATE pThis, unsigned iEncoding)2475 static unsigned Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_Msomething_Wip_Lig(PBS3CG1STATE pThis, unsigned iEncoding) 2464 2476 { 2465 2477 unsigned off; … … 2469 2481 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/); 2470 2482 off = Bs3Cg1InsertOpcodes(pThis, off); 2471 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 0, 4, 0, BS3CG1OPLOC_MEM);2472 pThis->aOperands[0].idxField = BS3CG1DST_XMM0_DW0;2483 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 0, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2484 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 0; 2473 2485 break; 2474 2486 case 1: 2475 2487 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L - ignored*/, 1 /*~R*/); 2476 2488 off = Bs3Cg1InsertOpcodes(pThis, off); 2477 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 7, 4, 0, BS3CG1OPLOC_MEM);2478 pThis->aOperands[0].idxField = BS3CG1DST_XMM7_DW0;2489 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 7, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2490 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 7; 2479 2491 break; 2480 2492 case 2: … … 2484 2496 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L - ignored*/, 0 /*~R*/); 2485 2497 off = Bs3Cg1InsertOpcodes(pThis, off); 2486 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 7, 4, 0, BS3CG1OPLOC_MEM);2487 pThis->aOperands[0].idxField = BS3CG1DST_XMM15_DW0;2498 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 7, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2499 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 15; 2488 2500 break; 2489 2501 } … … 2494 2506 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, 0 /*L*/, 1 /*~R*/); 2495 2507 off = Bs3Cg1InsertOpcodes(pThis, off); 2496 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 0, 4, 0, BS3CG1OPLOC_MEM);2497 pThis->aOperands[0].idxField = BS3CG1DST_XMM0_DW0;2508 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 0, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2509 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 0; 2498 2510 pThis->fInvalidEncoding = true; 2499 2511 break; … … 2501 2513 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2502 2514 off = Bs3Cg1InsertOpcodes(pThis, off); 2503 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1, 4, 0, BS3CG1OPLOC_MEM);2504 pThis->aOperands[0].idxField = BS3CG1DST_XMM1_DW0;2515 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2516 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 1; 2505 2517 break; 2506 2518 case 5: 2507 2519 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L-ignored*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2508 2520 off = Bs3Cg1InsertOpcodes(pThis, off); 2509 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1, 4, 0, BS3CG1OPLOC_MEM);2510 pThis->aOperands[0].idxField = BS3CG1DST_XMM1_DW0;2521 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2522 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 1; 2511 2523 break; 2512 2524 case 6: 2513 2525 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 1 /*W-ignored*/); 2514 2526 off = Bs3Cg1InsertOpcodes(pThis, off); 2515 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 5, 4, 0, BS3CG1OPLOC_MEM);2516 pThis->aOperands[0].idxField = BS3CG1DST_XMM5_DW0;2527 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 5, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2528 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 5; 2517 2529 break; 2518 2530 case 7: … … 2522 2534 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2523 2535 off = Bs3Cg1InsertOpcodes(pThis, off); 2524 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 5, 4, 0, BS3CG1OPLOC_MEM);2525 pThis->aOperands[0].idxField = BS3CG1DST_XMM13_DW0;2536 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 5, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2537 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 13; 2526 2538 break; 2527 2539 } … … 2534 2546 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 0 /*~B-ignored*/, 0 /*W*/); 2535 2547 off = Bs3Cg1InsertOpcodes(pThis, off); 2536 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1, 4, 0, BS3CG1OPLOC_MEM);2537 pThis->aOperands[0].idxField = BS3CG1DST_XMM1_DW0;2548 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 1, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2549 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 1; 2538 2550 break; 2539 2551 } … … 2546 2558 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 0 /*~X-ignored*/, 1 /*~B*/, 0 /*W*/); 2547 2559 off = Bs3Cg1InsertOpcodes(pThis, off); 2548 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2, 4, 0, BS3CG1OPLOC_MEM);2549 pThis->aOperands[0].idxField = BS3CG1DST_XMM2_DW0;2560 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2561 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 2; 2550 2562 break; 2551 2563 } … … 2556 2568 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/); 2557 2569 off = Bs3Cg1InsertOpcodes(pThis, off); 2558 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 5, 4, 0, BS3CG1OPLOC_MEM);2559 pThis->aOperands[0].idxField = BS3CG1DST_XMM5_DW0;2570 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 5, pThis->aOperands[1].cbOp, 0, BS3CG1OPLOC_MEM); 2571 pThis->aOperands[0].idxField = pThis->aOperands[0].idxFieldBase + 5; 2560 2572 pThis->fInvalidEncoding = true; 2561 2573 break; … … 2763 2775 return Bs3Cg1EncodeNext_VEX_MODRM_Vps_WO_Wps__OR__VEX_MODRM_Vpd_WO_Wpd(pThis, iEncoding); 2764 2776 2765 case BS3CG1ENC_VEX_MODRM_Vss_WO_HdqCss_Wss: 2766 return Bs3Cg1EncodeNext_VEX_MODRM_Vss_WO_HdqCss_Wss(pThis, iEncoding); 2767 2777 case BS3CG1ENC_VEX_MODRM_Vss_WO_HdqCss_Uss: 2778 case BS3CG1ENC_VEX_MODRM_Vsd_WO_HdqCsd_Usd: 2779 return Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_HdqCsomething_Usomething(pThis, iEncoding); 2780 2781 case BS3CG1ENC_VEX_MODRM_VsdZx_WO_Mq: 2768 2782 case BS3CG1ENC_VEX_MODRM_VssZx_WO_Wss: 2769 return Bs3Cg1EncodeNext_VEX_MODRM_Vs sZx_WO_Wss(pThis, iEncoding);2783 return Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_Msomething_Wip_Lig(pThis, iEncoding); 2770 2784 2771 2785 case BS3CG1ENC_VEX_MODRM_Md_WO: … … 3019 3033 pThis->aOperands[0].cbOp = 4; 3020 3034 pThis->aOperands[1].cbOp = 4; 3021 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3022 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_MEM; 3035 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3036 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_MEM; 3037 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0_DW0; 3038 pThis->aOperands[1].idxFieldBase = BS3CG1DST_INVALID; 3023 3039 break; 3024 3040 3025 case BS3CG1ENC_VEX_MODRM_Vss_WO_HdqCss_ Wss:3041 case BS3CG1ENC_VEX_MODRM_Vss_WO_HdqCss_Uss: 3026 3042 pThis->iRegOp = 0; 3027 3043 pThis->iRmOp = 2; … … 3029 3045 pThis->aOperands[1].cbOp = 16; 3030 3046 pThis->aOperands[2].cbOp = 4; 3031 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3032 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 3033 pThis->aOperands[2].enmLocation = BS3CG1OPLOC_CTX; 3047 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3048 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 3049 pThis->aOperands[2].enmLocation = BS3CG1OPLOC_CTX; 3050 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0; 3051 pThis->aOperands[1].idxFieldBase = BS3CG1DST_XMM0; 3052 pThis->aOperands[2].idxFieldBase = BS3CG1DST_XMM0_DW0; 3053 break; 3054 3055 case BS3CG1ENC_VEX_MODRM_VsdZx_WO_Mq: 3056 pThis->iRmOp = 1; 3057 pThis->iRegOp = 0; 3058 pThis->aOperands[0].cbOp = 8; 3059 pThis->aOperands[1].cbOp = 8; 3060 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3061 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_MEM; 3062 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0_LO; 3063 pThis->aOperands[1].idxFieldBase = BS3CG1DST_INVALID; 3064 break; 3065 3066 case BS3CG1ENC_VEX_MODRM_Vsd_WO_HdqCsd_Usd: 3067 pThis->iRegOp = 0; 3068 pThis->iRmOp = 2; 3069 pThis->aOperands[0].cbOp = 16; 3070 pThis->aOperands[1].cbOp = 16; 3071 pThis->aOperands[2].cbOp = 8; 3072 pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX_ZX_VLMAX; 3073 pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX; 3074 pThis->aOperands[2].enmLocation = BS3CG1OPLOC_CTX; 3075 pThis->aOperands[0].idxFieldBase = BS3CG1DST_XMM0; 3076 pThis->aOperands[1].idxFieldBase = BS3CG1DST_XMM0; 3077 pThis->aOperands[2].idxFieldBase = BS3CG1DST_XMM0_LO; 3034 3078 break; 3035 3079 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h
r66901 r66906 62 62 BS3CG1OP_Gv_RO, 63 63 BS3CG1OP_HdqCss, 64 BS3CG1OP_HdqCsd, 64 65 BS3CG1OP_Nq, 65 66 BS3CG1OP_Pq_WO, 66 67 BS3CG1OP_Uq, 67 68 BS3CG1OP_UqHi, 69 BS3CG1OP_Uss, 70 BS3CG1OP_Usd, 68 71 BS3CG1OP_Vss, 69 72 BS3CG1OP_Vss_WO, … … 144 147 BS3CG1ENC_VEX_MODRM_Vps_WO_Wps, 145 148 BS3CG1ENC_VEX_MODRM_Vpd_WO_Wpd, 146 BS3CG1ENC_VEX_MODRM_Vss_WO_HdqCss_ Wss,149 BS3CG1ENC_VEX_MODRM_Vss_WO_HdqCss_Uss, 147 150 BS3CG1ENC_VEX_MODRM_VssZx_WO_Wss, 151 BS3CG1ENC_VEX_MODRM_Vsd_WO_HdqCsd_Usd, 152 BS3CG1ENC_VEX_MODRM_VsdZx_WO_Mq, 148 153 BS3CG1ENC_VEX_MODRM_Md_WO, 149 154
Note:
See TracChangeset
for help on using the changeset viewer.