feat(shader): support MODE status bitfields in s_getreg_b32 #25959
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25959"
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 Kikoarl on 2026-11-23T01:02:50Z.
What
Support reading static status bitfields from
HW_REG_MODE(id = 1) ins_getreg_b32:DX10_CLAMP(bit 8)IEEE(bit 9)FP16_OVFL(bit 23)Changes in
0561d51345(rebased ontoorigin/main115a7036e2):HW_REG_MODEs_getreg_b32windows inScalarInstructions.cppstrictly to modeled bits0..9(offset + size <= 10u) andFP16_OVFLbit23(offset == 23u && size == 1u), rejecting unmodeled bits10..22and24..31.size == 32u ? 0xffffffffu : ...dead branch inScalarInstructions.cpp.s_setreg_imm32_b32writes to MODE bits 8+ (0xba800201u,0xba800241u,0xba8005c1u,0xba80f801u), dynamics_setreg_b32MODE bits 8+ writes, and non-MODEs_setreg_b32ignore behavior inShaderModeRegisters.cpp, alongsideverifyStatusBitfieldReadsandverifyUnsupportedReads.docs/dev/debt/shader.md#L133indocs/dev/debt/changes/feat-shader-mode-bitfields.mdand accurately document thats_setreg*writes to MODE bits 8+ throw (matchingRoundingMode.cpp) while non-MODEs_setreg_b32is ignored.Provenance: AMD RDNA 2 ISA §§5.8, 6.4 Table 24 (MODE register bit layout:
DX10_CLAMPbit 8,IEEEbit 9,FP16_OVFLbit 23), §12.3 SOPKS_GETREG_B32Table 39 (Hardware Register IDs), and LLVM 20.1.8 AMDGPUAMDGPUBaseInfo.h/SIModeRegister.cpp.Tested
/tmp/anyps5_verify_build(-DBUILD_TESTING=ON), rebased ontoorigin/main(115a7036e2, PR head0561d51345).ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir /tmp/anyps5_verify_build --output-on-failure -R "^(agc_shader_mode_register|agc_driver_scalar_getreg)$":agc_shader_mode_register: Passed (0.57 s, all 23 unit checks includingverifyOutputModifierRounding,verifyStatusBitfieldReads,verifyUnsupportedReads,verifyDynamicWrites, andverifyImmediateWrites).agc_driver_scalar_getreg: Passed (1.38 s on Intel RPL-S Vulkan).python3 tools/debt_fold.py --checkandpython3 tools/check_conventions.py --base origin/main: Passed cleanly.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T01:25:11Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the remaining checks were not run in this review.
What I ran
Reviewed head
ca141eb9fcf876cfd9986eeba1358f2a7ee95c66using the prepared diff and pinned repository reader. No test or build commands were run.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports Linux x86_64 unit and execution checks and two Python checks as passed; I did not run them. The included changed files were read:
ShaderModeRegisters.cpp,ScalarGetreg.cpp,ScalarInstructions.cpp, andfeat-shader-mode-bitfields.md. No changed files were excluded. I reviewed the MODE register decoding and status-bit assembly, including the related float-mode accessors; I did not read unrelated portions of those files or independently verify the ISA and LLVM references.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T05:47:28Z.
Review: APPROVED
Reviewed — looks good
The change adds reads of known MODE status bits using the configured float mode, and the inspected code and tests support the stated behavior.
What I ran
Reviewed head
413c05030be2a0dcd8426b62bab657843ac93abdusingrepo_read.pysearch and file reads. No tests or build commands were run in this review; test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported test and convention-check results were not independently run. No other repository files were inspected beyond targeted context.
files.jsonwas unavailable; the manifest lists four changed files, all included and read.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T06:21:10Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and added coverage support the described MODE status bitfield reads.
What I ran
Reviewed head
a1370b7242653eaf67d20882f8e2df81447aa875against the prepared diff. No tests or build commands were run; the checks listed in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Did not run the reported unit tests, execution tests, conventions check, or debt check; their results are author-reported. Did not verify behavior on physical hardware. Read
ShaderModeRegisters.cpp,ScalarGetreg.cpp,ScalarInstructions.cpp,feat-shader-mode-bitfields.md, and targeted ranges ofRoundingMode.cpp,TranslationContext.hpp, andRecompiler.hpp. No changed files were excluded; all four reviewed files were included in the prepared bundle.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-24T23:17:30Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change at
d57aa92948a0702117af451ed9323d05b936371fadds MODE status-bit reads with bounded supported fields; the inspected code and tests support merging.What I ran
No commands were run; this review used the prepared diff and pinned-head reader.
Results
review/files.jsonwas unavailable through the reader.Findings
Blocking
None.
Non-blocking
None.
Not verified
I could not inspect the run’s
files.jsoninventory, so I could not independently confirm whether every file marked reviewed was read. No tests or convention checks were run in this review. The PR description reports successful targeted tests and convention checks; these results were not independently verified.Files read:
description.md,commits.md,manifest.json,diff.patch,ShaderModeRegisters.cpp,ScalarGetreg.cpp,ScalarInstructions.cpp,RoundingMode.cpp, andTranslationContext.hpp. The diff and manifest list four changed files, all included infiles/; none was excluded by the manifest.files.jsonwas unavailable.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T11:51:30Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation reads MODE status bits from the supplied shader metadata and rejects unsupported reads and writes as described.
What I ran
Reviewed head
0561d51345e347a0fb6238d421aae8814d52cb73using the prepared diff andrepo_read.pysource reader. No tests or build commands were run; reported test results are from the PR description.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No test or build was run in this review. The files listed as reviewed in the manifest were all read:
core/libs/prx/libSceAgcDriver/tests/ShaderModeRegisters.cpp,core/libs/prx/libSceAgcDriver/tests/execution/ScalarGetreg.cpp,core/shader/recompiler/Translation/src/ScalarInstructions.cpp, anddocs/dev/debt/changes/feat-shader-mode-bitfields.md. No files were excluded by the prepared review folder. Physical-console behavior was not verified.To get this to a good state
Nothing is required.