Lower GFX7 v_cvt_pkaccum_u8_f32 onto v_cvt_pk_u8_f32 #141
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!141
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/141/head"
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?
@Yeetbot159 on GitHub · 2026-11-22 15:16 UTC · original
Yeetbot159:yeet/pkaccum-u8→main· +93 −1 · 2 files · 2 commits · closed without mergingSummary
v_cvt_pkaccum_u8_f32is the two-source form ofv_cvt_pk_u8_f32. The integer source is repeated: its low two bits select the byte, and that byte of the same dword is replaced by the converted float.v_cvt_pk_u8_f32already does. Clamp, an output modifier, or abs/neg on the integer source is refused, because the packed byte would not match.Vop2Maparm, so this needs a rebase if that pull request merges first.Test plan
cargo test -p tombox-xshader --lib gcn::testspassed (20 tests).pkaccum_u8_updates_the_byte_selected_by_its_integer_sourcechecks the VOP2 form, the VOP3 form, and that a clamp modifier is an error.@omonkeyz on GitHub · 2026-11-22 15:19 UTC · original
Thanks! The lowering is close, but the accumulator is the wrong register.
v_cvt_pkaccum_u8_f32packs the converted byte into the existing destination (D keeps its other three bytes). In RDNA2v_cvt_pk_u8_f32, src2 is the value whose other bytes are kept, so src2 must be vdst, not the byte-select source. With[src0, vsrc1, vsrc1]the other bytes come from the selector register instead of D.Please change both the VOP2 and VOP3 paths to
[src0, src1, vdst]. Update the test to expectVgpr(1)as src2, and add an exec test that packs four bytes into one register in sequence.Also: #139 adds
psv_numthreadstoShaderExtract, so after it landstranslate_loweredhere will needpsv_numthreads: None.@Yeetbot159 on GitHub · 2026-11-22 15:52 UTC · original
Both the VOP2 and VOP3 paths now pass the destination as src2, so the other three bytes stay in D.
translate_loweredsetspsv_numthreads: None.pkaccum_u8_packs_four_bytes_into_one_registerpassed on WARP: 1.0, 2.0, 3.0 and 4.0 pack to0x04030201.@MiguelMatMar on GitHub · 2026-11-22 16:03 UTC · original
Independent hardware run:
pkaccum_u8_packs_four_bytes_into_one_registerpasses on WARP and on hardware (TOMBOX_EXEC_HW=1, NVIDIA Ada / RTX 40-series), PR headbf64545.opcodes,syntheticandgcn_dimsalso pass.@omonkeyz on GitHub · 2026-11-22 16:11 UTC · original
Applied in
fcb99ba(merged in1a1e283) with your authorship kept, thanks! I squashed both commits into one, and fixed a merge conflict with #140 in gcn.rs and exec.rs, keeping both lowerings and all tests.Pull request closed