Commit graph

1 commit

Author SHA1 Message Date
Andreas Kling
31f816a6d8 AK: Add SaturatingMath.h with branchless saturating arithmetic
Add standalone saturating_add(), saturating_sub(), and
saturating_mul() free functions for integral types.

The signed implementations are fully branchless, using
__builtin_add/sub/mul_overflow combined with bitmask selection.
2026-03-21 18:20:09 -05:00