Repository navigation
Translator: s_sext_i32_i8, s_sext_i32_i16, s_flbit_i32 - #549
Conversation
All three raised Unsupported. s_sext_i32_i8/i16 sign-extend the low byte / half (OpBitFieldSExtract); s_flbit_i32 is the scalar form of v_ffbh_i32 and shares its code. None writes SCC. tests/semantic/test_salu_sext_flbit.py checks all three against a plain-Python reference, with SCC kept from 0 and 1.
cs_wqm_w32 (SHADER-34) and cs_w32_lane_wrap (SHADER-52) check 32-lane EXEC/VCC masks and lane selects. On Mesa llvmpipe, whose compute subgroups are 8 wide, they can't produce their words, and the "GPU tests on llvmpipe" step in runtime.yml has failed on main since 91b36cf. Skip them where vk_compute_test reports a widest subgroup below 32 lanes, the rule ps_bitmask_perm already uses, in check.py and run_gpu_tests.py (which reuses check.py's helper). Devices with 32 or more lanes still run and judge them. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy (cherry picked from commit be46677)
|
CI note: |
IAmNotSiob
left a comment
There was a problem hiding this comment.
Checked against the ISA: s_sext_i32_i8/i16 is a BitFieldSExtract of 8/16 with no SCC write, and s_flbit_i32 shares v_ffbh_i32's lowering, which is right because it's the same op (-1 when no bit differs from the sign bit, no SCC write). Merged with current main, tests/semantic passes (786 tests). LGTM. AI-assisted review (Claude Code).
…ROC-20) #544, #549 and #577 merged without a row in the contract table, which AGENTS.md asks for. One row per group, each with the semantics (checked against the RDNA2 ISA pseudocode), what is not handled (clamp on the SAD and lerp ops) and how it was confirmed (the CPU tests added by the PR); none is GPU-checked. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tools/rdna2spirv.pyraisesUnsupportedons_sext_i32_i8,s_sext_i32_i16ands_flbit_i32. They aren't in the translated corpus, so this is future-proofing. Claimed in #374.Change
tools/rdna2spirv.py:s_sext_i32_i8ands_sext_i32_i16sign-extend the low byte or low half of S0 to 32 bits (OpBitFieldSExtract).s_flbit_i32is the scalar form ofv_ffbh_i32and goes through the same code. It counts the bits from the MSB down to the first one that differs from the sign bit, and gives −1 for 0 and −1.tests/semantic/test_salu_sext_flbit.py(new, stdlibunittest) checks against a plain-Python reference:s_flbit_i32expas 16-bit halves ORed into0x40000000, so no export channel can be a NaN pattern (see the review on tests/semantic: export test_alu_shift_b64 results in 16-bit halves (fixes CI on Python < 3.14) #454)Tested
python -I -m unittest discover -s tests/semantic: all pass. Without the translator change, the new file has 132 errors (Unsupported).python -m compileall -q tools testspasses. Not run on a GPU, and no game files used.AI-assisted (Claude Code): it wrote the change and the tests, and ran the checks listed above.