VirtualBox

Ignore:
Timestamp:
Jul 3, 2022 1:58:25 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152099
Message:

ValKit/bs3-cpu-instr-3: Simple tests for pshufw, [v]pshufhw, [v]pshuflw and [v]pshufd. Added parameter to Bs3ExtCtxSetMm to control what we do with the 16-bit bytes above the mmx register part, so we can opt to clear it when setting source and destination register to check that register writes always sets these bits. bugref:9898

Location:
trunk/src/VBox/ValidationKit/bootsectors/bs3kit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-ExtCtxSetMm.c

    r95399 r95485  
    3333
    3434#undef Bs3ExtCtxSetMm
    35 BS3_CMN_DEF(bool, Bs3ExtCtxSetMm,(PBS3EXTCTX pExtCtx, uint8_t iReg, uint64_t uValue))
     35BS3_CMN_DEF(bool, Bs3ExtCtxSetMm,(PBS3EXTCTX pExtCtx, uint8_t iReg, uint64_t uValue, BS3EXTCTXTOPMM enmTop))
    3636{
    3737    AssertCompileMembersAtSameOffset(BS3EXTCTX, Ctx.x87.aRegs, BS3EXTCTX, Ctx.x.x87.aRegs);
     
    4141            case BS3EXTCTXMETHOD_FXSAVE:
    4242            case BS3EXTCTXMETHOD_XSAVE:
    43                 /* pxor mm1, mm2 on 10980XE sets mm1's sign and exponent to all 1's. */
    44                 pExtCtx->Ctx.x87.aRegs[iReg].au16[4]    = UINT16_MAX;
    45                 pExtCtx->Ctx.x87.aRegs[iReg].mmx        = uValue;
     43                pExtCtx->Ctx.x87.aRegs[iReg].mmx = uValue;
     44                if (enmTop == BS3EXTCTXTOPMM_SET || enmTop == BS3EXTCTXTOPMM_ZERO)
     45                    pExtCtx->Ctx.x87.aRegs[iReg].au16[4] = enmTop == BS3EXTCTXTOPMM_SET ? UINT16_MAX : 0;
    4646                return true;
    4747
    4848            case BS3EXTCTXMETHOD_ANCIENT:
    49                 pExtCtx->Ctx.Ancient.regs[iReg].au16[4] = UINT16_MAX; /* see above */
    50                 pExtCtx->Ctx.Ancient.regs[iReg].mmx     = uValue;
     49                pExtCtx->Ctx.Ancient.regs[iReg].mmx = uValue;
     50                if (enmTop == BS3EXTCTXTOPMM_SET || enmTop == BS3EXTCTXTOPMM_ZERO)
     51                    pExtCtx->Ctx.Ancient.regs[iReg].au16[4] = enmTop == BS3EXTCTXTOPMM_SET ? UINT16_MAX : 0;
    5152                return true;
    5253        }
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r95481 r95485  
    29892989BS3_CMN_PROTO_STUB(uint64_t, Bs3ExtCtxGetMm,(PCBS3EXTCTX pExtCtx, uint8_t iReg));
    29902990
     2991/** What to do about the 16-bit above the MM QWORD. */
     2992typedef enum BS3EXTCTXTOPMM
     2993{
     2994    /** Invalid zero value. */
     2995    BS3EXTCTXTOPMM_INVALID = 0,
     2996    /** Set to 0FFFFh like real CPUs typically does when updating an MM register. */
     2997    BS3EXTCTXTOPMM_SET,
     2998    /** Set to zero. */
     2999    BS3EXTCTXTOPMM_ZERO,
     3000    /** Don't change the value, leaving it as-is. */
     3001    BS3EXTCTXTOPMM_AS_IS,
     3002    /** End of valid values. */
     3003    BS3EXTCTXTOPMM_END
     3004} BS3EXTCTXTOPMM;
     3005
    29913006/**
    29923007 * Sets the value of YMM register number @a iReg in @a pExtCtx to @a pValue.
     
    29963011 * @param   iReg            The register to set.
    29973012 * @param   uValue          The new register value.
    2998  */
    2999 BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetMm,(PBS3EXTCTX pExtCtx, uint8_t iReg, uint64_t uValue));
     3013 * @param   enmTop          What to do about the 16-bit value above the MM
     3014 *                          QWord.
     3015 */
     3016BS3_CMN_PROTO_STUB(bool, Bs3ExtCtxSetMm,(PBS3EXTCTX pExtCtx, uint8_t iReg, uint64_t uValue, BS3EXTCTXTOPMM enmTop));
    30003017
    30013018/**
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