mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:00:52 +01:00
[PR #422] rdna2spirv: accept VOP3P clamp as hardware no-op on packed 16-bit shifts (SHADER-PK-SHIFT-CLAMP) #473
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#473
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/422
Author: @tahffo68hk-hash
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:fix/shader-pk-shift-clamp📝 Commits (1)
990e26brdna2spirv: accept VOP3P clamp as hardware no-op on packed 16-bit shifts (SHADER-PK-SHIFT-CLAMP)📊 Changes
3 files changed (+15 additions, -7 deletions)
View changed files
📝
docs/design.md(+1 -1)📝
tests/semantic/test_valu_pk_shift_b16.py(+11 -3)📝
tools/rdna2spirv.py(+3 -3)📄 Description
Claimed in the coordination issue as:
SHADER-PK-SHIFT-CLAMPProblem
tools/rdna2spirv.pyrejectedv_pk_lshlrev_b16,v_pk_lshrrev_b16, andv_pk_ashrrev_i16withUnsupportedwhenever VOP3Pclampwas set.Measured natively on AMD RDNA2 (
gfx1036viatools/hw_oracle): VOP3Pclampis a valid encoding and a hardware no-op on all three packed 16-bit shift instructions (each 16-bit half wraps without saturating, matchingv_pk_mul_lo_u16/v_pk_max_*16/v_pk_min_*16).Fix
clampas a hardware no-op onv_pk_lshlrev_b16,v_pk_lshrrev_b16, andv_pk_ashrrev_i16intools/rdna2spirv.py.tests/semantic/test_valu_pk_shift_b16.pywithtest_clamp_is_hardware_noopcovering all three opcodes.docs/design.md.Verification
python -I tests/semantic/test_valu_pk_shift_b16.py-> OK.spirv-val):tools/hw_oracle-> 4 dwords across all 3 opcodes +op_sel/op_sel_hiwithclamp.vk_compute_test.exe:spirv-valPASS)--wave64-emulate): 4/4 exact dwords (spirv-valPASS)中文翻译
在协调帖 #14 中认领的 ID:
SHADER-PK-SHIFT-CLAMP问题描述
tools/rdna2spirv.py此前对携带 VOP3Pclamp的v_pk_lshlrev_b16、v_pk_lshrrev_b16、v_pk_ashrrev_i16抛出Unsupported。经原生 AMD RDNA2(
gfx1036)实测确认,VOP3Pclamp在这三条打包 16 位移位指令上为合法编码且属于硬件空操作(各 16 位通道正常回绕不饱和)。修复方案
tools/rdna2spirv.py中允许上述三条指令携带clamp(按硬件空操作处理)。tests/semantic/test_valu_pk_shift_b16.py中补充test_clamp_is_hardware_noop回归测试并更新docs/design.md。验证结果
tests/semantic/test_valu_pk_shift_b16.py全部通过。--wave64-emulate)4/4 精确一致,spirv-val全部通过。🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.