test(shader): execute every non-f64 VOPC compare against values measured on RDNA #539
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/539"
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 adriadam10 on 2026-10-04T16:12:54Z.
What
Execution test for the VOPC compares that no test runs today: all 156 non-f64 compare opcodes (f32, f16, i16/u16, i32/u32, i64/u64,
class_f32/class_f16,v_cmp_*andv_cmpx_*). Each one runs in its VOPC (_e32) form and its VOP3 (_e64) form, so 312 compares in total. The VOP3 forms swap the operands and write to an SGPR pair instead of VCC. f64 compares are already covered byVopcCompareF64and are left out.The shader runs three times: as wave32, as native wave64, and as wave64 split into two halves (
ComputeTarget(32)). Each lane turns its own bit of the compare mask into a result bit, so a wrong high half of VCC/EXEC shows up in wave64 lanes 32-63.No translator change: every compare already matches the hardware.
core/libs/tests/VectorCompareInt64F16.cpp(#310) is untouched.Behaviour measured on HW
Expected values come from an RDNA2 GPU (gfx1035, wave32 and wave64), on 2048 random and edge rows per wave size. A Python model matches the hardware on every row:
o/uand then*forms are true when either input is NaN,lgis false, and -0 == +0.classdecides on the raw bits, with the mask bits 0 = sNaN, 1 = qNaN, 2 = -inf ... 9 = +inf. It reports denormals as denormals with f32/f16 denorm modes both 0 and 3. The test has edge rows for the max denormal, the min normal and sNaN vs qNaN, each with a single-class mask.classgets them, because it works on the bits.Tested
Linux,
agc_driver_vopc_compare_tablepasses on RADV (Mesa 26.2), on local lavapipe, and on the lavapipe CI uses (Mesa 25.2.8). Full Release ctest: 183/184.agc_driver_pixel_helper_lanesfails on local RADV onmaintoo.Negative checks: each mutation below makes the test fail on RADV and lavapipe: i16 compare read as unsigned, u64 order read as signed,
nlt_f32made ordered,cmpx_ngt_f16read as f32,class_f32writing EXEC,t_i64returning false, the f16 class denormal limit moved to 0x3ff, the f16 quiet bit moved to 0x100.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T21:19:18Z.
Thanks. I disassembled both shaders with llvm-mc for gfx1013: 312 compares, 156 distinct opcodes, which is the whole non-f64 VOPC set (f32, f16, i16/u16, i32/u32, i64/u64 and the four class forms, each as v_cmp and v_cmpx), with no decode errors. The three runs (wave32, native wave64, wave64 split) also check the high half of VCC and EXEC, which is a good addition. The relational rows avoid denormals and class works on the bits, so nothing depends on the driver. It passes on my NVIDIA machine. Test only, ready to merge from my side.
If
agc_driver_vopc_compare_tableever goes red on CI only on f16 rows, it is probably the same llvmpipe f16 compare issueagc_driver_vopc_comparehad, not this test.