VirtualBox

Ignore:
Timestamp:
Jun 10, 2024 9:27:11 AM (8 months ago)
Author:
vboxsync
Message:

ValidationKit/bootsectors: bugref:10658 SIMD FP testcase: [v]addps denormals.

File:
1 edited

Legend:

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

    r104871 r104873  
    7777 *  losing precision. */
    7878#define BS3_FP32_EXP_SAFE_INT_MIN             1
     79/** The max fraction value for a double-precision floating-point denormal. */
     80#define BS3_FP32_FRACTION_DENORMAL_MAX        0x7fffff
     81/** The min fraction value for a double-precision floating-point denormal. */
     82#define BS3_FP32_FRACTION_DENORMAL_MIN        1
    7983
    8084#define BS3_FP32_NORMAL_MAX(a_Sign)           RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MAX, BS3_FP32_EXP_NORMAL_MAX)
     
    100104/* The minimum integer value without losing precision. */
    101105#define BS3_FP32_NORMAL_SAFE_INT_MIN(a_Sign)  RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MIN, BS3_FP32_EXP_SAFE_INT_MIN)
     106
     107/*
     108 * Single-precision floating-point denormals.
     109 */
     110/** The maximum denormal value. */
     111#define BS3_FP32_DENORMAL_MAX(a_Sign)         RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_DENORMAL_MAX, 0)
     112/** The maximum denormal value. */
     113#define BS3_FP32_DENORMAL_MIN(a_Sign)         RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_DENORMAL_MIN, 0)
    102114
    103115/*
     
    139151
    140152/*
    141  * Double-precision floating normals.
     153 * Double-precision floating-point normals.
    142154 * Fraction - 52 bits, all usable.
    143155 * Exponent - 11 bits, least significant bit MBZ.
     
    150162/* The minimum integer value without losing precision. */
    151163#define BS3_FP64_NORMAL_SAFE_INT_MIN(a_Sign)  RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MIN, BS3_FP64_EXP_SAFE_INT_MIN)
     164
     165/*
     166 * Double-precision floating-point denormals.
     167 */
    152168/** The maximum denormal value. */
    153169#define BS3_FP64_DENORMAL_MAX(a_Sign)         RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_DENORMAL_MAX, 0)
     
    14861502              /*daz,fz,rc*/ X86_MXCSR_DAZ, X86_MXCSR_FZ, X86_MXCSR_RC_DOWN,
    14871503              /*flags    */ 0, 0 },
     1504    /*26*/{ { /*src2     */ { BS3_FP32_DENORMAL_MAX(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0)         } },
     1505            { /*src1     */ { BS3_FP32_ZERO(0),         BS3_FP32_DENORMAL_MAX(1), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_DENORMAL_MAX(1) } },
     1506            { /* =>      */ { BS3_FP32_ZERO(0),         BS3_FP32_DENORMAL_MAX(1), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_DENORMAL_MAX(1) } },
     1507              /*mask     */ ~X86_MXCSR_XCPT_MASK,
     1508              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
     1509              /*flags    */ X86_MXCSR_DE, X86_MXCSR_DE },
     1510          { { /*src2     */ { BS3_FP32_ZERO(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0) } },
     1511            { /*src1     */ { BS3_FP32_ZERO(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0) } },
     1512            { /* =>      */ { BS3_FP32_ZERO(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0), BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0), BS3_FP32_ZERO(0) } },
     1513              /*mask     */ X86_MXCSR_XCPT_MASK,
     1514              /*daz,fz,rc*/ X86_MXCSR_DAZ, 0, X86_MXCSR_RC_NEAREST,
     1515              /*flags    */ 0, 0 },
     1516          { { /*src2     */ { BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MAX(0) } },
     1517            { /*src1     */ { BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MIN(0), BS3_FP32_DENORMAL_MAX(0), BS3_FP32_DENORMAL_MIN(0) } },
     1518            { /* =>      */ { BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),         BS3_FP32_ZERO(0),        } },
     1519              /*mask     */ X86_MXCSR_XCPT_MASK,
     1520              /*daz,fz,rc*/ X86_MXCSR_DAZ, X86_MXCSR_FZ, X86_MXCSR_RC_UP,
     1521              /*flags    */ 0, 0 },
    14881522          /** @todo Denormals; Underflow, Precision; Rounding, FZ etc. */
    14891523    };
Note: See TracChangeset for help on using the changeset viewer.

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