# saturating arithmetic modifications · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/54675824449d16029fdf6a1873e78cb8f2147f60)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 54675824449d16029fdf6a1873e78cb8f2147f60

Requested commit: 54675824449d16029fdf6a1873e78cb8f2147f60

Commit: 54675824449d16029fdf6a1873e78cb8f2147f60

Tree: a3495ecdbbca9a963f514938f20003f1aeb69b64

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
saturating arithmetic modifications

 * Remove the builtins `@addWithSaturation`, `@subWithSaturation`,
   `@mulWithSaturation`, and `@shlWithSaturation` now that we have
   first-class syntax for saturating arithmetic.
 * langref: Clarify the behavior of `@shlExact`.
 * Ast: rename `bit_shift_left` to `shl` and `bit_shift_right` to `shr`
   for consistency.
 * Air: rename to include underscore separator with consistency with
   the rest of the ops.
 * Air: add shl_exact instruction
 * Use non-extended tags for saturating arithmetic, to keep it
   simple so that all the arithmetic operations can be done the same
   way.
   - Sema: unify analyzeArithmetic with analyzeSatArithmetic
     - implement comptime `+|`, `-|`, and `*|`
     - allow float operands to saturating arithmetic
 * `<<|` allows any integer type for the RHS.
 * C backend: fix rebase conflicts
 * LLVM backend: reduce the amount of branching for arithmetic ops
 * zig.h: fix magic number not matching actual size of C integer types

```

## Parents

- [71da169c67ad544bd1d4dfc4bfff9fe302e8284d](https://git.cafe/gitcafe/zig/commit/71da169c67ad544bd1d4dfc4bfff9fe302e8284d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/54675824449d16029fdf6a1873e78cb8f2147f60?format=markdown)
