- Timestamp:
- May 24, 2024 8:19:28 AM (11 months ago)
- svn:sync-xref-src-repo-rev:
- 163336
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4.c32
r104766 r104768 67 67 /** The min fraction value for a single-precision floating-point normal. */ 68 68 #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 69 73 70 74 #define BS3_FP32_NORMAL_MAX(a_Sign) RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MAX, BS3_FP32_EXP_NORMAL_MAX) 71 75 #define BS3_FP32_NORMAL_MIN(a_Sign) RTFLOAT32U_INIT_C(a_Sign, BS3_FP32_FRACTION_NORMAL_MIN, BS3_FP32_EXP_NORMAL_MIN) 72 76 #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) 73 78 #define BS3_FP32_VAL(a_Sign, a_Frac, a_Exp) RTFLOAT32U_INIT_C(a_Sign, a_Frac, a_Exp) 74 79 #define BS3_FP32_INF(a_Sign) RTFLOAT32U_INIT_INF(a_Sign) … … 85 90 #define BS3_FP32_NORMAL_VAL_2(a_Sign) RTFLOAT32U_INIT_C(a_Sign, 0x7e117a, 0x7e) 86 91 #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) 87 94 88 95 /* … … 97 104 /** The min fraction value for a double-precision floating-point normal. */ 98 105 #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 99 110 100 111 #define BS3_FP64_NORMAL_MAX(a_Sign) RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MAX, BS3_FP64_EXP_NORMAL_MAX) 101 112 #define BS3_FP64_NORMAL_MIN(a_Sign) RTFLOAT64U_INIT_C(a_Sign, BS3_FP64_FRACTION_NORMAL_MIN, BS3_FP64_EXP_NORMAL_MIN) 102 113 #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) 103 115 #define BS3_FP64_VAL(a_Sign, a_Frac, a_Exp) RTFLOAT64U_INIT_C(a_Sign, a_Frac, a_Exp) 104 116 #define BS3_FP64_INF(a_Sign) RTFLOAT64U_INIT_INF(a_Sign) … … 116 128 #define BS3_FP64_NORMAL_VAL_2(a_Sign) RTFLOAT64U_INIT_C(a_Sign, 0xca5cadea1b1ed, 0x3ae) 117 129 #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) 118 132 119 133 … … 875 889 typedef struct BS3CPUINSTR4_TEST1_CTX_T 876 890 { 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. */ 911 908 } BS3CPUINSTR4_TEST1_CTX_T; 912 909 /** Pointer to a test 1 context. */ … … 1436 1433 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1437 1434 /*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 }, 1438 1447 }; 1439 1448
Note:
See TracChangeset
for help on using the changeset viewer.