Repository navigation
tools: cndmask_hw_probe measures v_cndmask_b32's abs/neg source modifiers natively (TOOL-CNDMASK-HW-PROBE) - #1784
Open
mcpeacebir-lang wants to merge 1 commit into
Conversation
…iers natively (TOOL-CNDMASK-HW-PROBE) The "v_cndmask_b32 source modifiers" row of docs/design.md said the rule (sign-bit moves, Gen.src_u_sign_mods) was not measured on hardware for this instruction. tools/cndmask_hw_probe.py runs 15 words x v/-v/|v|/-|v| x src0/src1 through tools/hw_oracle under ieee 0/1 x denorm32 0/3 in wave32 and wave64, with a v_add_f32 and a v_mul_f32 in each kernel as controls that show the MODE is in effect. On an RX 7800 XT (gfx1101) all 120 results are sign-bit moves in every mode; the row now says so and that RDNA2 is not measured. tests/test_cndmask_hw_probe.py is CPU-only; its assembler check runs when LEONIDA_AMD_CLANG has llvm-mc beside it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcpeacebir-lang
force-pushed
the
claude/cndmask-hw-probe
branch
from
November 26, 2026 16:18
028c1c3 to
45435f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: TOOL-CNDMASK-HW-PROBE (#1608 (comment))
What and why
The "
v_cndmask_b32source modifiers" row ofdocs/design.mdsaid the translator's rule was "Not measured on hardware for this instruction". The rule is that VOP3abs/negonv_cndmask_b32are sign-bit moves (Gen.src_u_sign_mods), so a signalling NaN stays signalling and a denormal is not flushed. I measured it on an RX 7800 XT for HW-CNDMASK-SIGN-MODS in #1608 (#1608 (comment)), with a script outside the repository. This turns that run into a tool, so the row can cite it and someone with a gfx103x card can measure RDNA2 with one command.tools/cndmask_hw_probe.pyrunsv_cndmask_b32_e64throughtools/hw_oracle. Each kernel runs one lane.tests/semantic/test_cndmask_sign_mods.py.v,-v,|v|and-|v|, as the selected src0 and as the selected src1.ieee0/1 ×denorm320/3, in wave32 and wave64.v_add_f32(+min denormal, 0), which is flushed exactly whendenorm32 = 0;v_mul_f32(sNaN, 1.0), which is quieted exactly whenieee = 1.Exit codes:
--waves,--jsonand--self-testfollowds_permute_probe.pyanddpp_hw_probe.py(#1773).The row in
docs/design.mdnow gives the RDNA3 result and says RDNA2 is not measured. It keeps the two arguments the rule rested on before: thev_cmp_class_f32measurement and LLVM'sfoldFreeOpFromSelect.No translator change. New files plus one row of
docs/design.md.Tested
python -I tests/test_cndmask_hw_probe.py: 20 tests, 19 OK and 1 skipped (the llvm-mc check). WithLEONIDA_AMD_CLANGset to the clang fromrocm-sdk-core==10.0.0(AMD LLVM 23.0.0git), all 20 are OK. The llvm-mc check assembles every kernel body for gfx1030 (GFX10 spelling) and gfx1101, in wave32 and wave64.python -I tools/cndmask_hw_probe.py --self-test: OK.main0d80bc5df:scripts/check_no_game_data.py: clean.compileallandgit diff --check: clean.tests/test_ci_registration.py,tests/test_text_write_line_endings.pyand everytests/test_docs_*.py: OK.test_runner_calls_all_tests.py,test_tool_stdout_encoding.pyandtest_runtime_paths.pyare red onmainalready (ci: fix the three repository checks that fail on main #1673). None of their failures names these files.Not run: RDNA2 itself (no gfx103x card here), which is what the tool is for. Nothing in the translator suite changes.
GPUs tested: AMD Radeon RX 7800 XT (gfx1101, RDNA3), AMD driver 32.0.32029.2010, Windows 11, through
tools/hw_oracle(amdhip64_7.dll, AMD clang fromrocm-sdk-core==10.0.0).AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change; the existing row gains its hardware measurement)🤖 Generated with Claude Code