rdna2spirv: accept VOP3 clamp no-op on scalar 16-bit mul_lo/max/min/shifts #426

Open
github-bot wants to merge 1 commit from github-bot/gh-426 into main AGit
Owner

@⁠tahffo68hk-hash on GitHub · 2026-11-24 05:04 UTC · original
tahffo68hk-hash:fix/shader-int16-clamp-noop → main · +31 −7 · 3 files · 1 commits · open

Summary

(AI-assisted) Fixes SHADER-INT16-CLAMP-NOOP: ools/rdna2spirv.py previously rejected the VOP3 clamp modifier with Unsupported on the eight scalar 16-bit integer instructions _mul_lo_u16, _max_u16, _min_u16, _max_i16, _min_i16, _lshlrev_b16, _lshrrev_b16, and _ashrrev_i16.

Native RDNA2 hardware measurement (gfx1036) shows that all eight instructions accept the VOP3 clamp bit and treat it as a hardware no-op (for example, _mul_lo_u16 0xffff, 0xffff clamp wraps modulo 2^16 to

**@⁠tahffo68hk-hash** on GitHub · 2026-11-24 05:04 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/426) `tahffo68hk-hash:fix/shader-int16-clamp-noop` → `main` · +31 −7 · 3 files · 1 commits · open ### Summary (AI-assisted) Fixes SHADER-INT16-CLAMP-NOOP: ools/rdna2spirv.py previously rejected the VOP3 clamp modifier with Unsupported on the eight scalar 16-bit integer instructions _mul_lo_u16, _max_u16, _min_u16, _max_i16, _min_i16, _lshlrev_b16, _lshrrev_b16, and _ashrrev_i16. Native RDNA2 hardware measurement (gfx1036) shows that all eight instructions accept the VOP3 clamp bit and treat it as a hardware no-op (for example, _mul_lo_u16 0xffff, 0xffff clamp wraps modulo `2^16` to
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:59:28 +00:00
Author
Owner

@⁠Oliwettoo on GitHub · 2026-11-24 10:36 UTC · original

test_alu_u16_clamp.py passes with the PR on current main. The measured words are only in the PR text, so nobody can reproduce them: please commit a reproducible gfx103x case (an int_hw_probe.py case, or the tools/hw_oracle .asm plus its raw output), as the maintainer asked on #392/#398 (AGENTS.md: a new rule goes in with how it was confirmed). Merge note: the 'Integer clamp' row is also edited by #392, #398 and #422, and git merge-tree shows this conflicts with all three. AI-assisted review.

**@⁠Oliwettoo** on GitHub · 2026-11-24 10:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/426#issuecomment-7129009183) `test_alu_u16_clamp.py` passes with the PR on current `main`. The measured words are only in the PR text, so nobody can reproduce them: please commit a reproducible gfx103x case (an `int_hw_probe.py` case, or the `tools/hw_oracle` .asm plus its raw output), as the maintainer asked on #392/#398 (AGENTS.md: a new rule goes in with how it was confirmed). Merge note: the 'Integer clamp' row is also edited by #392, #398 and #422, and `git merge-tree` shows this conflicts with all three. AI-assisted review.
This pull request has changes conflicting with the target branch.
  • docs/design.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/426/head:github-bot/gh-426'
git switch 'github-bot/gh-426'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-426'
git switch 'github-bot/gh-426'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-426'
git switch 'github-bot/gh-426'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-426'
git switch 'main'
git merge --squash 'github-bot/gh-426'
git switch 'main'
git merge --ff-only 'github-bot/gh-426'
git switch 'main'
git merge 'github-bot/gh-426'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.