shader: gfx2hlsl and the direct compute path give different SCC for s_min/s_max when S0 == S1 #3436
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3436
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Leyukaka on GitHub · 2026-11-29 07:51 UTC · original
On
main(eab7180c), gfx2hlsl and the direct compute path give different SCC fors_min_u32,s_max_u32,s_min_i32ands_max_i32when both sources are equal.gfx2hlsl: S0 == S1 sets SCC.
tools/startup/gfx2hlsl.py,add_sub_min_max_scc(docstring:s_min / s_max: SCC = (D == S0), the first source was chosen):From
79410a80(#2778).Direct compute: S0 == S1 clears SCC.
src/gfx1013_direct_compute.inl,arithmetic:The predicate is
ult/slt/ugt/sgt.src/gfx1013_compute_native.cpp(unsigned forms only) is strict too:Both from
40365770. The descriptor-stride branch ofs_max_u32against 1 inarithmetic(cmp("ugt",stride->second,"1")/cmp("ult",stride->second,"1"), from350785e8, #3229) is strict as well.Tests.
Softests/startup_gfx2hlsl_compute_check.pyruns the four ops on a 4x4 grid of edge values; its diagonal has S0 == S1. The reference isscc = result == x, and thes-min-strictcontrol requires a stricts_min_u32compare to fail.tests/native_descriptor_scc_check.pycovers only the stride branch (stride 1 against 1, expected 0).The repository does not include the ISA text for these opcodes, so it does not settle which result is correct.
Suggested test: run the four ops with S0 == S1 (for example 0, 0xffffffff, 0x7fffffff, 0x80000000), each followed by an SCC read, through both gfx2hlsl and
gfx1013-direct-cs, and compare the SCC bits.@Leyukaka on GitHub · 2026-11-29 09:09 UTC · original
Taking the direct-path test: branch
tests-direct-scc-equaladds totests/native_descriptor_scc_check.pyan SCC read afters_min_u32,s_min_i32,s_max_u32ands_max_i32with equal operands (expected 0) and unequal operands (3 vs -1, expected 1), on thegfx1013-direct-cspath. It pins the current strict behaviour, not what the ISA specifies. It does not compare against gfx2hlsl, and it does not change either lowering. #3437 changes the gfx2hlsl side.