Re:How expensive is integer-overflow trapping in C++?
by zeotroph on Thursday September 24, 2020 @05:48AM
(#24576955)
So is Swift effectively adding a jo / jump on overflow instruction after each normal integer operation?
[ Parent
| on HN ]
Re:How expensive is integer-overflow trapping in C++?
by saeta on Thursday September 24, 2020 @10:15AM
(#24578795)
`+` is checked for overflow by default (can be overridden with compiler flags), and `&+` is overflowing addition and does auto-vectorize equivalently to C++.
I'd be quite interested in seeing a benchmark comparing checked and unchecked addition that doesn't get auto-vectorized to understand the performance in practice for non-numerical computing.