Repository navigation
feat(shader): decode the s_endpgm variants, s_round_mode and SMEM probe/discard - #436
Conversation
292aea7 to
05ba96d
Compare
|
Thanks, the two end variants and the four SMEM ops look right to me (encodings checked with llvm-mc for gfx1013, and since scalar stores aren't supported the discards really have nothing to drop). The one part I can't merge as is: |
|
Thanks for checking the encodings. Done, rebased onto main:
Both pass on RADV and lavapipe. |
05ba96d to
2deefce
Compare
|
Thanks. Small heads-up: #264 adds |
|
#264 is on main now, so this needs the small rebase I mentioned: |
…be/discard s_endpgm_saved and s_endpgm_ordered_ps_done end the wave like s_endpgm (checked on an RDNA2 GPU: nothing after them runs), so they decode to SEndpgm and the control flow graph treats them as terminators. s_atc_probe, s_atc_probe_buffer and s_dcache_discard(_x2) have no visible effect and translate to no-ops like the other scalar cache controls. s_round_mode is ignored like s_setreg MODE writes; listed in TechnicalDebt. Co-Authored-By: Claude <noreply@anthropic.com>
Any other mode throws instead of being a silent no-op. Co-Authored-By: Claude <noreply@anthropic.com>
|
Rebased on current main as you described: |
2deefce to
36c2fa4
Compare
|
Thanks, the rebase is right: |
What
Seven scalar opcodes threw at decode ("unsupported SOPP opcode", "SMEM opcode is not supported"). Found by the ISA
coverage sweep.
s_endpgm_saved(SOPP 0x1b) ands_endpgm_ordered_ps_done(SOPP 0x1e) decode toSEndpgm, so the decoder andthe control flow graph treat them as program ends. Checked on an RDNA2 GPU: a store placed after either one never runs.
s_atc_probe,s_atc_probe_buffer,s_dcache_discard,s_dcache_discard_x2(SMEM 0x26-0x29) go through thesame path as
s_dcache_inv/s_dcache_wband translate to no-ops. On hardware the probes do nothing visible tothe following code (the RDNA2 iGPU used here does not have the discards). The discards only drop dirty scalar
cache lines, and scalar stores are not supported, so there is nothing to drop.
s_round_mode(SOPP 0x24) is a no-op like thes_setreg_b32MODE writes onmain, and is listed inTechnicalDebt. On hardware it does change float rounding (
s_round_mode 0x3makes1.0 + 0x1.8p-24give1.0instead of0x1.000002p+0). SPIR-V only has per-entry-point rounding modes, so it can't be followedat runtime.
Left out on purpose:
s_setkillends the wave on hardware even with 0,s_sethalt 1halts it for a debugger,and
s_code_endhangs the wave if it runs (it is padding after the program end). These are debugger and paddingencodings that game code doesn't run.
Tested
ScalarProgramEndandScalarProgramEndSaved(32 lanes). Each one runs all four SMEM opsand
s_round_mode, then storesin + 1and hits one of the two end variants. Two never-taken branches put ablock right after the end that would overwrite the result, and another one past it; both must stay unwritten.
main(decode throws). They pass on Linux with RADV and lavapipe.s_nopfails ("store before the end is 0x00000bad"). Removingthe
s_atc_probeors_dcache_discard_x2decode, or thes_round_modetranslation, fails at recompile.ctest: 127/127.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)