feat: implement v_permlane16_b32 and v_permlanex16_b32 in Python, Rust, and HLSL #606
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/606"
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 LooperSalty/AnyXboxX. Originally posted by mahmudintaginting2024 on 2026-12-01T17:47:27Z.
Change
Implements
v_permlane16_b32(VOP3 opcode0x377) andv_permlanex16_b32(VOP3 opcode0x378) across the Python reference interpreter, the Rust reference interpreter (anyxboxx-rdna2-ref), and the HLSL/DXIL recompiler (both wave32 and wave64).Per AMD's "RDNA 2" Instruction Set Architecture Reference Guide (30 Nov 2020, SHA-256
22aec03f..., section 12.12, VOP3 887–888, printed pp. 186–187):v_permlane16_b32) or across adjacent row pairs0<->1/2<->3(v_permlanex16_b32) using the 64-bit lane selector{S2.u, S1.u}(4 bits per lane in the row).src0before writingvdstso in-place permutes (vdst == src0) read pre-instruction values.OP_SEL[0](FI, fetch inactive) andOP_SEL[1](BOUND_CTRL, write 0 on inactive source lane whenFI == 0, else preservevdst).abs/neg/clamp/omod, reservedop_sel[3:2], non-VGPRsrc0, and non-scalarsrc1/src2by name across Python, Rust, and HLSL.Files changed:
PrototypeScarlett/emu/rdna2_exec_vop3.py: addpermlane16_refusal,_permlane16, and register both ops inLANE_OPERATIONS.crates/anyxboxx-rdna2-ref/src/vop3.rs,vop3_forms.rs,int16.rs: exposeFields::op_sel, implementpermlane16inlane(), and add Rust unit testpermlane16_rotates_within_and_across_rows_with_fi_and_bound_ctrl.PrototypeScarlett/emu/rdna2_hlsl.py,rdna2_hlsl_wave64.py,rdna2_hlsl_graphics.py: addpermlane16_statements(wave32ReadLaneand wave64ReadLane64), add both tocoverage_names()andCROSS_LANE_OPS.crates/anyxboxx-report/data/rdna2-coverage.txt: regenerated viapython tests/test_rust_traduction_parity.py(VOP3: 425 -> 427 / 438; total 1,366 / 1,490).tests/test_rdna2_exec_permlane16.py: ISA rotation examples (wave32/wave64), in-place permute, all four(FI, BOUND_CTRL)modes, all 8 refusal cases across Python/HLSL32/HLSL64, wave32 & wave64 GPU/WARP byte-for-byte parity, and Rustanyxboxx-rdna2-refparity.Verification
Oracle and test data
ANYXBOXX_GPU=warp).test_permlane16_rust_ref_parity).tests/test_rdna2_exec_permlane16.pyfail withUntranslatedonmainand pass with this change.Checklist
E_NOTIMPL), never a fake success.1900+band (1,997 tests;test_readme_sync.pypasses).Note: Co-authored with Gemini Neon (AI assistant).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.