feat: 64-bit scalar shifts and bit operations in the HLSL recompiler #282
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!282
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-282"
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?
@ramon-victor on GitHub · 2026-11-26 00:34 UTC · original
ramon-victor:feat/hlsl-scalar64-shifts-bits→main· +400 −27 · 5 files · 1 commits · openChange
Translates the remaining 16 64-bit scalar ALU instructions of the reference interpreter (
emu/rdna2_exec_ops.pyandemu/rdna2_exec_bits.py) in the HLSL recompiler (emu/rdna2_hlsl_scalar64.py), bringing HLSL coverage ofrdna2_exec_ops.SCALARto 100% in both wave32 and wave64 (and graphics stages):s_lshl_b64,s_lshr_b64,s_ashr_i64(includingSCC = (D != 0), avoiding HLSL<< 32/>> 32shift-amount masking).s_bfe_u64,s_bfe_i64(offsetS1[5:0], widthS1[22:16],SCC = (D != 0)),s_bfm_b64(SCCunchanged).s_bitcmp0_b64,s_bitcmp1_b64,s_bitset0_b64,s_bitset1_b64(no-op when targetingnull,SCCunchanged).s_brev_b64,s_flbit_i32_b64,s_flbit_i32_i64,s_bitreplicate_b64_b32,s_wqm_b64,s_quadmask_b64.rdna2_hlsl_scalar64.statement, reads 32-bit operands (S1of shifts/BFE/bitcmp,S0/S1ofs_bfm_b64,S0ofs_bitset*/s_bitreplicate) viasource(), and expands 32-bit literals on 64-bit sources per AMD "RDNA 2" ISA (November 2020), §6.2.1 p. 43 (sign-extended fors_ashr_i64,s_bfe_i64,s_flbit_i32_i64; zero-extended for unsigned/bitwise ops).s127(Untranslatable, matchingrdna2_exec.py) and continues refusing inline float constants on 64-bit scalar operands (test_rdna2_exec_inline64.py).rdna2_hlsl_scalar64.HELPERSintordna2_hlsl.py,rdna2_hlsl_wave64.py, andrdna2_hlsl_graphics.py.Interpreter coverage (
rdna2_exec.coverage()) is unchanged (1,285/1,490) and total collected tests stay within1600+(1,673), so the 9 READMEs need no edits.Verification
Windows 11 (26300), dxc 1.8.2502.11 (Windows SDK 10.0.26100.0), Python 3.14.3, RTX 3070 (driver 621.24) and WARP:
Oracle and test data
emu/rdna2_exec_ops.py/emu/rdna2_exec_bits.py.tests/test_rdna2_hlsl_scalar64.py(8 tests, hand-constructed encodings covering shift/width boundaries0/1/31/32/33/63/64/127,SCCset/clear/preservation, register aliasing, 32-bit literal expansion, wave64, vertex-shader DXIL compilation, ands127/inline-float refusals).tests/test_rdna2_hlsl_scalar64.pyfail onmain(Untranslatable/ missing coverage) without this change.Checklist
E_NOTIMPL), never a fake success.test_readme_sync.pychecks it).AI assistance: Antigravity (Gemini 4 Neon) wrote the HLSL translation, tests, and PR description; verified locally on RTX 3070 and WARP.
@LooperSalty on GitHub · 2026-11-26 14:01 UTC · original
This PR now conflicts with main in
PrototypeScarlett/emu/rdna2_hlsl.py,rdna2_hlsl_graphics.pyandrdna2_hlsl_wave64.py(HLSL recompiler changes merged in #302 and later). Please rebase on main, re-check the 64-bit scalar operations against the reference interpreter on GPU or WARP (rule 4 of AGENTS.md), and force-push your branch.🤖 Generated with Claude Code
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.