Repository navigation
Recompiler: a bridged v_cmp writes 0 for the lanes outside EXEC (#2458) - #2507
Closed
xpatfussy69x wants to merge 1 commit into
Closed
xpatfussy69x wants to merge 1 commit into
xpatfussy69x wants to merge 1 commit into
Conversation
…dev#2458) The per-lane form ANDs a compare's lane bit with EXEC only for the compares it lowers itself (U32/I32). The rest (float, 16- and 64-bit, V_CMP_CLASS, VOP3-modified) go through xcl-dev#1426's lowering with the guard `true`, since lane_masks never guards a V_CMP, and fe78c81 masked the result with EXEC only for v_cmpx. A non-cmpx compare under a narrowed EXEC so kept its raw result in inactive lanes, where the console writes 0, and a later branch or v_cndmask on VCC saw those lanes as set. Every bridged V_CMP* now takes the lane's EXEC bit into its result, as the issue suggests. Bug 2 of xcl-dev#2458 (writes to NULL) is not in this change. Test: EXEC = lanes 0-15, v_cmp_le_f32 true in every lane, EXEC restored, v_cndmask on VCC: 7 in lanes 16-31 without the fix, 0 with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Author
|
Closing as a duplicate of #2503, which makes the same change to |
Contributor
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2458 (bug 1 only). In the per-lane form, a
V_CMP_*that goes through #1426's lowering (float, 16- and 64-bit,V_CMP_CLASS, VOP3-modified) kept its raw result in the lanes outside EXEC, where the console writes 0.lane_masksnever guards aV_CMP, so the bridge ran it with the guardtrue, and fe78c81 masked the result with EXEC only forv_cmpx. Under a narrowed EXEC, a later branch orv_cndmaskon VCC then saw those lanes as set. Every bridgedV_CMP*now ANDs its lane bit with EXEC, as the per-lane form's own U32/I32 compares already do.What is in it
crates/xcl/src/gpu/recomp/lower.rs: the bridge takes the lane's EXEC bit into the result of everyV_CMP*, not onlyV_CMPX*crates/xcl/src/gpu/recomp/lower_dxil.rs:a_bridged_v_cmp_writes_0_for_the_lanes_outside_exec: EXEC = lanes 0–15,v_cmp_le_f32true in every lane, EXEC restored,v_cndmaskon VCC. Fails without the fix (7 in lane 16), passes with itTested
cargo test --workspace -- --test-threads=4: 1422 passed, 0 failed, 46 ignoredV_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32(onmaintoo; Recompiler: the per-lane form takes f16 converts and products from #1426 #2182 removes them)cargo test -p xcl --lib a_bridged_v_cmp: 2 passed (the new test and the existingv_cmpxone)Regression run
main:
PR:
Not tested
v_cmpunder a narrowed EXEC (smoke run with default settings, notXCL_PER_LANE=1): it is a regression check only. The frame difference is most likely run-to-run variance in loadingNULL); Recompiler: fix NULL dest, B32 SAVEEXEC, and MIMG TFE/LWE in upper_lanes #2136 touchesNULLdestinations inupper_lanesAI use