VirtualBox

Ignore:
Timestamp:
May 17, 2017 12:09:30 PM (8 years ago)
Author:
vboxsync
Message:

IEM: Implemented vmovlpd Vq,Hq,Mq (VEX.66.0F 12 mod!=3).

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  
    302302        self.asOpcodes          = oMap.asLeadOpcodes + [ '0x%02x' % (oInstr.getOpcodeByte(),) ];
    303303        self.sEncoding          = iai.g_kdEncodings[oInstr.sEncoding][0];
     304
    304305        for oOp in oInstr.aoOperands:
    305306            self.sEncoding     += '_' + oOp.sType;
    306307        if oInstr.fUnused:
     308            print('DEBUG: Unused Bs3Cg1Instruction: %s\n' % (oInstr.sEncoding,));
    307309            if oInstr.sInvalidStyle == 'immediate' and oInstr.sSubOpcode:
    308310                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  
    20622062        off = Bs3Cg1InsertReqPrefix(pThis, 0);
    20632063        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);
    20652065    }
    20662066    else
     
    31433143}
    31443144
     3145
     3146static 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
     3194static 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
    31453225#endif /* BS3CG1_WITH_VEX */
    31463226
     
    32273307            return Bs3Cg1EncodeNext_FIXED_rAX_Iz(pThis, iEncoding);
    32283308
    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 
    32343309        /*
    32353310         * VEX stuff
     
    34683543            break;
    34693544
     3545            /* Unused or invalid instructions mostly. */
    34703546        case BS3CG1ENC_MODRM_MOD_EQ_3:
     3547            pThis->pfnEncoder = Bs3Cg1EncodeNext_MODRM_MOD_EQ_3;
     3548            break;
    34713549        case BS3CG1ENC_MODRM_MOD_NE_3:
    3472             /* Unused or invalid instructions mostly. */
     3550            pThis->pfnEncoder = Bs3Cg1EncodeNext_MODRM_MOD_NE_3;
    34733551            break;
    34743552
     
    35703648            break;
    35713649
     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
    35723665        case BS3CG1ENC_VEX_MODRM_Md_WO_Vss:
    35733666            pThis->pfnEncoder        = Bs3Cg1EncodeNext_VEX_MODRM_VsomethingWO_Msomething_Wip_Lig_OR_ViceVersa;
     
    36373730            break;
    36383731
     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;
    36393740
    36403741#endif /* BS3CG1_WITH_VEX */
     
    41794280            /* FPU and FXSAVE format. */
    41804281            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]))
    41824283            {
    41834284                if (!pThis->fWorkExtCtx)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h

    r66932 r66935  
    6464    BS3CG1OP_HdqCsd,
    6565    BS3CG1OP_HdqCq,
     66    BS3CG1OP_HqHi,
    6667    BS3CG1OP_Nq,
    6768    BS3CG1OP_Pq_WO,
     
    155156    BS3CG1ENC_VEX_MODRM_Vq_WO_HdqCq_UqHi,
    156157    BS3CG1ENC_VEX_MODRM_Vq_WO_HdqCq_Mq,
     158    BS3CG1ENC_VEX_MODRM_Vq_WO_HqHi_Mq,
    157159    BS3CG1ENC_VEX_MODRM_VssZx_WO_Md,
    158160    BS3CG1ENC_VEX_MODRM_VsdZx_WO_Mq,
     
    169171    BS3CG1ENC_FIXED_rAX_Iz,
    170172
     173
    171174    BS3CG1ENC_MODRM_MOD_EQ_3, /**< Unused or invalid instruction. */
    172175    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. */
    173178
    174179    BS3CG1ENC_END
Note: See TracChangeset for help on using the changeset viewer.

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