mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #978] rdna2spirv: sign-extend 32-bit literals in s_ashr_i64, s_bfe_i64, s_flbit_i32_i64 (SHADER-SALU-LITERAL-SEXT) #1017
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#1017
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/978
Author: @OlaiFG7
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:worktree-agent-a0eac686e6011802d📝 Commits (1)
baee47drdna2spirv: sign-extend the 32-bit literal of s_ashr_i64, s_bfe_i64, s_flbit_i32_i64 (SHADER-SALU-LITERAL-SEXT)📊 Changes
3 files changed (+145 additions, -3 deletions)
View changed files
📝
docs/design.md(+1 -0)➕
tests/semantic/test_salu_signed_literal64.py(+130 -0)📝
tools/rdna2spirv.py(+14 -3)📄 Description
Claimed in the coordination issue as: SHADER-SALU-LITERAL-SEXT (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7136924696)
What and why
s_ashr_i64,s_bfe_i64ands_flbit_i32_i64now sign-extend a 32-bit SALU literal (Gen.imm64_signed). llvm-mc prints-100as0xffffff9c; the translator zero-extended it, sos_flbit_i32_i64 s8, 0xffffff9cgave 32 instead of 57 ands_ashr_i64/s_bfe_i64gave 0 instead of all-ones. Unsigned ops still zero-extend. Finding by akimfomin in #14.docs/design.md: contract-table row, confirmed by the CPU test and the llvm-mc encoding in the finding; not measured on hardware.tests/semantic/test_salu_signed_literal64.py: hand-written, no game data; fails 3/5 on main, passes 5/5.Touches the same op families as #212 / #224 (SHADER-930); a rebase conflict should be trivial.
Tested
Semantic suite: 470 files, 6148 tests; only
test_sopc_validationandtest_unary_f16_validationfail, becausespirv-as/spirv-valare not installed here. No GPU run, no corpus count (no game files). Windows 11, CPU only.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanlydocs/design.md🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.