feat(shader): implement S_BFE_I64 #234
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/234"
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 boykopovar/AnyPS5. Originally posted by Digote on 2026-10-01T17:33:53Z.
What
S_BFE_I64as SOP2 opcode0x2A.Tested
Windows 11, MinGW-w64 GCC 16.1.0:
cmake --build build-s-bfe-i64-gccctest --test-dir build-s-bfe-i64-gcc --output-on-failure --timeout 120(89/89 passed)python tools/progress.py build-s-bfe-i64-gcc/progress-current(GPU shader instructions: 610/1166, 52.32%)Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-01T17:34:19Z.
Progress report (
7384588→f9f792c)📈 GPU shader instructions: 72.73% (+0.09%, +1 implemented instructions)
✅ 1 implemented
S_BFE_I64Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T01:13:19Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/CMakeLists.txtL806core/libs/prx/libSceAgcDriver/CMakeLists.txtL806core/shader/recompiler/Translation/include/Translation/TranslationContext.hppL242core/shader/recompiler/Translation/src/IntegerInstructions.cppL675-679, L683-684Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T05:39:12Z.
Thanks for this and for the rebase, the sign extension looks right to me, including the offset + width > 64 case, which comes out as the arithmetic shift the ISA describes. One thing before it can go in: the test only checks that a
ShiftRightArithmetic64appears. Could you turn it into an execution test with values (seecore/libs/prx/libSceAgcDriver/tests/execution/ScalarBitCount.cppfor the pattern), covering a negative field, width 0, width 64 and offset + width > 64? That would pin the behaviour rather than the IR shape.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-06T08:05:26Z.
@oneandonlydean measured on RDNA2 hardware (gfx1035, same SOP2 encoding as gfx1013): the semantics here match. 512 random rows through
s_bfe_i64, including width 0, 1, 63, 64, 65 and 127, offset + width > 64, and garbage in the unused bits of S1, all agree with this PR's model: count = min(S1[22:16], 64 - S1[5:0]), the field sign-extended from bit count - 1, 0 for count 0, SCC = result != 0. Only your pending ask (an execution test) is left.Pull request closed