diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-01-19 13:45:36 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-19 13:47:51 -0700 |
| commit | d5d0619aacccd5e3b933b3196fba5ab6f8f9da47 (patch) | |
| tree | c6705b09ed101a0fb362f1a646b1a44b9aac3d30 /src/codegen/arm.zig | |
| parent | d5b0a963d1bf3399e3d8b63b03ea61f7d771adbd (diff) | |
| download | zig-d5d0619aacccd5e3b933b3196fba5ab6f8f9da47.tar.gz zig-d5d0619aacccd5e3b933b3196fba5ab6f8f9da47.zip | |
stage2: ELF: avoid multiplication for ideal capacity
ideal capacity is now determined by e.g.
x += x / f
rather than
x = x * b / a
This turns a multiplication into an addition, making it less likely to
overflow the integer. This commit also introduces padToIdeal() which
does saturating arithmetic so that no overflow is possible when
calculating ideal capacity.
closes #7830
Diffstat (limited to 'src/codegen/arm.zig')
0 files changed, 0 insertions, 0 deletions
