Files
sx/examples/expected/1701-atomics-rmw.stdout
agra 68ed732b79 atomics A.1c: fix comptime signed fetch_min/max (was unsigned compare)
Adversarial review CRITICAL: the comptime VM's atomic_rmw min/max arm called
@max/@min directly on Reg (=u64) values for SIGNED types, doing an UNSIGNED
compare — so comptime fetch_min/max on negatives diverged from the runtime LLVM
atomicrmw min/max (signed). Fix: reinterpret as i64 in the signed branch before
comparing, bitcast back (mirrors the unsigned branch + the emit-side signedness).

Closes the coverage gap that hid it: extend examples/1701 with signed min/max on
a negative at BOTH comptime (#run) and runtime — they now agree (3 / -5). Suite
green (716/0).
2026-06-20 10:32:50 +03:00

14 lines
206 B
Plaintext

old add: 10
old sub: 15
now: 12
old and: 240
old or: 48
old xor: 51
now: 60
old min: 20
old max: 8
now: 15
runtime signed max(-5,3): 3
runtime signed min(-5,3): -5
comptime signed max(-5,3)=3 min(-5,3)=-5