VirtualBox

Changeset 104765 in vbox


Ignore:
Timestamp:
May 23, 2024 10:30:25 AM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163333
Message:

ValidationKit/bootsectors: bugref:10658 SIMD FP testcase: [V]ADDPD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4.c32

    r104764 r104765  
    7474#define BS3_FP32_INF(a_Sign)                  RTFLOAT32U_INIT_INF(a_Sign)
    7575#define BS3_FP32_QNAN(a_Sign)                 RTFLOAT32U_INIT_QNAN(a_Sign)
     76#define BS3_FP32_QNAN_VAL(a_Sign, a_Val)      RTFLOAT32U_INIT_QNAN_EX(a_Sign, a_Val)
    7677#define BS3_FP32_SNAN(a_Sign)                 RTFLOAT32U_INIT_SNAN(a_Sign)
    7778
     
    103104#define BS3_FP64_INF(a_Sign)                  RTFLOAT64U_INIT_INF(a_Sign)
    104105#define BS3_FP64_QNAN(a_Sign)                 RTFLOAT64U_INIT_QNAN(a_Sign)
     106#define BS3_FP64_QNAN_VAL(a_Sign, a_Val)      RTFLOAT64U_INIT_QNAN_EX(a_Sign, a_Val)
    105107#define BS3_FP64_SNAN(a_Sign)                 RTFLOAT64U_INIT_SNAN(a_Sign)
     108#define BS3_FP64_SNAN_VAL(a_Sign, a_Val)      RTFLOAT64U_INIT_SNAN_EX(a_Sign, a_Val)
    106109
    107110/*
     
    361364static size_t bs3CpuInstr4GetXcptFlags(char BS3_FAR *pszBuf, size_t cchBuf, uint32_t fMxCsr)
    362365{
     366    BS3_ASSERT(cchBuf >= BS3_FP_XCPT_NAMES_MAXLEN);
    363367    if (!(fMxCsr & X86_MXCSR_XCPT_FLAGS))
    364368        return Bs3StrPrintf(pszBuf, cchBuf, " None");
     
    642646
    643647/**
    644  * Determins the size of memory operands.
     648 * Determines the size of memory operands.
    645649 */
    646650DECLINLINE(uint8_t) bs3CpuInstrXMemOpSize(uint8_t cbOperand, uint8_t enmRm)
     
    871875typedef struct BS3CPUINSTR4_TEST1_CTX_T
    872876{
    873     BS3CPUINSTR4_CONFIG_T const BS3_FAR          *pConfig;
    874     BS3CPUINSTR4_TEST1_T const BS3_FAR           *pTest;
    875     unsigned                                      iVal;
    876     const char BS3_FAR                           *pszMode;
    877     PBS3TRAPFRAME                                 pTrapFrame;
    878     PBS3REGCTX                                    pCtx;
    879     PBS3EXTCTX                                    pExtCtx;
    880     PBS3EXTCTX                                    pExtCtxOut;
    881     uint8_t BS3_FAR                              *puMemOp;
    882     uint8_t BS3_FAR                              *puMemOpAlias;
    883     uint8_t                                       cbMemOp;
    884     uint8_t                                       cbOperand;
    885     uint8_t                                       cbInstr;
    886     uint8_t                                       bXcptExpect;
    887     bool                                          fSseInstr;
    888     bool                                          fAvxInstr;
    889     uint16_t                                      idTestStep;
     877    /** The test execution environment configuration. */
     878    BS3CPUINSTR4_CONFIG_T const BS3_FAR *pConfig;
     879    /** The instruction being tested. */
     880    BS3CPUINSTR4_TEST1_T const BS3_FAR  *pTest;
     881    /** Which iteration of the test value is this. */
     882    unsigned                             iVal;
     883    /** The testing mode (e.g. real, protected, paged and permutations). */
     884    const char BS3_FAR                  *pszMode;
     885    /** The exception (trap) frame. */
     886    PBS3TRAPFRAME                        pTrapFrame;
     887    /** The general-purpose register context. */
     888    PBS3REGCTX                           pCtx;
     889    /** The extended (FPU) register context. */
     890    PBS3EXTCTX                           pExtCtx;
     891    /** The output extended (FPU) register context. */
     892    PBS3EXTCTX                           pExtCtxOut;
     893    /** The memory operand buffer. */
     894    uint8_t BS3_FAR                     *puMemOp;
     895    /** The memory operand alias buffer for comparing result. */
     896    uint8_t BS3_FAR                     *puMemOpAlias;
     897    /** Size of the memory operand (and alias) buffer in bytes. */
     898    uint8_t                              cbMemOp;
     899    /** Size of the operand for the instruction (e.g., 8 for MMX, 16 for SSE etc. */
     900    uint8_t                              cbOperand;
     901    /** Size of the instruction opcode. */
     902    uint8_t                              cbInstr;
     903    /** The expected exception while/after executing the instruction. */
     904    uint8_t                              bXcptExpect;
     905    /** Whether this is an SSE instruction. */
     906    bool                                 fSseInstr;
     907    /** Whether this is an AVX instruction. */
     908    bool                                 fAvxInstr;
     909    /** The test iteration step. */
     910    uint16_t                             idTestStep;
    890911} BS3CPUINSTR4_TEST1_CTX_T;
    891912/** Pointer to a test 1 context. */
     
    13011322    static BS3CPUINSTR4_TEST1_VALUES_PD_T const s_aValues[] =
    13021323    {
     1324    /*
     1325     * Zero.
     1326     */
    13031327    /* 0*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13041328            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    13111335            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13121336              /*mask     */ ~X86_MXCSR_XCPT_MASK,
    1313               /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
     1337              /*daz,fz,rc*/ 0, 1, X86_MXCSR_RC_NEAREST,
    13141338              /*flags    */ 0 },
    1315     /* 2*/{ { /*src2     */ { BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1339    /* 2*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1340            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1341            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1342              /*mask     */ X86_MXCSR_XCPT_MASK,
     1343              /*daz,fz,rc*/ 1, 0, X86_MXCSR_RC_DOWN,
     1344              /*flags    */ 0 },
     1345    /* 3*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1346            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1347            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1348              /*mask     */ ~X86_MXCSR_XCPT_MASK,
     1349              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_UP,
     1350              /*flags    */ 0 },
     1351    /* 4*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1352            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1353            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1354              /*mask     */ X86_MXCSR_XCPT_MASK,
     1355              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO,
     1356              /*flags    */ 0 },
     1357    /*
     1358     * Infinity.
     1359     */
     1360    /* 5*/{ { /*src2     */ { BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13161361            { /*src1     */ { BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13171362            { /* =>      */ { BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    13191364              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    13201365              /*flags    */ X86_MXCSR_IE },
    1321     /* 3*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_INF(1),  BS3_FP64_ZERO(0),  BS3_FP64_ZERO(0) } },
    1322             { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0),  BS3_FP64_ZERO(0),  BS3_FP64_ZERO(0) } },
    1323             { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_QNAN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1324               /*mask     */ X86_MXCSR_IM,
     1366    /* 6*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1367            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1368            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1369              /*mask     */ ~X86_MXCSR_IM,
     1370              /*daz,fz,rc*/ 0, 1, X86_MXCSR_RC_DOWN,
     1371              /*flags    */ X86_MXCSR_IE },
     1372    /* 7*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_INF(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1373            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1374            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_INF(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1375              /*mask     */ ~X86_MXCSR_IM,
     1376              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_UP,
     1377              /*flags    */ X86_MXCSR_IE },
     1378    /* 8*/{ { /*src2     */ { BS3_FP64_INF(0),  BS3_FP64_INF(1),  BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1379            { /*src1     */ { BS3_FP64_INF(1),  BS3_FP64_INF(0),  BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1380            { /* =>      */ { BS3_FP64_QNAN(1), BS3_FP64_QNAN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1381              /*mask     */ X86_MXCSR_XCPT_MASK,
     1382              /*daz,fz,rc*/ 1, 0, X86_MXCSR_RC_ZERO,
     1383              /*flags    */ X86_MXCSR_IE },
     1384    /*
     1385     * Overflow.
     1386     */
     1387    /* 9*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1388            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1389            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1390              /*mask     */ ~X86_MXCSR_XCPT_MASK,
    13251391              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    1326               /*flags    */ X86_MXCSR_IE },
    1327     /* 4*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_VAL_1(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1392              /*flags    */ X86_MXCSR_OE },
     1393    /*10*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1394            { /*src1     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1395            { /* =>      */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1396              /*mask     */ ~X86_MXCSR_XCPT_MASK,
     1397              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
     1398              /*flags    */ X86_MXCSR_OE },
     1399    /*11*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1400            { /*src1     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1401            { /* =>      */ { BS3_FP64_INF(0),        BS3_FP64_VAL(1, 0, 2),  BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1402              /*mask     */ X86_MXCSR_OM | X86_MXCSR_PM,
     1403              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_NEAREST,
     1404              /*flags    */ X86_MXCSR_OE | X86_MXCSR_PE },
     1405    /*12*/{ { /*src2     */ { BS3_FP64_NORMAL_MIN(1), BS3_FP64_NORMAL_MAX(0),  BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1406            { /*src1     */ { BS3_FP64_NORMAL_MIN(1), BS3_FP64_NORMAL_MAX(0),  BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1407            { /* =>      */ { BS3_FP64_VAL(1, 0, 2),  BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1408              /*mask     */ X86_MXCSR_OM | X86_MXCSR_PM,
     1409              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO,
     1410              /*flags    */ X86_MXCSR_OE | X86_MXCSR_PE },
     1411    /*13*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1412            { /*src1     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1413            { /* =>      */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1414              /*mask     */ X86_MXCSR_XCPT_MASK,
     1415              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_ZERO,
     1416              /*flags    */ X86_MXCSR_OE | X86_MXCSR_PE },
     1417    /*
     1418     * Normals.
     1419     */
     1420    /*14*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_VAL_1(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13281421            { /*src1     */ { BS3_FP64_NORMAL_MAX(1), BS3_FP64_NORMAL_VAL_1(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13291422            { /* =>      */ { BS3_FP64_ZERO(0),       BS3_FP64_ZERO(0),         BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    13311424              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    13321425              /*flags    */ 0 },
    1333     /* 5*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1334             { /*src1     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MIN(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1335             { /* =>      */ { BS3_FP64_INF(0),        BS3_FP64_VAL(1, 0, 2),  BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1336               /*mask     */ X86_MXCSR_OM | X86_MXCSR_PM,
    1337               /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    1338               /*flags    */ X86_MXCSR_OE | X86_MXCSR_PE },
    1339     /* 6*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1340             { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1341             { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1342               /*mask     */ ~X86_MXCSR_XCPT_MASK,
    1343               /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    1344               /*flags    */ X86_MXCSR_OE },
    1345     /* 7*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1346             { /*src1     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1347             { /* =>      */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    1348               /*mask     */ X86_MXCSR_XCPT_MASK,
    1349               /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_ZERO,
    1350               /*flags    */ X86_MXCSR_OE | X86_MXCSR_PE },
    1351     /* 8*/{ { /*src2     */ { BS3_FP64_VAL(0, 0,               0x409)/*1024*/, BS3_FP64_VAL(0, 0xb800000000000, 0x404)/*55*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1426    /*15*/{ { /*src2     */ { BS3_FP64_VAL(0, 0,               0x409)/*1024*/, BS3_FP64_VAL(0, 0xb800000000000, 0x404)/*55*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13521427            { /*src1     */ { BS3_FP64_VAL(0, 0,               0x408)/* 512*/, BS3_FP64_VAL(0, 0xc000000000000, 0x401)/* 7*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13531428            { /* =>      */ { BS3_FP64_VAL(0, 0x8000000000000, 0x409)/*1536*/, BS3_FP64_VAL(0, 0xf000000000000, 0x404)/*62*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    13551430              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    13561431              /*flags    */ 0 },
    1357     /* 9*/{ { /*src2     */ { BS3_FP64_VAL(0, 0x26580b4800000, 0x41d)/* 1234567890*/, BS3_FP64_VAL(0, 0xd6f3458800000, 0x41c)/*987654321*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1432    /*16*/{ { /*src2     */ { BS3_FP64_VAL(0, 0x26580b4800000, 0x41d)/* 1234567890*/, BS3_FP64_VAL(0, 0xd6f3458800000, 0x41c)/*987654321*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13581433            { /*src1     */ { BS3_FP64_VAL(1, 0x26580b4800000, 0x41d)/*-1234567890*/, BS3_FP64_VAL(1, 0x9000000000000, 0x405)/*     -100*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    13591434            { /* =>      */ { BS3_FP64_ZERO(0),                                       BS3_FP64_VAL(0, 0xd6f3426800000, 0x41c)/*987654221*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
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