feat: 64-bit scalar shifts and bit operations in the HLSL recompiler #282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from LooperSalty/AnyXboxX. Originally posted by ramon-victor on 2026-11-26T00:34:51Z.
Change
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.
Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-26T14:01:41Z.
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
Imported from LooperSalty/AnyXboxX. Originally posted by LooperSalty on 2026-11-27T15:40:00Z.
Closing as obsolete: main already lowers s_lshl_b64, s_lshr_b64 and s_ashr_i64 (victory-shader lower.rs and the rdna2 reference interpreter), and this branch conflicts with main and has been inactive for more than 24 hours. Feel free to reopen after a rebase if a case is still missing, and point to the instruction that fails.
Pull request closed