upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorDominik <55330408+Dom-in@users.noreply.github.com>2026-11-22 12:48:15 +0000
committerDominik <55330408+Dom-in@users.noreply.github.com>2026-11-22 13:10:32 +0000
commit3594f2cb3a3af445ddb4e866f97cdc977cec2a71 (patch)
tree9a33955b8f0cbef3f4f90bc14a6fe7471966f7d1 /runtime/src
parenta0acd33d77babe67a28e398b2936a9f735a50f5d (diff)
shader_ir: precompile operand patterns and take plain registers first
operand() runs once per operand of every instruction of every shader. It called re.fullmatch with string patterns (a cache lookup each time), and a plain register like v3 or s12, the commonest operand, only matched after failing neg(...), abs(...) and sext(...). - The 11 patterns are compiled once at module level (the same regex text). - A token that is a single register (s or v, then digits) returns the same dict _REG builds, before the neg/abs/sext forms it can't match. parse_line over the 2,512 lines of tests/semantic/fixtures/disasm: identical output on every line and on 34 edge tokens; 12.9 -> 8.6 us per line (34% faster). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src')
0 files changed, 0 insertions, 0 deletions