upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
authorkotorvr <332716892+kotorvr@users.noreply.github.com>2026-11-22 20:39:15 +0000
committerkotorvr <332716892+kotorvr@users.noreply.github.com>2026-11-22 20:39:15 +0000
commit70154750b2eb4b80fbe7cb9a33d087d6cc433a2d (patch)
tree5eb01ec1102be8bdc9bf79160eb9098b21609cf1 /runtime/src/pe_loader.cpp
parentf847748cc76bd3777f9c070c4034eb2fc1c04e64 (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