VirtualBox

Changeset 66283 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Mar 28, 2017 9:02:56 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114208
Message:

bs3-cpu-generated-1,IEM: More SSE testing stuff.

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-data.py

    r66172 r66283  
    310310
    311311        self.fAdvanceMnemonic   = True; ##< Set by the caller.
    312         if self.sEncoding == 'ModR/M':
     312        if oInstr.sPrefix:
     313            if oInstr.sPrefix == 'none':
     314                self.sPfxKind = 'BS3CGPFXKIND_NO_F2_F3_66';
     315            else:
     316                self.sPfxKind = 'BS3CGPFXKIND_REQ_' + oInstr.sPrefix[-2:].upper();
     317        elif oInstr.sEncoding == 'ModR/M':
    313318            if 'ignores_op_size' not in oInstr.dHints:
    314319                self.sPfxKind   = 'BS3CGPFXKIND_MODRM';
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c

    r66242 r66283  
    122122    /** The CPU test / CPU ID. */
    123123    BS3CG1CPU               enmCpuTest;
     124    /** Prefix sensitivity and requirements. */
     125    BS3CGPFXKIND            enmPrefixKind;
    124126    /** Per operand flags. */
    125127    BS3CG1OP                aenmOperands[4];
     
    431433    /* [BS3CG1DST_XMM14] = */       16,
    432434    /* [BS3CG1DST_XMM15] = */       16,
     435    /* [BS3CG1DST_XMM0_LO] = */     8,
     436    /* [BS3CG1DST_XMM1_LO] = */     8,
     437    /* [BS3CG1DST_XMM2_LO] = */     8,
     438    /* [BS3CG1DST_XMM3_LO] = */     8,
     439    /* [BS3CG1DST_XMM4_LO] = */     8,
     440    /* [BS3CG1DST_XMM5_LO] = */     8,
     441    /* [BS3CG1DST_XMM6_LO] = */     8,
     442    /* [BS3CG1DST_XMM7_LO] = */     8,
     443    /* [BS3CG1DST_XMM8_LO] = */     8,
     444    /* [BS3CG1DST_XMM9_LO] = */     8,
     445    /* [BS3CG1DST_XMM10_LO] = */    8,
     446    /* [BS3CG1DST_XMM11_LO] = */    8,
     447    /* [BS3CG1DST_XMM12_LO] = */    8,
     448    /* [BS3CG1DST_XMM13_LO] = */    8,
     449    /* [BS3CG1DST_XMM14_LO] = */    8,
     450    /* [BS3CG1DST_XMM15_LO] = */    8,
     451    /* [BS3CG1DST_XMM0_HI] = */     8,
     452    /* [BS3CG1DST_XMM1_HI] = */     8,
     453    /* [BS3CG1DST_XMM2_HI] = */     8,
     454    /* [BS3CG1DST_XMM3_HI] = */     8,
     455    /* [BS3CG1DST_XMM4_HI] = */     8,
     456    /* [BS3CG1DST_XMM5_HI] = */     8,
     457    /* [BS3CG1DST_XMM6_HI] = */     8,
     458    /* [BS3CG1DST_XMM7_HI] = */     8,
     459    /* [BS3CG1DST_XMM8_HI] = */     8,
     460    /* [BS3CG1DST_XMM9_HI] = */     8,
     461    /* [BS3CG1DST_XMM10_HI] = */    8,
     462    /* [BS3CG1DST_XMM11_HI] = */    8,
     463    /* [BS3CG1DST_XMM12_HI] = */    8,
     464    /* [BS3CG1DST_XMM13_HI] = */    8,
     465    /* [BS3CG1DST_XMM14_HI] = */    8,
     466    /* [BS3CG1DST_XMM15_HI] = */    8,
    433467    /* [BS3CG1DST_YMM0] = */        32,
    434468    /* [BS3CG1DST_YMM1] = */        32,
     
    579613    /* [BS3CG1DST_MM6] = */         sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aRegs[6]),
    580614    /* [BS3CG1DST_MM7] = */         sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aRegs[7]),
     615
    581616    /* [BS3CG1DST_XMM0] = */        sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[0]),
    582617    /* [BS3CG1DST_XMM1] = */        sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[1]),
     
    595630    /* [BS3CG1DST_XMM14] = */       sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[14]),
    596631    /* [BS3CG1DST_XMM15] = */       sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[15]),
     632    /* [BS3CG1DST_XMM0_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[0]),
     633    /* [BS3CG1DST_XMM1_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[1]),
     634    /* [BS3CG1DST_XMM2_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[2]),
     635    /* [BS3CG1DST_XMM3_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[3]),
     636    /* [BS3CG1DST_XMM4_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[4]),
     637    /* [BS3CG1DST_XMM5_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[5]),
     638    /* [BS3CG1DST_XMM6_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[6]),
     639    /* [BS3CG1DST_XMM7_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[7]),
     640    /* [BS3CG1DST_XMM8_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[8]),
     641    /* [BS3CG1DST_XMM9_LO] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[9]),
     642    /* [BS3CG1DST_XMM10_LO] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[10]),
     643    /* [BS3CG1DST_XMM11_LO] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[11]),
     644    /* [BS3CG1DST_XMM12_LO] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[12]),
     645    /* [BS3CG1DST_XMM13_LO] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[13]),
     646    /* [BS3CG1DST_XMM14_LO] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[14]),
     647    /* [BS3CG1DST_XMM15_LO] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[15]),
     648    /* [BS3CG1DST_XMM0_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[0])  + sizeof(uint64_t),
     649    /* [BS3CG1DST_XMM1_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[1])  + sizeof(uint64_t),
     650    /* [BS3CG1DST_XMM2_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[2])  + sizeof(uint64_t),
     651    /* [BS3CG1DST_XMM3_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[3])  + sizeof(uint64_t),
     652    /* [BS3CG1DST_XMM4_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[4])  + sizeof(uint64_t),
     653    /* [BS3CG1DST_XMM5_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[5])  + sizeof(uint64_t),
     654    /* [BS3CG1DST_XMM6_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[6])  + sizeof(uint64_t),
     655    /* [BS3CG1DST_XMM7_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[7])  + sizeof(uint64_t),
     656    /* [BS3CG1DST_XMM8_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[8])  + sizeof(uint64_t),
     657    /* [BS3CG1DST_XMM9_HI] = */     sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[9])  + sizeof(uint64_t),
     658    /* [BS3CG1DST_XMM10_HI] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[10]) + sizeof(uint64_t),
     659    /* [BS3CG1DST_XMM11_HI] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[11]) + sizeof(uint64_t),
     660    /* [BS3CG1DST_XMM12_HI] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[12]) + sizeof(uint64_t),
     661    /* [BS3CG1DST_XMM13_HI] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[13]) + sizeof(uint64_t),
     662    /* [BS3CG1DST_XMM14_HI] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[14]) + sizeof(uint64_t),
     663    /* [BS3CG1DST_XMM15_HI] = */    sizeof(BS3REGCTX) + RT_OFFSETOF(BS3EXTCTX, Ctx.x87.aXMM[15]) + sizeof(uint64_t),
     664
    597665    /* [BS3CG1DST_YMM0] = */        ~0U,
    598666    /* [BS3CG1DST_YMM1] = */        ~0U,
     
    759827    { "XMM14" },
    760828    { "XMM15" },
     829    { "XMM0_LO" },
     830    { "XMM1_LO" },
     831    { "XMM2_LO" },
     832    { "XMM3_LO" },
     833    { "XMM4_LO" },
     834    { "XMM5_LO" },
     835    { "XMM6_LO" },
     836    { "XMM7_LO" },
     837    { "XMM8_LO" },
     838    { "XMM9_LO" },
     839    { "XMM10_LO" },
     840    { "XMM11_LO" },
     841    { "XMM12_LO" },
     842    { "XMM13_LO" },
     843    { "XMM14_LO" },
     844    { "XMM15_LO" },
     845    { "XMM0_HI" },
     846    { "XMM1_HI" },
     847    { "XMM2_HI" },
     848    { "XMM3_HI" },
     849    { "XMM4_HI" },
     850    { "XMM5_HI" },
     851    { "XMM6_HI" },
     852    { "XMM7_HI" },
     853    { "XMM8_HI" },
     854    { "XMM9_HI" },
     855    { "XMM10_HI" },
     856    { "XMM11_HI" },
     857    { "XMM12_HI" },
     858    { "XMM13_HI" },
     859    { "XMM14_HI" },
     860    { "XMM15_HI" },
    761861    { "YMM0" },
    762862    { "YMM1" },
     
    828928
    829929
     930DECLINLINE(unsigned) Bs3Cg1InsertReqPrefix(PBS3CG1STATE pThis, unsigned offDst)
     931{
     932    switch (pThis->enmPrefixKind)
     933    {
     934        case BS3CGPFXKIND_REQ_66:
     935            pThis->abCurInstr[offDst] = 0x66;
     936            break;
     937        case BS3CGPFXKIND_REQ_F2:
     938            pThis->abCurInstr[offDst] = 0xf2;
     939            break;
     940        case BS3CGPFXKIND_REQ_F3:
     941            pThis->abCurInstr[offDst] = 0xf3;
     942            break;
     943        default:
     944            return offDst;
     945    }
     946    return offDst + 1;
     947}
     948
     949
    830950DECLINLINE(unsigned) Bs3Cg1InsertOpcodes(PBS3CG1STATE pThis, unsigned offDst)
    831951{
     
    867987
    868988static unsigned Bs3Cfg1EncodeMemMod0Disp(PBS3CG1STATE pThis, bool fAddrOverride, unsigned off, uint8_t iReg,
    869                                          uint8_t cbOp, BS3CG1OPLOC enmLocation)
     989                                         uint8_t cbOp, uint8_t cbMissalign, BS3CG1OPLOC enmLocation)
    870990{
    871991    pThis->aOperands[pThis->iRmOp].idxField     = BS3CG1DST_INVALID;
    872992    pThis->aOperands[pThis->iRmOp].enmLocation  = enmLocation;
    873993    pThis->aOperands[pThis->iRmOp].cbOp         = cbOp;
    874     pThis->aOperands[pThis->iRmOp].off          = cbOp;
     994    pThis->aOperands[pThis->iRmOp].off          = cbOp + cbMissalign;
    875995
    876996    if (   BS3_MODE_IS_16BIT_CODE(pThis->bMode)
     
    8911011        {
    8921012            pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, iReg, 6 /*disp16*/);
    893             *(uint16_t *)&pThis->abCurInstr[off] = pThis->DataPgFar.off + X86_PAGE_SIZE - cbOp;
     1013            *(uint16_t *)&pThis->abCurInstr[off] = pThis->DataPgFar.off + X86_PAGE_SIZE - cbOp - cbMissalign;
    8941014            off += 2;
    8951015        }
     
    8971017        {
    8981018            pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, iReg, 5 /*disp32*/);
    899             *(uint32_t *)&pThis->abCurInstr[off] = pThis->DataPgFar.off + X86_PAGE_SIZE - cbOp;
     1019            *(uint32_t *)&pThis->abCurInstr[off] = pThis->DataPgFar.off + X86_PAGE_SIZE - cbOp - cbMissalign;
    9001020            off += 4;
    9011021        }
     
    9081028         */
    9091029        pThis->abCurInstr[off++] = X86_MODRM_MAKE(0, iReg, 5 /*disp32*/);
    910         *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - cbOp;
     1030        *(uint32_t *)&pThis->abCurInstr[off] = BS3_FP_OFF(pThis->pbDataPg) + X86_PAGE_SIZE - cbOp - cbMissalign;
    9111031
    9121032        /* In 64-bit mode we always have a rip relative encoding regardless of fAddrOverride. */
     
    9391059            if (iEncoding == 0)
    9401060            {
    941                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1061                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    9421062                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xAX, X86_GREG_xCX);
    9431063                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_AL;
     
    9471067            {
    9481068                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_CH;
    949                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, 1, BS3CG1OPLOC_MEM_RW);
     1069                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1070                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, X86_GREG_xBP, 1, 0, BS3CG1OPLOC_MEM_RW);
    9501071            }
    9511072            else if (iEncoding == 2 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386)
     
    9531074                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_BH;
    9541075                pThis->abCurInstr[0] = P_AZ;
    955                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xDI, 1, BS3CG1OPLOC_MEM_RW);
     1076                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
     1077                off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, off, X86_GREG_xDI, 1, 0, BS3CG1OPLOC_MEM_RW);
    9561078            }
    9571079            else
     
    9651087            if (iEncoding == 0)
    9661088            {
    967                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1089                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    9681090                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xAX, X86_GREG_xCX);
    9691091                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_AL;
     
    9731095            {
    9741096                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_CH;
    975                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, 1, BS3CG1OPLOC_MEM);
     1097                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1098                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, X86_GREG_xBP, 1, 0, BS3CG1OPLOC_MEM);
    9761099            }
    9771100            else if (iEncoding == 2 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386)
     
    9791102                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_BH;
    9801103                pThis->abCurInstr[0] = P_AZ;
    981                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xDI, 1, BS3CG1OPLOC_MEM);
     1104                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
     1105                off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, off, X86_GREG_xDI, 1, 0, BS3CG1OPLOC_MEM);
    9821106            }
    9831107            else
     
    9921116            {
    9931117                cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4;
    994                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1118                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    9951119                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX);
    9961120                pThis->aOperands[pThis->iRegOp].idxField    = BS3CG1DST_OZ_RBX;
     
    10011125                cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4;
    10021126                pThis->aOperands[pThis->iRegOp].idxField    = BS3CG1DST_OZ_RBP;
    1003                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, cbOp,
     1127                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1128                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, X86_GREG_xBP, cbOp, 0,
    10041129                                               pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW);
    10051130            }
     
    10081133                cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 4 : 2;
    10091134                pThis->abCurInstr[0] = P_OZ;
    1010                 off = Bs3Cg1InsertOpcodes(pThis, 1);
     1135                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
    10111136                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX);
    10121137                pThis->aOperands[pThis->iRegOp].idxField    = BS3CG1DST_OZ_RBX;
     
    10191144                pThis->aOperands[pThis->iRegOp].idxField    = BS3CG1DST_OZ_RSI;
    10201145                pThis->abCurInstr[0] = P_OZ;
    1021                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xSI, cbOp,
     1146                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
     1147                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, X86_GREG_xSI, cbOp, 0,
    10221148                                               pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW);
    10231149            }
     
    10271153                pThis->aOperands[pThis->iRegOp].idxField    = BS3CG1DST_OZ_RDI;
    10281154                pThis->abCurInstr[0] = P_AZ;
    1029                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xDI, cbOp,
     1155                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
     1156                off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, off, X86_GREG_xDI, cbOp, 0,
    10301157                                               pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW);
    10311158            }
     
    10361163                pThis->abCurInstr[0] = P_OZ;
    10371164                pThis->abCurInstr[1] = P_AZ;
    1038                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 2), X86_GREG_xSI, cbOp,
     1165                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 2));
     1166                off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, off, X86_GREG_xSI, cbOp, 0,
    10391167                                               pThis->enmEncoding == BS3CG1ENC_MODRM_Gv_Ev ? BS3CG1OPLOC_MEM : BS3CG1OPLOC_MEM_RW);
    10401168            }
     
    10421170            {
    10431171                cbOp = 8;
    1044                 pThis->abCurInstr[0] = REX_W___;
    1045                 off = Bs3Cg1InsertOpcodes(pThis, 1);
     1172                off = Bs3Cg1InsertReqPrefix(pThis, 0);
     1173                pThis->abCurInstr[off++] = REX_W___;
     1174                off = Bs3Cg1InsertOpcodes(pThis, off);
    10461175                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, X86_GREG_xBX, X86_GREG_xDX);
    10471176                pThis->aOperands[pThis->iRegOp].idxField    = BS3CG1DST_RBX;
     
    10611190            if (iEncoding == 0)
    10621191            {
    1063                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1192                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    10641193                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);
    1065                 pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0;
    1066                 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1;
     1194                pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0_LO;
     1195                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1_LO;
    10671196            }
    10681197            else if (iEncoding == 1)
    10691198            {
    1070                 pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2;
    1071                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), 2 /*iReg*/, 16, BS3CG1OPLOC_MEM_RW);
     1199                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2_LO;
     1200                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1201                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 8, 0, BS3CG1OPLOC_MEM_RW);
     1202            }
     1203            else if (iEncoding == 2)
     1204            {
     1205                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3_LO;
     1206                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1207                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 8, 1 /*cbMissalign*/, BS3CG1OPLOC_MEM_RW);
    10721208            }
    10731209            else
     
    10771213            break;
    10781214
     1215        case BS3CG1ENC_MODRM_Wps_Vps:
     1216            if (iEncoding == 0)
     1217            {
     1218                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1219                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);
     1220                pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0;
     1221                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1;
     1222            }
     1223            else if (iEncoding == 1)
     1224            {
     1225                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2;
     1226                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1227                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 16, 0, BS3CG1OPLOC_MEM_RW);
     1228            }
     1229            //else if (iEncoding == 2)
     1230            //{
     1231            //    pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3;
     1232            //    off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1233            //    off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 16, 1 /*cbMissalign*/, BS3CG1OPLOC_MEM_RW);
     1234            //}
     1235            else
     1236                break;
     1237            pThis->cbCurInstr = off;
     1238            iEncoding++;
     1239            break;
     1240
    10791241
    10801242        case BS3CG1ENC_MODRM_Gv_Ma:
     
    10831245            {
    10841246                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP;
    1085                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 0), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM);
     1247                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1248                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, X86_GREG_xBP, cbOp * 2, 0, BS3CG1OPLOC_MEM);
    10861249            }
    10871250            else if (iEncoding == 1 && (g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80386)
     
    10901253                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP;
    10911254                pThis->abCurInstr[0] = P_OZ;
    1092                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM);
     1255                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
     1256                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, X86_GREG_xBP, cbOp * 2, 0, BS3CG1OPLOC_MEM);
    10931257            }
    10941258            else if (iEncoding == 2)
     
    10961260                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_OZ_RBP;
    10971261                pThis->abCurInstr[0] = P_AZ;
    1098                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 1), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM);
     1262                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
     1263                off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, off, X86_GREG_xBP, cbOp * 2, 0, BS3CG1OPLOC_MEM);
    10991264            }
    11001265            else if (iEncoding == 3)
     
    11041269                pThis->abCurInstr[0] = P_AZ;
    11051270                pThis->abCurInstr[1] = P_OZ;
    1106                 off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, Bs3Cg1InsertOpcodes(pThis, 2), X86_GREG_xBP, cbOp * 2, BS3CG1OPLOC_MEM);
     1271                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 2));
     1272                off = Bs3Cfg1EncodeMemMod0Disp(pThis, true, off, X86_GREG_xBP, cbOp * 2, 0, BS3CG1OPLOC_MEM);
    11071273            }
    11081274            else
     
    11171283            if (iEncoding == 0)
    11181284            {
    1119                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1285                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    11201286                pThis->cbCurInstr = off;
    11211287                iEncoding++;
     
    11261292            if (iEncoding == 0)
    11271293            {
    1128                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1294                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    11291295                pThis->aOperands[1].off = (uint8_t)off;
    11301296                pThis->abCurInstr[off++] = 0xff;
     
    11371303            if (iEncoding == 0)
    11381304            {
    1139                 off = Bs3Cg1InsertOpcodes(pThis, 0);
     1305                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
    11401306                pThis->aOperands[1].off = (uint8_t)off;
    11411307                if (BS3_MODE_IS_16BIT_CODE(pThis->bMode))
     
    11591325            {
    11601326                pThis->abCurInstr[0] = P_OZ;
    1161                 off = Bs3Cg1InsertOpcodes(pThis, 1);
     1327                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 1));
    11621328                pThis->aOperands[1].off = (uint8_t)off;
    11631329                if (!BS3_MODE_IS_16BIT_CODE(pThis->bMode))
     
    11801346            else if (iEncoding == 2 && BS3_MODE_IS_64BIT_CODE(pThis->bMode))
    11811347            {
    1182                 pThis->abCurInstr[0] = REX_W___;
    1183                 off = Bs3Cg1InsertOpcodes(pThis, 1);
     1348                off = Bs3Cg1InsertReqPrefix(pThis, 0);
     1349                pThis->abCurInstr[off++] = REX_W___;
     1350                off = Bs3Cg1InsertOpcodes(pThis, off);
    11841351                pThis->aOperands[1].off = (uint8_t)off;
    11851352                *(uint32_t *)&pThis->abCurInstr[off] = UINT32_MAX;
     
    12211388        pThis->aSavedSegRegs[iRing].ds = pThis->aInitialCtxs[iRing].ds;
    12221389
    1223     pThis->iRmOp         = RT_ELEMENTS(pThis->aOperands) - 1;
    1224     pThis->iRegOp        = RT_ELEMENTS(pThis->aOperands) - 1;
     1390    pThis->iRmOp            = RT_ELEMENTS(pThis->aOperands) - 1;
     1391    pThis->iRegOp           = RT_ELEMENTS(pThis->aOperands) - 1;
    12251392    pThis->fSameRingNotOkay = false;
     1393    pThis->cbOperand        = 0;
    12261394
    12271395    switch (pThis->enmEncoding)
    12281396    {
    12291397        case BS3CG1ENC_MODRM_Eb_Gb:
    1230             pThis->iRmOp  = 0;
    1231             pThis->iRegOp = 1;
     1398            pThis->iRmOp             = 0;
     1399            pThis->iRegOp            = 1;
    12321400            pThis->aOperands[0].cbOp = 1;
    12331401            pThis->aOperands[1].cbOp = 1;
     
    12371405
    12381406        case BS3CG1ENC_MODRM_Ev_Gv:
    1239             pThis->iRmOp  = 0;
    1240             pThis->iRegOp = 1;
     1407            pThis->iRmOp             = 0;
     1408            pThis->iRegOp            = 1;
     1409            pThis->cbOperand         = 2;
    12411410            pThis->aOperands[0].cbOp = 2;
    12421411            pThis->aOperands[1].cbOp = 2;
     
    12461415
    12471416        case BS3CG1ENC_MODRM_Gb_Eb:
    1248             pThis->iRmOp  = 1;
    1249             pThis->iRegOp = 0;
     1417            pThis->iRmOp             = 1;
     1418            pThis->iRegOp            = 0;
    12501419            pThis->aOperands[0].cbOp = 1;
    12511420            pThis->aOperands[1].cbOp = 1;
     
    12551424
    12561425        case BS3CG1ENC_MODRM_Gv_Ev:
    1257             pThis->iRmOp  = 1;
    1258             pThis->iRegOp = 0;
     1426            pThis->iRmOp             = 1;
     1427            pThis->iRegOp            = 0;
     1428            pThis->cbOperand         = 2;
    12591429            pThis->aOperands[0].cbOp = 2;
    12601430            pThis->aOperands[1].cbOp = 2;
     
    12641434
    12651435        case BS3CG1ENC_MODRM_Gv_Ma:
    1266             pThis->iRmOp  = 1;
    1267             pThis->iRegOp = 0;
     1436            pThis->iRmOp             = 1;
     1437            pThis->iRegOp            = 0;
     1438            pThis->cbOperand         = 2;
    12681439            pThis->aOperands[0].cbOp = 2;
    12691440            pThis->aOperands[1].cbOp = 4;
     
    12741445
    12751446        case BS3CG1ENC_MODRM_Wsd_Vsd:
    1276             pThis->iRmOp  = 0;
    1277             pThis->iRegOp = 1;
     1447            pThis->iRmOp             = 0;
     1448            pThis->iRegOp            = 1;
     1449            pThis->aOperands[0].cbOp = 8;
     1450            pThis->aOperands[1].cbOp = 8;
     1451            pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX;
     1452            pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX;
     1453            break;
     1454
     1455        case BS3CG1ENC_MODRM_Wps_Vps:
     1456            pThis->iRmOp             = 0;
     1457            pThis->iRegOp            = 1;
    12781458            pThis->aOperands[0].cbOp = 16;
    12791459            pThis->aOperands[1].cbOp = 16;
     
    25262706        pThis->enmEncoding     = (BS3CG1ENC)pInstr->enmEncoding;
    25272707        pThis->enmCpuTest      = (BS3CG1CPU)pInstr->enmCpuTest;
     2708        pThis->enmPrefixKind   = (BS3CG1CPU)pInstr->enmPrefixKind;
    25282709        pThis->cchMnemonic     = pInstr->cchMnemonic;
    25292710        if (pThis->fAdvanceMnemonic)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h

    r66216 r66283  
    4545    BS3CG1OP_Ev,
    4646    BS3CG1OP_Wsd,
     47    BS3CG1OP_Wps,
    4748
    4849    BS3CG1OP_Gb,
    4950    BS3CG1OP_Gv,
    50 
    5151    BS3CG1OP_Vsd,
     52    BS3CG1OP_Vps,
    5253
    5354    BS3CG1OP_Ib,
     
    7879    BS3CG1ENC_MODRM_Ev_Gv,
    7980    BS3CG1ENC_MODRM_Wsd_Vsd,
     81    BS3CG1ENC_MODRM_Wps_Vps,
    8082
    8183    BS3CG1ENC_MODRM_Gb_Eb,
     
    98100    BS3CGPFXKIND_INVALID = 0,
    99101
     102    BS3CGPFXKIND_NO_F2_F3_66,           /**< No 66, F2 or F3 prefixes allowed as that would alter the meaning. */
     103    BS3CGPFXKIND_REQ_F2,                /**< Requires F2 (REPNE) prefix as part of the instr encoding. */
     104    BS3CGPFXKIND_REQ_F3,                /**< Requires F3 (REPE) prefix as part of the instr encoding. */
     105    BS3CGPFXKIND_REQ_66,                /**< Requires 66 (OP SIZE) prefix as part of the instr encoding.  */
     106
     107    /** @todo more work to be done here...   */
    100108    BS3CGPFXKIND_MODRM,
    101109    BS3CGPFXKIND_MODRM_NO_OP_SIZES,
     
    373381    BS3CG1DST_XMM14,
    374382    BS3CG1DST_XMM15,
     383    BS3CG1DST_XMM0_LO,
     384    BS3CG1DST_XMM1_LO,
     385    BS3CG1DST_XMM2_LO,
     386    BS3CG1DST_XMM3_LO,
     387    BS3CG1DST_XMM4_LO,
     388    BS3CG1DST_XMM5_LO,
     389    BS3CG1DST_XMM6_LO,
     390    BS3CG1DST_XMM7_LO,
     391    BS3CG1DST_XMM8_LO,
     392    BS3CG1DST_XMM9_LO,
     393    BS3CG1DST_XMM10_LO,
     394    BS3CG1DST_XMM11_LO,
     395    BS3CG1DST_XMM12_LO,
     396    BS3CG1DST_XMM13_LO,
     397    BS3CG1DST_XMM14_LO,
     398    BS3CG1DST_XMM15_LO,
     399    BS3CG1DST_XMM0_HI,
     400    BS3CG1DST_XMM1_HI,
     401    BS3CG1DST_XMM2_HI,
     402    BS3CG1DST_XMM3_HI,
     403    BS3CG1DST_XMM4_HI,
     404    BS3CG1DST_XMM5_HI,
     405    BS3CG1DST_XMM6_HI,
     406    BS3CG1DST_XMM7_HI,
     407    BS3CG1DST_XMM8_HI,
     408    BS3CG1DST_XMM9_HI,
     409    BS3CG1DST_XMM10_HI,
     410    BS3CG1DST_XMM11_HI,
     411    BS3CG1DST_XMM12_HI,
     412    BS3CG1DST_XMM13_HI,
     413    BS3CG1DST_XMM14_HI,
     414    BS3CG1DST_XMM15_HI,
    375415    /* AVX registers. */
    376416    BS3CG1DST_YMM0,
Note: See TracChangeset for help on using the changeset viewer.

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