startup: v_cmp_class_f32 has no lowering (2 of the remaining loading-screen shader refusals) #1797
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#1797
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?
@triggered02 on GitHub · 2026-11-24 18:49 UTC · original
Found in the refusal census (#870). 2 refused shaders, both the binary32 class comparison:
tools/pixel_aot.pyalready implemented this for the pixel AOT path, so the ten-class helper is ported from there rather than reinvented.1. Problem
The class comparison tests which binary32 class a value falls in against a mask. Nothing in
tools/startup/gfx2hlsl.pylowered it.2. Change
A helper in the shader preamble (same ten class bits, in encoding order: signaling NaN, quiet NaN, -inf, -normal, -denormal, -0, +0, +denormal, +normal, +inf):
and a branch in
compare()that lowers the predicate to(class32(value) & mask) != 0u, reading the mask as an integer operand and the value as a float:The census
-1mask is the inline constant for "every class"; a literal mask (0x00000300u= +normal|+inf) and a register mask follow the same path.3. Test
startup_gfx2hlsl_cmp_classbuilds VOPC-in-VOP3 encodings from the checked-in decoder's layout (prefix0b110101, opcode[25:16], scalar destinationw0[7:0], sources inw1), decodes them, then translates. Nine checks: both spellings decode and lower, the non-exec form writes VCC, thev_cmpx_form writes EXEC and clearsexec_known, a literal mask and a register mask reach the helper, and the helper is present in the common preamble with the quiet/signaling NaN distinction.Fail-first: changing
&to|in the class test fails a register mask is read as an integer; renaming the helper fails the class helper is emitted in the common preamble.4. What this does not establish
ClassFlagson hardware — they are ported frompixel_aot.pyand unchanged by this PR; the census mask (-1) does not exercise individual bits.v_cmp_class_f16/_f64,v_cmpx_class_f16, and DXC/draw results are out of scope.Note for the merge
#1755 changes
compare()'s signature to takemods; this branch is based on main before it, so the two touch the same function and will need a trivial conflict resolution (keep both: themodsargument and this class branch).AI-assisted (Claude Code).