VirtualBox

Changeset 104768 in vbox for trunk/src


Ignore:
Timestamp:
May 24, 2024 8:19:28 AM (11 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163336
Message:

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

File:
1 edited

Legend:

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

    r104766 r104768  
    6767/** The min fraction value for a single-precision floating-point normal. */
    6868#define BS3_FP32_FRACTION_NORMAL_MIN          0
     69/** The exponent bias for the single-precision floating-point format. */
     70#define BS3_FP32_EXP_BIAS                     RTFLOAT32U_EXP_BIAS
     71/** Fraction width (in bits) for the single-precision floating-point format. */
     72#define BS3_FP32_FRACTION_BITS                RTFLOAT32U_FRACTION_BITS
    6973
    7074#define BS3_FP32_NORMAL_MAX(a_Sign)           RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MAX, BS3_FP32_EXP_NORMAL_MAX)
    7175#define BS3_FP32_NORMAL_MIN(a_Sign)           RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MIN, BS3_FP32_EXP_NORMAL_MIN)
    7276#define BS3_FP32_ZERO(a_Sign)                 RTFLOAT32U_INIT_ZERO(a_Sign)
     77#define BS3_FP32_ONE(a_Sign)                  RTFLOAT32U_INIT_C(a_Sign, 0, RTFLOAT32U_EXP_BIAS)
    7378#define BS3_FP32_VAL(a_Sign, a_Frac, a_Exp)   RTFLOAT32U_INIT_C(a_Sign, a_Frac, a_Exp)
    7479#define BS3_FP32_INF(a_Sign)                  RTFLOAT32U_INIT_INF(a_Sign)
     
    8590#define BS3_FP32_NORMAL_VAL_2(a_Sign)         RTFLOAT32U_INIT_C(a_Sign, 0x7e117a, 0x7e)
    8691#define BS3_FP32_NORMAL_VAL_3(a_Sign)         RTFLOAT32U_INIT_C(a_Sign, 0x5b5b5b, 0x9a)
     92/* The maximum integer value (all 23 + 1 implied bit of the fraction part set) without losing precision. */
     93#define BS3_FP32_NORMAL_SAFE_INT_MAX(a_Sign)  RTFLOAT64U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MAX, BS3_FP32_EXP_BIAS + BS3_FP32_FRACTION_BITS)
    8794
    8895/*
     
    97104/** The min fraction value for a double-precision floating-point normal. */
    98105#define BS3_FP64_FRACTION_NORMAL_MIN          0
     106/** The exponent bias for the double-precision floating-point format. */
     107#define BS3_FP64_EXP_BIAS                     RTFLOAT64U_EXP_BIAS
     108/** Fraction width (in bits) for the double-precision floating-point format. */
     109#define BS3_FP64_FRACTION_BITS                RTFLOAT64U_FRACTION_BITS
    99110
    100111#define BS3_FP64_NORMAL_MAX(a_Sign)           RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MAX, BS3_FP64_EXP_NORMAL_MAX)
    101112#define BS3_FP64_NORMAL_MIN(a_Sign)           RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MIN, BS3_FP64_EXP_NORMAL_MIN)
    102113#define BS3_FP64_ZERO(a_Sign)                 RTFLOAT64U_INIT_ZERO(a_Sign)
     114#define BS3_FP64_ONE(a_Sign)                  RTFLOAT64U_INIT_C(a_Sign, 0, RTFLOAT64U_EXP_BIAS)
    103115#define BS3_FP64_VAL(a_Sign, a_Frac, a_Exp)   RTFLOAT64U_INIT_C(a_Sign, a_Frac, a_Exp)
    104116#define BS3_FP64_INF(a_Sign)                  RTFLOAT64U_INIT_INF(a_Sign)
     
    116128#define BS3_FP64_NORMAL_VAL_2(a_Sign)         RTFLOAT64U_INIT_C(a_Sign, 0xca5cadea1b1ed, 0x3ae)
    117129#define BS3_FP64_NORMAL_VAL_3(a_Sign)         RTFLOAT64U_INIT_C(a_Sign, 0xb5b5b5b5b5b5b, 0xffe)
     130/* The maximum integer value (all 52 + 1 implied bit of the fraction part set) without losing precision. */
     131#define BS3_FP64_NORMAL_SAFE_INT_MAX(a_Sign)  RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MAX, BS3_FP64_EXP_BIAS + BS3_FP64_FRACTION_BITS)
    118132
    119133
     
    875889typedef struct BS3CPUINSTR4_TEST1_CTX_T
    876890{
    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;
     891    BS3CPUINSTR4_CONFIG_T const BS3_FAR *pConfig;      /**< The test execution environment configuration. */
     892    BS3CPUINSTR4_TEST1_T const BS3_FAR  *pTest;        /**< The instruction being tested. */
     893    unsigned                             iVal;         /**< Which iteration of the test value is this. */
     894    const char BS3_FAR                  *pszMode;      /**< The testing mode (e.g. real, protected, paged and permutations). */
     895    PBS3TRAPFRAME                        pTrapFrame;   /**< The exception (trap) frame. */
     896    PBS3REGCTX                           pCtx;         /**< The general-purpose register context. */
     897    PBS3EXTCTX                           pExtCtx;      /**< The extended (FPU) register context. */
     898    PBS3EXTCTX                           pExtCtxOut;   /**< The output extended (FPU) register context. */
     899    uint8_t BS3_FAR                     *puMemOp;      /**< The memory operand buffer. */
     900    uint8_t BS3_FAR                     *puMemOpAlias; /**< The memory operand alias buffer for comparing result. */
     901    uint8_t                              cbMemOp;      /**< Size of the memory operand (and alias) buffer in bytes. */
     902    uint8_t                              cbOperand;    /**< Size of the instruction operand (8 for MMX, 16 for SSE etc). */
     903    uint8_t                              cbInstr;      /**< Size of the instruction opcode. */
     904    uint8_t                              bXcptExpect;  /**< The expected exception while/after executing the instruction. */
     905    bool                                 fSseInstr;    /**< Whether this is an SSE instruction. */
     906    bool                                 fAvxInstr;    /**< Whether this is an AVX instruction. */
     907    uint16_t                             idTestStep;   /**< The test iteration step. */
    911908} BS3CPUINSTR4_TEST1_CTX_T;
    912909/** Pointer to a test 1 context. */
     
    14361433              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
    14371434              /*flags    */ 0 },
     1435    /*17*/{ { /*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) } },
     1436            { /*src1     */ { BS3_FP64_ONE(0),                                                                               BS3_FP64_ONE(1),                                                                               BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1437            { /* =>      */ { 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) } },
     1438              /*mask     */ X86_MXCSR_XCPT_MASK,
     1439              /*daz,fz,rc*/ 1, 1, X86_MXCSR_RC_ZERO,
     1440              /*flags    */ 0 },
     1441    /*18*/{ { /*src2     */ { BS3_FP64_NORMAL_SAFE_INT_MAX(0),                                    BS3_FP64_ONE(1),                                                    BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1442            { /*src1     */ { BS3_FP64_ONE(0),                                                    BS3_FP64_NORMAL_SAFE_INT_MAX(1),                                    BS3_FP64_ZERO(0), BS3_FP64_ZERO(0) } },
     1443            { /* =>      */ { 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) } },
     1444              /*mask     */ ~X86_MXCSR_XCPT_MASK,
     1445              /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST,
     1446              /*flags    */ 0 },
    14381447    };
    14391448
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