test(shader): cover the s_cmpk compares and count them as tested variants #363
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/363"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by DotDebian on 2026-10-02T15:07:23Z.
What
The twelve SOPK compares (
S_CMPK_{EQ,LG,GT,GE,LT,LE}_{I32,U32}, opcodes 0x03-0x0e) already decode onto the SOPC compare opcodes with the 16-bit immediate as second source, buttools/progress.pycounts shared-handler variants only once they are tested (#148), and onlyS_CMPK_LT_I32andS_CMPK_LE_U32were counted.agc_driver_scalar_sopk_compare: a compute program runs the twelve compares on ten values taken from user data registers against six immediates (720 compares), reads SCC back throughs_cselect_b32and stores one mask per value/immediate pair. The expected results follow the RDNA ISA: the I32 compares sign-extend SIMM16, the U32 compares zero-extend it. The values and immediates sit on both sides of 0x7fff/0x8000 and of the 32-bit sign bit, so the two extensions give different answers.OPCODE_VARIANTS.progress.py --comparereports SOPK +10 (shaders 695 -> 705 of 1166).No change to the recompiler: the test found no defect.
Tested
Windows 11, MinGW-w64 GCC 15.2.0, NVIDIA RTX 5080.
ctest: 109/109 passed, including the newagc_driver_scalar_sopk_compare.s_cmpk_eq_u32 0x00008000, 0x00008000 is 0, expected 1), and mapping opcode 0x0c toSCmpGtU32(s_cmpk_ge_u32 0x00000000, 0x00000000 is 0, expected 1).Not run on Linux/lavapipe locally. The program uses no subgroup operation.
Checklist
main; no other open PR implements the same functions (#333 coverss_cmovk_i32,s_versionands_setreg_imm32_b32, not the compares)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code