shader: draw the s_movk_i32 sign extension in pixel_aot #337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/342"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by Its3rr0rsWRLD on 2026-11-21T22:46:05Z.
Change
This adds tests only; the translator is unchanged.
pixel_aotalready lowerss_movk_i32by sign-extending its 16-bit immediate and folding the result (tools/pixel_aot.py, thes_mov_b32|s_movk_i32branch). No fixture used the instruction, so the sign extension was never checked on a GPU and SOPK had no covered form. This adds one draw that exports the extension.Verification
Commit
b860dd5plus this change, Windows 10 Enterprise 26H2 build 26300.9974, MSVC 14.51.36231, Windows SDK 10.0.26100.0 DXC.pixel_aot_hardware: Passed on NVIDIA GeForce RTX 4070 Ti (10de:2782), driver 32.0.16.1088.pixel_aot_warp: Passed on WARP 10.0.26100.9818.b860dd5. Every draw reportsdebug_errors=0andmax_absolute_error=0.tests/pixel_aot_check.py binarypasses with the program added to the binary fixtures: LLVM 15.0.6llvm-mcandllvm-objcopy, disassembled throughlibLLVM-17.soandlibLLVM-18.soon Linux. LLVM printss_movk_i32 s48, 0x8000ands_bfe_u32 s49, s48, 0x80018exactly as written. The controls,tests/docs_links_check.pyandtests/bidi_controls_check.pypass.Evidence and follow-up
The program uses only instructions already on
main:s_movk_i32.s_bfe_u32extracts bytes 1 and 3 of each result.v_cvt_f32_f16widens each byte as a binary16 subnormal, and a multiply by 2^24 turns it into the exact integer.With sign extension the draw exports 255, 128, 127 and 0. Two wrong references each report
pixel_mismatch: zero extension, which gives 0 for byte 3 of 0x8000, and treating 0x7fff as negative, which gives 255 for its byte 3.This branch merges cleanly with #288, #293, #324, #329, #334, #337 and #340.
Checklist
AI-assisted: yes. Written with Claude Opus 5.5; verified on the hardware listed above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01X1EBSe6YfE2ivQChRsx1hc