diff options
| author | kotorvr <332716892+kotorvr@users.noreply.github.com> | 2026-11-22 20:39:15 +0000 |
|---|---|---|
| committer | kotorvr <332716892+kotorvr@users.noreply.github.com> | 2026-11-22 22:11:33 +0000 |
| commit | f69db1a0a26eca5ff941a8df9ed2aa97766051a6 (patch) | |
| tree | 6bc84d0873e45172ced5c0c2f5849b94988ff163 /runtime/src/pe_loader.cpp | |
| parent | aa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff) | |
tests/spirv_interp: hold integers as 32-bit patterns; signed ops convert themselves
The interpreter kept a value of a signed type as a negative Python int and a
value of an unsigned type as a non-negative one, and used both raw. SPIR-V
defines its signed and unsigned instructions on the bits, so wherever the
instruction and the type disagreed the result was wrong:
OpSLessThanEqual 0x80000000u 1u false (true)
OpShiftRightLogical (int -8) 1 0xfffffffc (0x7ffffffc)
OpULessThan (int -8) 1u true (false)
OpConvertUToF (int -8) -8.0 (2^32)
SMin / SMax of uint values unsigned order
Integers are now always the unsigned 32-bit pattern, and OpS* compares, SMin
and SMax read them through s32(). Also x / -0.0 gave +inf for a positive x.
The 297 tests that run translator output through this interpreter give the
same results.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions