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>