VirtualBox

Changeset 66309 in vbox for trunk


Ignore:
Timestamp:
Mar 28, 2017 3:35:12 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114238
Message:

IEM: Implemented movlps Vq,Mq and movhlps Vq,Uq (0f 12).

Location:
trunk/src/VBox
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAll.cpp

    r66306 r66309  
    1075910759#define IEM_MC_FETCH_XREG_U32(a_u32Value, a_iXReg) \
    1076010760    do { (a_u32Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au32[0]; } while (0)
     10761#define IEM_MC_FETCH_XREG_HI_U64(a_u64Value, a_iXReg) \
     10762    do { (a_u64Value) = IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].au64[1]; } while (0)
    1076110763#define IEM_MC_STORE_XREG_U128(a_iXReg, a_u128Value) \
    1076210764    do { IEM_GET_CTX(pVCpu)->CTX_SUFF(pXState)->x87.aXMM[(a_iXReg)].xmm = (a_u128Value); } while (0)
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsPython.py

    r66306 r66309  
    166166    'Wpd':  ( 'IDX_UseModRM',       'rm',     '%Wpd', 'Wpd',     ),
    167167
     168    # ModR/M.rm - register only.
     169    'Uq':   ( 'IDX_UseModRM',       'rm',     '%Uq',  'Uq',      ),
     170    'UqHi': ( 'IDX_UseModRM',       'rm',     '%Uq',  'UqHi',    ),
     171
    168172    # ModR/M.rm - memory only.
    169173    'Ma':   ( 'IDX_UseModRM',       'rm',     '%Ma',  'Ma',      ), ##< Only used by BOUND.
     174    'Mq':   ( 'IDX_UseModRM',       'rm',     '%Mq',  'Mq',      ),
    170175
    171176    # ModR/M.reg
     
    177182    'Vps':  ( 'IDX_UseModRM',       'reg',    '%Vps', 'Vps',     ),
    178183    'Vpd':  ( 'IDX_UseModRM',       'reg',    '%Vpd', 'Vpd',     ),
     184    'Vq':   ( 'IDX_UseModRM',       'reg',    '%Vq',  'Vq',      ),
    179185
    180186    # Immediate values.
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstructionsTwoByte0f.cpp.h

    r66306 r66309  
    10841084 * @optest      op1=1 op2=2 -> op1=2
    10851085 * @optest      op1=0 op2=-42 -> op1=-42
    1086  * @oponlytest
    10871086 */
    10881087FNIEMOP_DEF(iemOp_vmovups_Wps_Vps)
     
    11361135 * @optest      op1=1 op2=2 -> op1=2
    11371136 * @optest      op1=0 op2=-42 -> op1=-42
    1138  * @oponlytest
    11391137 */
    11401138FNIEMOP_DEF(iemOp_vmovupd_Wpd_Vpd)
     
    11881186 * @optest      op1=1 op2=2 -> op1=2
    11891187 * @optest      op1=0 op2=-22 -> op1=-22
    1190  * @oponlytest
    11911188 */
    11921189FNIEMOP_DEF(iemOp_vmovss_Wss_Hx_Vss)
     
    12431240 * @optest      op1=1 op2=2 -> op1=2
    12441241 * @optest      op1=0 op2=-42 -> op1=-42
    1245  * @oponlytest
    12461242 */
    12471243FNIEMOP_DEF(iemOp_vmovsd_Wsd_Hx_Vsd)
     
    12901286
    12911287
    1292 /** Opcode      0x0f 0x12. */
    1293 FNIEMOP_STUB(iemOp_vmovlps_Vq_Hq_Mq__vmovhlps); //NEXT
     1288FNIEMOP_DEF(iemOp_vmovlps_Vq_Hq_Mq__vmovhlps)
     1289{
     1290    uint8_t bRm; IEM_OPCODE_GET_NEXT_U8(&bRm);
     1291    if ((bRm & X86_MODRM_MOD_MASK) == (3 << X86_MODRM_MOD_SHIFT))
     1292    {
     1293        /**
     1294         * @opcode      0x12
     1295         * @oppfx       none
     1296         * @opcpuid     sse
     1297         * @opgroup     og_sse_simdfp_datamove
     1298         * @opxcpttype  5
     1299         * @optest      op1=1 op2=2 -> op1=2
     1300         * @optest      op1=0 op2=-42 -> op1=-42
     1301         * @oponlytest
     1302         */
     1303        IEMOP_MNEMONIC2(RM, MOVHLPS, movhlps, Vq, UqHi, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE);
     1304
     1305        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     1306        IEM_MC_BEGIN(0, 1);
     1307        IEM_MC_LOCAL(uint64_t,                  uSrc);
     1308
     1309        IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT();
     1310        IEM_MC_ACTUALIZE_SSE_STATE_FOR_CHANGE();
     1311        IEM_MC_FETCH_XREG_HI_U64(uSrc, (bRm & X86_MODRM_RM_MASK) | pVCpu->iem.s.uRexB);
     1312        IEM_MC_STORE_XREG_U64(((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg, uSrc);
     1313
     1314        IEM_MC_ADVANCE_RIP();
     1315        IEM_MC_END();
     1316    }
     1317    else
     1318    {
     1319        /**
     1320         * @opdone
     1321         * @opcode      0x12
     1322         * @oppfx       none
     1323         * @opcpuid     sse
     1324         * @opgroup     og_sse_simdfp_datamove
     1325         * @opxcpttype  5
     1326         * @optest      op1=1 op2=2 -> op1=2
     1327         * @optest      op1=0 op2=-42 -> op1=-42
     1328         * @opfunction  iemOp_vmovlps_Vq_Hq_Mq__vmovhlps
     1329         * @oponlytest
     1330         */
     1331        IEMOP_MNEMONIC2(RM, MOVLPS, movlps, Vq, Mq, DISOPTYPE_HARMLESS, IEMOPHINT_IGNORES_OP_SIZE);
     1332
     1333        IEM_MC_BEGIN(0, 2);
     1334        IEM_MC_LOCAL(uint64_t,                  uSrc);
     1335        IEM_MC_LOCAL(RTGCPTR,                   GCPtrEffSrc);
     1336
     1337        IEM_MC_CALC_RM_EFF_ADDR(GCPtrEffSrc, bRm, 0);
     1338        IEMOP_HLP_DONE_DECODING_NO_LOCK_PREFIX();
     1339        IEM_MC_MAYBE_RAISE_SSE_RELATED_XCPT();
     1340        IEM_MC_ACTUALIZE_SSE_STATE_FOR_CHANGE();
     1341
     1342        IEM_MC_FETCH_MEM_U64(uSrc, pVCpu->iem.s.iEffSeg, GCPtrEffSrc);
     1343        IEM_MC_STORE_XREG_U64(((bRm >> X86_MODRM_REG_SHIFT) & X86_MODRM_REG_SMASK) | pVCpu->iem.s.uRexReg, uSrc);
     1344
     1345        IEM_MC_ADVANCE_RIP();
     1346        IEM_MC_END();
     1347    }
     1348    return VINF_SUCCESS;
     1349}
    12941350
    12951351/** Opcode 0x66 0x0f 0x12. */
  • trunk/src/VBox/VMM/testcase/tstIEMCheckMc.cpp

    r66306 r66309  
    498498#define IEM_MC_FETCH_XREG_U64(a_u64Value, a_iXReg)          do { (a_u64Value) = 0; CHK_TYPE(uint64_t, a_u64Value); (void)fSseRead; } while (0)
    499499#define IEM_MC_FETCH_XREG_U32(a_u32Value, a_iXReg)          do { (a_u32Value) = 0; CHK_TYPE(uint32_t, a_u32Value); (void)fSseRead; } while (0)
     500#define IEM_MC_FETCH_XREG_HI_U64(a_u64Value, a_iXReg)       do { (a_u64Value) = 0; CHK_TYPE(uint64_t, a_u64Value); (void)fSseRead; } while (0)
    500501#define IEM_MC_STORE_XREG_U128(a_iXReg, a_u128Value)        do { CHK_TYPE(uint128_t, a_u128Value); (void)fSseWrite; } while (0)
    501502#define IEM_MC_STORE_XREG_U64(a_iXReg, a_u64Value)          do { CHK_TYPE(uint64_t,  a_u64Value);  (void)fSseWrite; } while (0)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1-template.c

    r66306 r66309  
    7777#if 0
    7878# define BS3CG1_DPRINTF(a_ArgList) Bs3TestPrintf a_ArgList
    79 //# define BS3CG1_DEBUG_CTX_MOD
     79# define BS3CG1_DEBUG_CTX_MOD
    8080#else
    8181# define BS3CG1_DPRINTF(a_ArgList) do { } while (0)
     
    13621362            break;
    13631363
     1364        case BS3CG1ENC_MODRM_Vq_UqHi:
     1365            if (iEncoding == 0)
     1366            {
     1367                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1368                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 1, 0);
     1369                pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM0_HI;
     1370                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM1_LO;
     1371            }
     1372            else if (iEncoding == 1)
     1373            {
     1374                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1375                pThis->abCurInstr[off++] = X86_MODRM_MAKE(3, 2, 2);
     1376                pThis->aOperands[pThis->iRmOp ].idxField = BS3CG1DST_XMM2_HI;
     1377                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2_LO;
     1378            }
     1379            else
     1380                break;
     1381            pThis->cbCurInstr = off;
     1382            iEncoding++;
     1383            break;
     1384
     1385        case BS3CG1ENC_MODRM_Vq_Mq:
     1386            if (iEncoding == 0)
     1387            {
     1388                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM2_LO;
     1389                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1390                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 2 /*iReg*/, 8, 0, BS3CG1OPLOC_MEM);
     1391            }
     1392            else if (iEncoding == 1)
     1393            {
     1394                pThis->aOperands[pThis->iRegOp].idxField = BS3CG1DST_XMM3_LO;
     1395                off = Bs3Cg1InsertOpcodes(pThis, Bs3Cg1InsertReqPrefix(pThis, 0));
     1396                off = Bs3Cfg1EncodeMemMod0Disp(pThis, false, off, 3 /*iReg*/, 8, 1 /*cbMissalign*/, BS3CG1OPLOC_MEM);
     1397            }
     1398            else
     1399                break;
     1400            pThis->cbCurInstr = off;
     1401            iEncoding++;
     1402            break;
     1403
    13641404        case BS3CG1ENC_MODRM_Gv_Ma:
    13651405            cbOp = BS3_MODE_IS_16BIT_CODE(pThis->bMode) ? 2 : 4;
     
    15921632            pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX;
    15931633            pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX;
     1634            break;
     1635
     1636        case BS3CG1ENC_MODRM_Vq_UqHi:
     1637            pThis->iRmOp             = 1;
     1638            pThis->iRegOp            = 0;
     1639            pThis->aOperands[0].cbOp = 8;
     1640            pThis->aOperands[1].cbOp = 8;
     1641            pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX;
     1642            pThis->aOperands[1].enmLocation = BS3CG1OPLOC_CTX;
     1643            break;
     1644
     1645        case BS3CG1ENC_MODRM_Vq_Mq:
     1646            pThis->iRmOp             = 1;
     1647            pThis->iRegOp            = 0;
     1648            pThis->aOperands[0].cbOp = 8;
     1649            pThis->aOperands[1].cbOp = 8;
     1650            pThis->aOperands[0].enmLocation = BS3CG1OPLOC_CTX;
     1651            pThis->aOperands[1].enmLocation = BS3CG1OPLOC_MEM;
    15941652            break;
    15951653
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-generated-1.h

    r66306 r66309  
    5151    BS3CG1OP_Gb,
    5252    BS3CG1OP_Gv,
     53    BS3CG1OP_Uq,
     54    BS3CG1OP_UqHi,
    5355    BS3CG1OP_Vss,
    5456    BS3CG1OP_Vsd,
    5557    BS3CG1OP_Vps,
    5658    BS3CG1OP_Vpd,
     59    BS3CG1OP_Vq,
    5760
    5861    BS3CG1OP_Ib,
     
    6366
    6467    BS3CG1OP_Ma,
     68    BS3CG1OP_Mq,
    6569
    6670    BS3CG1OP_END
     
    9094    BS3CG1ENC_MODRM_Gv_Ev,
    9195    BS3CG1ENC_MODRM_Gv_Ma, /**< bound instruction */
     96    BS3CG1ENC_MODRM_Vq_UqHi,
     97    BS3CG1ENC_MODRM_Vq_Mq,
    9298
    9399    BS3CG1ENC_FIXED,
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