Changeset 104949 in vbox for trunk/src/VBox/ValidationKit
- Timestamp:
- Jun 18, 2024 7:07:18 AM (6 months ago)
- Location:
- trunk/src/VBox/ValidationKit/bootsectors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4-template.mac
r104875 r104949 186 186 EMIT_INSTR_PLUS_ICEBP_C64 vaddps, YMM8, YMM9, FSxBX 187 187 188 ; 189 ;; [v]addss 190 ; 191 EMIT_INSTR_PLUS_ICEBP addss, XMM1, XMM2 192 EMIT_INSTR_PLUS_ICEBP addss, XMM1, FSxBX 193 EMIT_INSTR_PLUS_ICEBP_C64 addss, XMM8, XMM9 194 EMIT_INSTR_PLUS_ICEBP_C64 addss, XMM8, FSxBX 195 196 EMIT_INSTR_PLUS_ICEBP vaddss, XMM1, XMM2, XMM3 197 EMIT_INSTR_PLUS_ICEBP vaddss, XMM1, XMM2, FSxBX 198 EMIT_INSTR_PLUS_ICEBP_C64 vaddss, XMM8, XMM9, XMM10 199 EMIT_INSTR_PLUS_ICEBP_C64 vaddss, XMM8, XMM9, FSxBX 200 188 201 %endif ; BS3_INSTANTIATING_CMN 189 202 -
trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-instr-4.c32
r104875 r104949 290 290 291 291 /** 292 * YMM scalar single-precision floating-point register. 293 * @todo move to x86.h? 294 */ 295 typedef union X86YMMFLOATSSREG 296 { 297 /** Scalar single-precision floating-point view. */ 298 RTFLOAT32U ar32[8]; 299 /** 256-bit integer view. */ 300 RTUINT256U ymm; 301 } X86YMMFLOATSSREG; 302 # ifndef VBOX_FOR_DTRACE_LIB 303 AssertCompileSize(X86YMMFLOATSSREG, 32); 304 AssertCompileSize(X86YMMFLOATSSREG, sizeof(X86YMMREG)); 305 # endif 306 /** Pointer to a YMM scalar single-precision floating-point register. */ 307 typedef X86YMMFLOATSSREG BS3_FAR *PX86YMMFLOATSSREG; 308 /** Pointer to a const YMM scalar single-precision floating-point register. */ 309 typedef X86YMMFLOATSSREG const BS3_FAR *PCX86YMMFLOATSSREG; 310 311 /** 312 * YMM scalar double-precision floating-point register. 313 * @todo move to x86.h? 314 */ 315 typedef union X86YMMFLOATSDREG 316 { 317 /** Scalar double-precision floating-point view. */ 318 RTFLOAT64U ar64[3]; 319 /** 256-bit integer view. */ 320 RTUINT256U ymm; 321 } X86YMMFLOATSDREG; 322 # ifndef VBOX_FOR_DTRACE_LIB 323 AssertCompileSize(X86YMMFLOATSDREG, 32); 324 AssertCompileSize(X86YMMFLOATSDREG, sizeof(X86YMMREG)); 325 # endif 326 /** Pointer to a YMM scalar double-precision floating-point register. */ 327 typedef X86YMMFLOATSDREG BS3_FAR *PX86YMMFLOATSDREG; 328 /** Pointer to a const YMM scalar double-precision floating-point register. */ 329 typedef X86YMMFLOATSDREG const BS3_FAR *PCX86YMMFLOATSDREG; 330 331 /** 292 332 * YMM scalar quadruple-precision floating-point register. 293 333 * @todo move to x86.h? … … 345 385 static uint8_t BS3_FAR *g_pbBufAliasAlloc; 346 386 347 /** Exception type \# 1test configurations, 16 & 32 bytes strictly aligned. */348 static const BS3CPUINSTR4_CONFIG_T g_aXcptConfig 1[] =387 /** Exception type \#2 test configurations, 16 & 32 bytes strictly aligned. */ 388 static const BS3CPUINSTR4_CONFIG_T g_aXcptConfig2[] = 349 389 { 350 390 /* … … 372 412 }; 373 413 414 /** Exception type \#3 test configurations (< 16-byte memory argument). */ 415 static const BS3CPUINSTR4_CONFIG_T g_aXcptConfig3[] = 416 { 417 /* 418 * X87 SSE SSE SSE AVX SSE AVX AVX SSE AVX AMD/SSE <-- applies to 419 * +AVX +AVX +AMD/SSE +AMD/SSE 420 * CR0 CR0 CR0 CR4 CR4 CR4 XCR0 XCR0 MXCSR 421 * MP, EM, TS, OSFXSR, OSXSAVE, OSXMMEXCPT SSE, AVX, fAligned, AC/AM, MM, bXcptSse, bXcptAvx */ 422 { 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_DB, X86_XCPT_DB }, /* #0 */ 423 { 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, X86_XCPT_DB, X86_XCPT_DB }, /* #1 */ 424 { 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_DB, X86_XCPT_DB }, /* #2 */ 425 { 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_DB }, /* #3 */ 426 { 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_NM, X86_XCPT_NM }, /* #4 */ 427 { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_NM }, /* #5 */ 428 { 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, X86_XCPT_UD, X86_XCPT_DB }, /* #6 */ 429 { 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, X86_XCPT_DB, X86_XCPT_UD }, /* #7 */ 430 { 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, X86_XCPT_DB, X86_XCPT_UD }, /* #8 */ 431 { 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, X86_XCPT_DB, X86_XCPT_UD }, /* #9 */ 432 /* Memory misalignment and alignment checks: */ 433 { 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, X86_XCPT_DB, X86_XCPT_DB }, /* #10 */ /* [Avx]:DB */ 434 { 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, X86_XCPT_AC, X86_XCPT_AC }, /* #11 */ /* [Avx]:AC */ 435 { 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, X86_XCPT_DB, X86_XCPT_DB }, /* #12 */ 436 /* AMD only: */ 437 { 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, X86_XCPT_DB, X86_XCPT_GP }, /* #13 */ 438 { 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, X86_XCPT_AC, X86_XCPT_GP }, /* #14 */ 439 }; 374 440 375 441 … … 887 953 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_PD_T, f128ExpectedMxCsrFlags, BS3CPUINSTR4_TEST1_VALUES_T, f128ExpectedMxCsrFlags); 888 954 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_PD_T, f256ExpectedMxCsrFlags, BS3CPUINSTR4_TEST1_VALUES_T, f256ExpectedMxCsrFlags); 955 956 /* 957 * Test type #1. 958 * Scalar single-precision. 959 */ 960 typedef struct BS3CPUINSTR4_TEST1_VALUES_SS_T 961 { 962 X86YMMFLOATSSREG uSrc2; /**< Second source operand. */ 963 X86YMMFLOATSSREG uSrc1; /**< uDstIn for SSE */ 964 X86YMMFLOATSSREG uDstOut; /**< Destination output. */ 965 uint32_t fMxCsrMask; /**< MXCSR exception mask. */ 966 uint32_t fDenormalsAreZero; /**< DAZ (Denormals-Are-Zero) exception mask. */ 967 uint32_t fFlushToZero; /**< Flush-To-Zero (FZ) exception mask. */ 968 uint32_t fRoundingCtlMask; /**< Rounding control mask (X86_MXCSR_RC_MASK) to use. */ 969 uint32_t f128ExpectedMxCsrFlags; /**< Expected MXCSR exception flags for 128-bit instruction. */ 970 uint32_t f256ExpectedMxCsrFlags; /**< Expected MXCSR exception flags for 256-bit instructions. */ 971 } BS3CPUINSTR4_TEST1_VALUES_SS_T; 972 AssertCompile(sizeof(BS3CPUINSTR4_TEST1_VALUES_SS_T) == sizeof(BS3CPUINSTR4_TEST1_VALUES_T)); 973 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, uSrc2, BS3CPUINSTR4_TEST1_VALUES_T, uSrc2); 974 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, uSrc1, BS3CPUINSTR4_TEST1_VALUES_T, uSrc1); 975 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, uDstOut, BS3CPUINSTR4_TEST1_VALUES_T, uDstOut); 976 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, fMxCsrMask, BS3CPUINSTR4_TEST1_VALUES_T, fMxCsrMask); 977 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, fDenormalsAreZero, BS3CPUINSTR4_TEST1_VALUES_T, fDenormalsAreZero); 978 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, fFlushToZero, BS3CPUINSTR4_TEST1_VALUES_T, fFlushToZero); 979 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, fRoundingCtlMask, BS3CPUINSTR4_TEST1_VALUES_T, fRoundingCtlMask); 980 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, f128ExpectedMxCsrFlags, BS3CPUINSTR4_TEST1_VALUES_T, f128ExpectedMxCsrFlags); 981 AssertCompileMembersSameSizeAndOffset(BS3CPUINSTR4_TEST1_VALUES_SS_T, f256ExpectedMxCsrFlags, BS3CPUINSTR4_TEST1_VALUES_T, f256ExpectedMxCsrFlags); 889 982 890 983 /* … … 1296 1389 bXcptExpect, bs3CpuInstr4XcptName(bXcptExpect), fSseInstr ? "SSE" : "AVX", cbOperand * 8); 1297 1390 else 1298 Bs3TestFailedF("%s: ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%u %s, puMemOp=%p, EFLAGS=%#RX32, CR0=%#RX32,%s %u-bit)",1391 Bs3TestFailedF("%s: ring-%d/cfg#%u/test#%u/value#%u failed (bXcptExpect=%u %s, puMemOp=%p, EFLAGS=%#RX32, %s %u-bit)", 1299 1392 Bs3GetModeName(bMode), bRing, iCfg, iTest, iVal, 1300 1393 bXcptExpect, bs3CpuInstr4XcptName(bXcptExpect), puMemOp, 1301 TrapFrame.Ctx.rflags.u32, TrapFrame.Ctx.cr0,fSseInstr ? "SSE" : "AVX", cbOperand * 8);1394 TrapFrame.Ctx.rflags.u32, fSseInstr ? "SSE" : "AVX", cbOperand * 8); 1302 1395 Bs3TestPrintf("\n"); 1303 1396 } … … 1566 1659 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 1567 1660 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 1568 g_aXcptConfig 1, RT_ELEMENTS(g_aXcptConfig1));1661 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 1569 1662 } 1570 1663 … … 1801 1894 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 1802 1895 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 1803 g_aXcptConfig1, RT_ELEMENTS(g_aXcptConfig1)); 1896 g_aXcptConfig2, RT_ELEMENTS(g_aXcptConfig2)); 1897 } 1898 1899 /* 1900 * [V]ADDSS. 1901 */ 1902 BS3_DECL_FAR(uint8_t) bs3CpuInstr4_v_addss(uint8_t bMode) 1903 { 1904 static BS3CPUINSTR4_TEST1_VALUES_SS_T const s_aValues[] = 1905 { 1906 /* 0*/{ { /*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) } }, 1907 { /*src1 */ { 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) } }, 1908 { /* => */ { 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) } }, 1909 /*mask */ X86_MXCSR_XCPT_MASK, 1910 /*daz,fz,rc*/ 0, 0, X86_MXCSR_RC_NEAREST, 1911 /*flags */ 0, 0 }, 1912 }; 1913 1914 static BS3CPUINSTR4_TEST1_T const s_aTests16[] = 1915 { 1916 { bs3CpuInstr4_addss_XMM1_XMM2_icebp_c16, 255, RM_REG, T_SSE, 1, 1, 2, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1917 { bs3CpuInstr4_addss_XMM1_FSxBX_icebp_c16, 255, RM_MEM, T_SSE, 1, 1, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1918 1919 { bs3CpuInstr4_vaddss_XMM1_XMM2_XMM3_icebp_c16, 255, RM_REG, T_AVX_128, 1, 2, 3, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1920 { bs3CpuInstr4_vaddss_XMM1_XMM2_FSxBX_icebp_c16, X86_XCPT_AC, RM_MEM, T_AVX_128, 1, 2, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1921 }; 1922 static BS3CPUINSTR4_TEST1_T const s_aTests32[] = 1923 { 1924 { bs3CpuInstr4_addss_XMM1_XMM2_icebp_c32, 255, RM_REG, T_SSE, 1, 1, 2, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1925 { bs3CpuInstr4_addss_XMM1_FSxBX_icebp_c32, 255, RM_MEM, T_SSE, 1, 1, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1926 1927 { bs3CpuInstr4_vaddss_XMM1_XMM2_XMM3_icebp_c32, 255, RM_REG, T_AVX_128, 1, 2, 3, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1928 { bs3CpuInstr4_vaddss_XMM1_XMM2_FSxBX_icebp_c32, X86_XCPT_AC, RM_MEM, T_AVX_128, 1, 2, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1929 }; 1930 static BS3CPUINSTR4_TEST1_T const s_aTests64[] = 1931 { 1932 { bs3CpuInstr4_addss_XMM1_XMM2_icebp_c64, 255, RM_REG, T_SSE, 1, 1, 2, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1933 { bs3CpuInstr4_addss_XMM1_FSxBX_icebp_c64, 255, RM_MEM, T_SSE, 1, 1, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1934 1935 { bs3CpuInstr4_vaddss_XMM1_XMM2_XMM3_icebp_c64, 255, RM_REG, T_AVX_128, 1, 2, 3, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1936 { bs3CpuInstr4_vaddss_XMM1_XMM2_FSxBX_icebp_c64, X86_XCPT_AC, RM_MEM, T_AVX_128, 1, 2, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1937 1938 { bs3CpuInstr4_addss_XMM8_XMM9_icebp_c64, 255, RM_REG, T_SSE, 8, 8, 9, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1939 { bs3CpuInstr4_addss_XMM8_FSxBX_icebp_c64, X86_XCPT_AC, RM_MEM, T_SSE, 8, 8, 255, RT_ELEMENTS(s_aValues), (BS3CPUINSTR4_TEST1_VALUES_T *)s_aValues }, 1940 }; 1941 1942 static BS3CPUINSTR4_TEST1_MODE_T const s_aTests[3] = BS3CPUINSTR4_TEST1_MODES_INIT(s_aTests16, s_aTests32, s_aTests64); 1943 unsigned const iTest = BS3CPUINSTR4_TEST_MODES_INDEX(bMode); 1944 return bs3CpuInstr4_WorkerTestType1(bMode, s_aTests[iTest].paTests, s_aTests[iTest].cTests, 1945 g_aXcptConfig3, RT_ELEMENTS(g_aXcptConfig3)); 1804 1946 } 1805 1947 … … 1826 1968 { "[v]addps", bs3CpuInstr4_v_addps, 0 }, 1827 1969 { "[v]addpd", bs3CpuInstr4_v_addpd, 0 }, 1970 { "[v]addss", bs3CpuInstr4_v_addss, 0 }, 1828 1971 #endif 1829 1972 };
Note:
See TracChangeset
for help on using the changeset viewer.