Files
scriptc/packages
Malte Ubl 3d1aad70e4 Keep proven int32 arithmetic in 32-bit integers
Integer arithmetic with an int32 result range materialized its number
with `sitofp i64`, which LLVM does not know to be exact, so it could not
fold the conversion back for the next integer use or through the phis of
loop-carried locals: a counter written `i = (i + 1) | 0` converted to a
double and back on every iteration.

With int32 operands and result, `+`, `-` and `*` now emit `add/sub/mul
nsw i32` and convert with `sitofp i32`; other int32-range numbers convert
from the low half of their i64, and an int32-range read of a number uses
`fptosi ... to i32`. The nsw flag stays on the 32-bit operation (a
truncated 64-bit result would lose it), so IndVars can still widen such
counters into 64-bit address arithmetic.
2026-10-12 11:17:03 -07:00
..
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00
2026-10-12 10:31:02 -05:00