VirtualBox

Changeset 104847 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 5, 2024 8:26:34 AM (10 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163440
Message:

ValidationKit/bootsectors: bugref:10658 SIMD FP testcase: Denormals.

File:
1 edited

Legend:

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

    r104825 r104847  
    108108/** Fraction width (in bits) for the double-precision floating-point format. */
    109109#define BS3_FP64_FRACTION_BITS                RTFLOAT64U_FRACTION_BITS
     110/** The max fraction value for a double-precision floating-point denormal. */
     111#define BS3_FP64_FRACTION_DENORMAL_MAX        0xfffffffffffff
     112/** The min fraction value for a double-precision floating-point denormal. */
     113#define BS3_FP64_FRACTION_DENORMAL_MIN        1
    110114
    111115#define BS3_FP64_NORMAL_MAX(a_Sign)           RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MAX, BS3_FP64_EXP_NORMAL_MAX)
     
    132136/* The minimum integer value without losing precision. */
    133137#define BS3_FP64_NORMAL_SAFE_INT_MIN(a_Sign)  RTFLOAT64U_INIT_C(a_Sign, 0, 1)
     138/** The maximum denormal value. */
     139#define BS3_FP64_DENORMAL_MAX(a_Sign)         RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_DENORMAL_MAX, 0)
     140/** The maximum denormal value. */
     141#define BS3_FP64_DENORMAL_MIN(a_Sign)         RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_DENORMAL_MIN, 0)
    134142
    135143
     
    12001208                            BS3CPUINSTR4_TEST1_CTX_T TestCtx;
    12011209                            if (BS3_SKIPIT(bRing, iCfg, iTest, iVal, 0))
     1210                                continue;
     1211
     1212                            /*
     1213                             * If the hardware does not support DAZ bit and we are testing DE exceptions,
     1214                             * then skip testing them. We still want to test values that set the MXCSR.DAZ
     1215                             * if we are not expecting DE exceptions to make sure DAZ bit in and of itself
     1216                             * is not influencing other cases.
     1217                             */
     1218                            if (   !g_fMxCsrDazSupported
     1219                                && pTest->paValues[iVal].fDenormalsAreZero
     1220                                && (pTest->paValues[iVal].fExpectedMxCsrFlags & X86_MXCSR_DE))
    12021221                                continue;
    12031222
     
    14481467              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_ZERO,
    14491468              /*flags    */ X86_MXCSR_PE },
     1469    /*15*/{ { /*src2     */ { BS3_FP64_VAL(0, 0xc000000000000, 0x3ff)/* 1.75*/, BS3_FP64_NORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0,               0x3fd)/*0.25*/ } },
     1470            { /*src1     */ { BS3_FP64_VAL(1, 0,               0x07d)/*-0.25*/, BS3_FP64_NORMAL_MAX(1), BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0,               0x3fe)/*0.50*/ } },
     1471            { /* =>      */ { BS3_FP64_VAL(0, 0xbffffffffffff, 0x3ff)/* 1.50*/, BS3_FP64_ZERO(1),       BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0x8000000000000, 0x3fe)/*0.75*/ } },
     1472              /*mask     */ X86_MXCSR_XCPT_MASK,
     1473              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_DOWN,
     1474              /*flags    */ X86_MXCSR_PE },
    14501475    /*
    14511476     * Normals.
    14521477     */
    1453     /*15*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_VAL_1(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1478    /*16*/{ { /*src2     */ { BS3_FP64_NORMAL_MAX(0), BS3_FP64_NORMAL_VAL_1(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14541479            { /*src1     */ { BS3_FP64_NORMAL_MAX(1), BS3_FP64_NORMAL_VAL_1(1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14551480            { /* =>      */ { BS3_FP64_ZERO(0),       BS3_FP64_ZERO(0),         BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    14571482              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    14581483              /*flags    */ 0 },
    1459     /*16*/{ { /*src2     */ { BS3_FP64_VAL(0, 0,               0x409)/*1024*/, BS3_FP64_VAL(0, 0xb800000000000, 0x404)/*55*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1484    /*17*/{ { /*src2     */ { BS3_FP64_VAL(0, 0,               0x409)/*1024*/, BS3_FP64_VAL(0, 0xb800000000000, 0x404)/*55*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14601485            { /*src1     */ { BS3_FP64_VAL(0, 0,               0x408)/* 512*/, BS3_FP64_VAL(0, 0xc000000000000, 0x401)/* 7*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14611486            { /* =>      */ { BS3_FP64_VAL(0, 0x8000000000000, 0x409)/*1536*/, BS3_FP64_VAL(0, 0xf000000000000, 0x404)/*62*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    14631488              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    14641489              /*flags    */ 0 },
    1465     /*17*/{ { /*src2     */ { BS3_FP64_VAL(0, 0x26580b4800000, 0x41d)/* 1234567890*/, BS3_FP64_VAL(0, 0xd6f3458800000, 0x41c)/*987654321*/, BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0xcf0033a34f337, 0x432)/*4072598000007579.5*/ } },
     1490    /*18*/{ { /*src2     */ { BS3_FP64_VAL(0, 0x26580b4800000, 0x41d)/* 1234567890*/, BS3_FP64_VAL(0, 0xd6f3458800000, 0x41c)/*987654321*/, BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0xcf0033a34f337, 0x432)/*4072598000007579.5*/ } },
    14661491            { /*src1     */ { BS3_FP64_VAL(1, 0x26580b4800000, 0x41d)/*-1234567890*/, BS3_FP64_VAL(1, 0x9000000000000, 0x405)/*     -100*/, BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0xd6eca42000000, 0x419)/*       123450000.5*/ } },
    14671492            { /* =>      */ { BS3_FP64_ZERO(0),                                       BS3_FP64_VAL(0, 0xd6f3426800000, 0x41c)/*987654221*/, BS3_FP64_ZERO(0), BS3_FP64_VAL(0, 0xcf00348ec5858, 0x432)/*4072598123457580.0*/ } },
     
    14691494              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    14701495              /*flags    */ 0 },
    1471     /*18*/{ { /*src2     */ { BS3_FP64_VAL(0, BS3_FP64_FRACTION_NORMAL_MAX - 1, BS3_FP64_EXP_BIAS + BS3_FP64_FRACTION_BITS), BS3_FP64_NORMAL_SAFE_INT_MAX(0),                                                               BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1496    /*19*/{ { /*src2     */ { BS3_FP64_VAL(0, BS3_FP64_FRACTION_NORMAL_MAX - 1, BS3_FP64_EXP_BIAS + BS3_FP64_FRACTION_BITS), BS3_FP64_NORMAL_SAFE_INT_MAX(0),                                                               BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14721497            { /*src1     */ { BS3_FP64_ONE(0),                                                                               BS3_FP64_ONE(1),                                                                               BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14731498            { /* =>      */ { BS3_FP64_NORMAL_SAFE_INT_MAX(0),                                                               BS3_FP64_VAL(0, BS3_FP64_FRACTION_NORMAL_MAX - 1, BS3_FP64_EXP_BIAS + BS3_FP64_FRACTION_BITS), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    14751500              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO,
    14761501              /*flags    */ 0 },
    1477     /*19*/{ { /*src2     */ { BS3_FP64_NORMAL_SAFE_INT_MAX(0),                                    BS3_FP64_ONE(1),                                                    BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1502    /*20*/{ { /*src2     */ { BS3_FP64_NORMAL_SAFE_INT_MAX(0),                                    BS3_FP64_ONE(1),                                                    BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14781503            { /*src1     */ { BS3_FP64_ONE(0),                                                    BS3_FP64_NORMAL_SAFE_INT_MAX(1),                                    BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
    14791504            { /* =>      */ { BS3_FP64_VAL(0, 0, BS3_FP64_EXP_BIAS + BS3_FP64_FRACTION_BITS + 1), BS3_FP64_VAL(1, 0, BS3_FP64_EXP_BIAS + BS3_FP64_FRACTION_BITS + 1), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     
    14811506              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    14821507              /*flags    */ 0 },
    1483     /*20*/{ { /*src2     */ { BS3_FP64_NORMAL_SAFE_INT_MIN(0), BS3_FP64_ZERO(0),                BS3_FP64_NORMAL_SAFE_INT_MIN(0), BS3_FP64_NORMAL_SAFE_INT_MIN(0) } },
     1508    /*21*/{ { /*src2     */ { BS3_FP64_NORMAL_SAFE_INT_MIN(0), BS3_FP64_ZERO(0),                BS3_FP64_NORMAL_SAFE_INT_MIN(0), BS3_FP64_NORMAL_SAFE_INT_MIN(0) } },
    14841509            { /*src1     */ { BS3_FP64_NORMAL_SAFE_INT_MIN(1), BS3_FP64_NORMAL_SAFE_INT_MIN(1), BS3_FP64_ZERO(0),                BS3_FP64_NORMAL_SAFE_INT_MIN(0) } },
    14851510            { /* =>      */ { BS3_FP64_ZERO(0),                BS3_FP64_NORMAL_SAFE_INT_MIN(1), BS3_FP64_NORMAL_SAFE_INT_MIN(0), BS3_FP64_VAL(0, 0, 2)           } },
    14861511              /*mask     */ ~X86_MXCSR_XCPT_MASK,
    14871512              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO,
     1513              /*flags    */ 0 },
     1514    /*22*/{ { /*src2     */ { BS3_FP64_VAL(0, 0xc122186c3cfd0, 0x42d)/*123456789876543.25*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_NORMAL_SAFE_INT_MIN(1) } },
     1515            { /*src1     */ { BS3_FP64_VAL(0, 0xb88e0395d49b0, 0x42d)/*121098765432102.75*/, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_NORMAL_SAFE_INT_MIN(1) } },
     1516            { /* =>      */ { BS3_FP64_VAL(0, 0xbcd80e0108cc0, 0x42e)/*244555555308646   */, BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_VAL(1, 0, 2)           } },
     1517              /*mask     */ X86_MXCSR_XCPT_MASK,
     1518              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_DOWN,
     1519              /*flags    */ 0 },
     1520    /*
     1521     * Denormals.
     1522     */
     1523    /*23*/{ { /*src2     */ { BS3_FP64_DENORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1524            { /*src1     */ { BS3_FP64_ZERO(0),         BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1525            { /* =>      */ { BS3_FP64_ZERO(0),         BS3_FP64_ZERO(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1526              /*mask     */ ~X86_MXCSR_XCPT_MASK,
     1527              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
     1528              /*flags    */ X86_MXCSR_DE },
     1529    /*24*/{ { /*src2     */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0),         BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1530            { /*src1     */ { BS3_FP64_ZERO(0), BS3_FP64_DENORMAL_MAX(0), BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1531            { /* =>      */ { BS3_FP64_ZERO(0), BS3_FP64_ZERO(0),         BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1532              /*mask     */ X86_MXCSR_XCPT_MASK,
     1533              /*daz,fz,rc*/ 1, 0, X86_MXCSR_RC_NEAREST,
    14881534              /*flags    */ 0 },
    14891535    };
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