VirtualBox

vbox的更動 66991 路徑 trunk/src/VBox/ValidationKit


忽略:
時間撮記:
2017-5-19 下午10:01:15 (8 年 以前)
作者:
vboxsync
訊息:

IEM: Docs and test for movntps & movntpd.

位置:
trunk/src/VBox/ValidationKit/bootsectors
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c

    r66976 r66991  
    8484#endif
    8585
     86/**
     87 * Checks if this is a 64-bit test target or not.
     88 * Helps avoid ifdefs or code bloat.
     89 */
     90#if ARCH_BITS == 64
     91# define BS3CG1_IS_64BIT_TARGET(a_pThis)    BS3_MODE_IS_64BIT_CODE((a_pThis)->bMode)
     92#else
     93# define BS3CG1_IS_64BIT_TARGET(a_pThis)    (false)
     94#endif
    8695
    8796
     
    13271336        *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - cbOp - cbMissalign;
    13281337
     1338#if ARCH_BITS == 64
    13291339        /* In 64-bit mode we always have a rip relative encoding regardless of fAddrOverride. */
    1330         if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     1340        if (BS3CG1_IS_64BIT_TARGET(pThis))
    13311341            *(uint32_t *)&pThis->abCurInstr[off] -= BS3_FP_OFF(&pThis->pbCodePg[X86_PAGE_SIZE]);
     1342#endif
    13321343        off += 4;
    13331344    }
     
    15031514                                       pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_WO);
    15041515    }
    1505     else if (iEncoding == 6 && BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     1516    else if (iEncoding == 6 && BS3CG1_IS_64BIT_TARGET(pThis))
    15061517    {
    15071518        cbOp = 8;
     
    20372048    else
    20382049        return 0;
     2050    pThis->cbCurInstr = off;
     2051    return iEncoding + 1;
     2052}
     2053
     2054
     2055static unsigned BS3_NEAR_CODE Bs3Cg1EncodeNext_MODRM_MsomethingWO_Vsomething(PBS3CG1STATE pThis, unsigned iEncoding)
     2056{
     2057    unsigned off;
     2058    switch (iEncoding)
     2059    {
     2060        case 0:
     2061            off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     2062            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2 /*iReg*/, 0);
     2063            break;
     2064        case 1:
     2065            off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     2066            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2 /*iReg*/, 1 /*cbMissalign*/ );
     2067            if (!Bs3Cg1XcptTypeIsUnaligned(pThis->enmXcptType))
     2068                pThis->bAlignmentXcpt = X86_XCPT_GP;
     2069            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0;
     2070            break;
     2071        case 2:
     2072            off = Bs3Cg1InsertReqPrefix(pThis, 0);
     2073            pThis->abCurInstr[off++] = REX__R__;
     2074            off = Bs3Cg1InsertOpcodes(pThis, off);
     2075            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2+8 /*iReg*/, 0);
     2076            break;
     2077        default:
     2078            return 0;
     2079    }
    20392080    pThis->cbCurInstr = off;
    20402081    return iEncoding + 1;
     
    21182159        }
    21192160    }
    2120     else if (iEncoding == 2 && BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     2161    else if (iEncoding == 2 && BS3CG1_IS_64BIT_TARGET(pThis))
    21212162    {
    21222163        off = Bs3Cg1InsertReqPrefix(pThis, 0);
     
    24872528#if ARCH_BITS == 64
    24882529    /* 64-bit mode registers */
    2489     else if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     2530    else if (BS3CG1_IS_64BIT_TARGET(pThis))
    24902531    {
    24912532        if (iEncoding == 24)
     
    25412582            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + 7;
    25422583            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1;
     2584            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0;
    25432585            break;
    25442586        case 2:
    25452587#if ARCH_BITS == 64
    2546             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2547             {
    2548                 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 0 /*~R*/);
    2549                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2550                 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2);
    2551                 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11;
    2552                 pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + 15;
    2553                 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2;
    2554                 break;
    2555             }
     2588            off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 0 /*~R*/);
     2589            off = Bs3Cg1InsertOpcodes(pThis, off);
     2590            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2);
     2591            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11;
     2592            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + 15;
     2593            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2;
     2594            break;
    25562595#endif
    2557             /* fall thru */
    25582596        case 3:
    25592597            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
     
    25852623            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1);
    25862624            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2;
    2587             pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7);
     2625            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7);
    25882626            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1;
    25892627            break;
     
    25932631            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1);
    25942632            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2;
    2595             pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7);
     2633            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7);
    25962634            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1;
    25972635            break;
     
    26292667            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1;
    26302668            pThis->fInvalidEncoding = true;
     2669            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0;
    26312670            break;
    26322671        case 2:
    26332672#if ARCH_BITS == 64
    2634             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2635             {
    2636                 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 0 /*~R*/);
    2637                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2638                 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2);
    2639                 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11;
    2640                 pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + 15;
    2641                 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2;
    2642                 break;
    2643             }
     2673            off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 0 /*~R*/);
     2674            off = Bs3Cg1InsertOpcodes(pThis, off);
     2675            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 2);
     2676            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11;
     2677            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + 15;
     2678            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 2;
     2679            break;
    26442680#endif
    2645             /* fall thru */
    26462681        case 3:
    26472682            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
     
    26742709            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1);
    26752710            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2;
    2676             pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7);
     2711            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7);
    26772712            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1;
    26782713            break;
     
    26822717            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 1);
    26832718            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 2;
    2684             pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7);
     2719            pThis->aOperands[1            ].idxField = pThis->aOperands[1            ].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7);
    26852720            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 1;
    26862721            break;
     
    27122747            off = Bs3Cg1InsertOpcodes(pThis, off);
    27132748            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 7, 0);
    2714             break;
     2749            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0;
     2750            break;
     2751#if ARCH_BITS == 64
    27152752        case 2:
    2716 #if ARCH_BITS == 64
    2717             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2718             {
    2719                 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L - ignored*/, 0 /*~R*/);
    2720                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2721                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 7 + 8, 0);
    2722                 break;
    2723             }
     2753            off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L - ignored*/, 0 /*~R*/);
     2754            off = Bs3Cg1InsertOpcodes(pThis, off);
     2755            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 7 + 8, 0);
     2756            break;
    27242757#endif
    2725             /* fall thru */
    27262758        case 3:
    27272759            iEncoding = 3;
     
    27452777            off = Bs3Cg1InsertOpcodes(pThis, off);
    27462778            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5, 0);
    2747             break;
     2779            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 3 : 0;
     2780            break;
     2781#if ARCH_BITS == 64
    27482782        case 7:
    2749 #if ARCH_BITS == 64
    2750             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2751             {
    2752                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
    2753                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2754                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5+8, 0);
    2755                 break;
    2756             }
     2783            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
     2784            off = Bs3Cg1InsertOpcodes(pThis, off);
     2785            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5+8, 0);
     2786            break;
     2787        case 8:
     2788            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 0 /*~B-ignored*/, 0 /*W*/);
     2789            off = Bs3Cg1InsertOpcodes(pThis, off);
     2790            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 1, 0);
     2791            break;
     2792        case 9:
     2793            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 0 /*~X-ignored*/, 1 /*~B*/, 0 /*W*/);
     2794            off = Bs3Cg1InsertOpcodes(pThis, off);
     2795            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2, 0);
     2796            break;
    27572797#endif
    2758             /* fall thru */
    2759         case 8:
    2760 #if ARCH_BITS == 64
    2761             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2762             {
    2763                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 0 /*~B-ignored*/, 0 /*W*/);
    2764                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2765                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 1, 0);
    2766                 break;
    2767             }
    2768 #endif
    2769             /* fall thru */
    2770         case 9:
    2771 #if ARCH_BITS == 64
    2772             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2773             {
    2774                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 0 /*~X-ignored*/, 1 /*~B*/, 0 /*W*/);
    2775                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2776                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2, 0);
    2777                 break;
    2778             }
    2779 #endif
    2780             /* fall thru */
    27812798        case 10:
    2782             iEncoding = 10;
    27832799            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
    27842800            off = Bs3Cg1InsertOpcodes(pThis, off);
     
    28202836            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 7, 0);
    28212837            pThis->fInvalidEncoding = true;
    2822             if (!BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2823                 iEncoding += 2;
     2838            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 2 : 0;
    28242839            break;
    28252840#if ARCH_BITS == 64
     
    28572872            off = Bs3Cg1InsertOpcodes(pThis, off);
    28582873            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5, 0);
    2859             if (!BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2860                 iEncoding += 3;
     2874            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 3 : 0;
    28612875            break;
    28622876#if ARCH_BITS == 64
     
    29182932            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
    29192933            pThis->fInvalidEncoding = true;
    2920             break;
     2934            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 1 : 0;
     2935            break;
     2936#if ARCH_BITS == 64
    29212937        case 2:
    2922 #if ARCH_BITS == 64
    2923             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2924             {
    2925                 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0x1 /*~V*/, 0 /*L*/, 0 /*~R*/);
    2926                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2927                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 7 + 8, 0);
    2928                 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 14;
    2929                 break;
    2930             }
     2938            off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0x1 /*~V*/, 0 /*L*/, 0 /*~R*/);
     2939            off = Bs3Cg1InsertOpcodes(pThis, off);
     2940            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 7 + 8, 0);
     2941            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 14;
     2942            break;
    29312943#endif
    2932             /* fall thru */
    29332944        case 3:
    2934             iEncoding = 3;
    29352945            off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xe /*~V*/, 0 /*L*/, 1 /*~R*/);
    29362946            off = Bs3Cg1InsertOpcodes(pThis, off);
     
    29562966            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5, 0);
    29572967            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
    2958             break;
     2968            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 3 : 0;
     2969            break;
     2970#if ARCH_BITS == 64
    29592971        case 7:
    2960 #if ARCH_BITS == 64
    2961             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2962             {
    2963                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
    2964                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2965                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5+8, 0);
    2966                 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
    2967                 break;
    2968             }
     2972            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 0 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
     2973            off = Bs3Cg1InsertOpcodes(pThis, off);
     2974            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5+8, 0);
     2975            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
     2976            break;
     2977        case 8:
     2978            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 0 /*~B-ignored*/, 0 /*W*/);
     2979            off = Bs3Cg1InsertOpcodes(pThis, off);
     2980            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 1, 0);
     2981            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
     2982            break;
     2983        case 9:
     2984            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 0 /*~X-ignored*/, 1 /*~B*/, 0 /*W*/);
     2985            off = Bs3Cg1InsertOpcodes(pThis, off);
     2986            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2, 0);
     2987            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
     2988            break;
    29692989#endif
    2970             /* fall thru */
    2971         case 8:
    2972 #if ARCH_BITS == 64
    2973             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2974             {
    2975                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 1 /*~X*/, 0 /*~B-ignored*/, 0 /*W*/);
    2976                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2977                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 1, 0);
    2978                 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
    2979                 break;
    2980             }
    2981 #endif
    2982             /* fall thru */
    2983         case 9:
    2984 #if ARCH_BITS == 64
    2985             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    2986             {
    2987                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 0 /*L*/, 1 /*~R*/, 0 /*~X-ignored*/, 1 /*~B*/, 0 /*W*/);
    2988                 off = Bs3Cg1InsertOpcodes(pThis, off);
    2989                 off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 2, 0);
    2990                 pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + 0;
    2991                 break;
    2992             }
    2993 #endif
    2994             /* fall thru */
    29952990        case 10:
    2996             iEncoding = 10;
    29972991            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0 /*~V*/, 1 /*L*/, 1 /*~R*/, 1 /*~X*/, 1 /*~B*/, 0 /*W*/);
    29982992            off = Bs3Cg1InsertOpcodes(pThis, off);
    29992993            off = Bs3Cfg1EncodeMemMod0DispWithRegFieldAndDefaults(pThis, false, off, 5, 0);
    3000             pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + (BS3_MODE_IS_64BIT_CODE(pThis->bMode) ? 15 : 7);
     2994            pThis->aOperands[1].idxField = pThis->aOperands[1].idxFieldBase + (BS3CG1_IS_64BIT_TARGET(pThis) ? 15 : 7);
    30012995            pThis->fInvalidEncoding = true;
    30022996            break;
     
    30863080    }
    30873081#if ARCH_BITS == 64
    3088     else if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     3082    else if (BS3CG1_IS_64BIT_TARGET(pThis))
    30893083    {
    30903084        if (iEncoding == 8)
     
    33073301            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 4;
    33083302            pThis->fInvalidEncoding = true;
    3309             break;
    3310 
     3303            iEncoding += !BS3CG1_IS_64BIT_TARGET(pThis) ? 2 : 0;
     3304            break;
     3305
     3306#if ARCH_BITS == 64
    33113307        /* 64-bit mode registers */
    33123308        case 34:
    3313             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    3314             {
    3315                 off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 0 /*~R*/);
    3316                 off = Bs3Cg1InsertOpcodes(pThis, off);
    3317                 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 4);
    3318                 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 4;
    3319                 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11;
    3320                 break;
    3321             }
    3322             /* fall thru */
     3309            off = Bs3Cg1InsertVex2bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 0 /*~R*/);
     3310            off = Bs3Cg1InsertOpcodes(pThis, off);
     3311            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 3, 4);
     3312            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 4;
     3313            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 11;
     3314            break;
    33233315        case 35:
    3324             if (BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    3325             {
    3326                 off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/);
    3327                 off = Bs3Cg1InsertOpcodes(pThis, off);
    3328                 pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 4);
    3329                 pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 12;
    3330                 pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 9;
    3331                 break;
    3332             }
    3333             /* fall thru */
    3334 
     3316            off = Bs3Cg1InsertVex3bPrefix(pThis, 0 /*offDst*/, 0xf /*~V*/, 1 /*L*/, 0 /*~R*/, 1 /*~X*/, 0 /*~B*/, 0 /*W*/);
     3317            off = Bs3Cg1InsertOpcodes(pThis, off);
     3318            pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 4);
     3319            pThis->aOperands[pThis->iRmOp ].idxField = pThis->aOperands[pThis->iRmOp ].idxFieldBase + 12;
     3320            pThis->aOperands[pThis->iRegOp].idxField = pThis->aOperands[pThis->iRegOp].idxFieldBase + 9;
     3321            break;
     3322#endif
    33353323        default:
    33363324            return 0;
     
    37513739            break;
    37523740
     3741        case BS3CG1ENC_MODRM_Mps_WO_Vps:
     3742        case BS3CG1ENC_MODRM_Mpd_WO_Vpd:
     3743            pThis->pfnEncoder        = Bs3Cg1EncodeNext_MODRM_MsomethingWO_Vsomething;
     3744            pThis->iRmOp             = 0;
     3745            pThis->iRegOp            = 1;
     3746            pThis->aOperands[0].cbOp = 16;
     3747            pThis->aOperands[1].cbOp = 16;
     3748            pThis->aOperands[0].enmLocation  = BS3CG1OPLOC_MEM_WO;
     3749            pThis->aOperands[1].enmLocation  = BS3CG1OPLOC_CTX;
     3750            pThis->aOperands[1].idxFieldBase = BS3CG1DST_XMM0;
     3751            break;
     3752
    37533753        case BS3CG1ENC_FIXED:
    37543754            /* nothing to do here */
     
    40904090{
    40914091    if (   (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT)
    4092         && BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     4092        && BS3CG1_IS_64BIT_TARGET(pThis))
    40934093        return false;
    40944094
     
    41424142
    41434143    if (   (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT)
    4144         && BS3_MODE_IS_64BIT_CODE(pThis->bMode))
     4144        && BS3CG1_IS_64BIT_TARGET(pThis))
    41454145        return false;
    41464146
     
    42804280            CASE_PRED(BS3CG1PRED_RING_0_THRU_2, pThis->uCpl <= 2);
    42814281            CASE_PRED(BS3CG1PRED_RING_1_THRU_3, pThis->uCpl >= 1);
    4282             CASE_PRED(BS3CG1PRED_CODE_64BIT, BS3_MODE_IS_64BIT_CODE(pThis->bMode));
     4282            CASE_PRED(BS3CG1PRED_CODE_64BIT, BS3CG1_IS_64BIT_TARGET(pThis));
    42834283            CASE_PRED(BS3CG1PRED_CODE_32BIT, BS3_MODE_IS_32BIT_CODE(pThis->bMode));
    42844284            CASE_PRED(BS3CG1PRED_CODE_16BIT, BS3_MODE_IS_16BIT_CODE(pThis->bMode));
     
    54665466            && pThis->bCpuVendor != BS3CPUVENDOR_INTEL
    54675467            && (   (pThis->fFlags & (BS3CG1INSTR_F_UNUSED | BS3CG1INSTR_F_INVALID))
    5468                 || (BS3_MODE_IS_64BIT_CODE(pThis->bMode) && (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT))
     5468                || (BS3CG1_IS_64BIT_TARGET(pThis) && (pThis->fFlags & BS3CG1INSTR_F_INVALID_64BIT))
    54695469                || fOuterInvalidInstr ) )
    54705470            pThis->enmEncoding = Bs3Cg1CalcNoneIntelInvalidEncoding(pThis->enmEncoding);
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h

    r66976 r66991  
    105105    BS3CG1OP_Mq,
    106106    BS3CG1OP_Mq_WO,
     107    BS3CG1OP_Mps_WO,
     108    BS3CG1OP_Mpd_WO,
    107109
    108110    BS3CG1OP_END
     
    150152    BS3CG1ENC_MODRM_Mq_WO_Vq,
    151153    BS3CG1ENC_MODRM_Mq_WO_VqHi,
     154    BS3CG1ENC_MODRM_Mps_WO_Vps,
     155    BS3CG1ENC_MODRM_Mpd_WO_Vpd,
    152156
    153157    BS3CG1ENC_VEX_MODRM_Vps_WO_Wps,
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette