C++ Logo


Advanced search

Re: [ub] P1407R0: Tell Programmers About Signed Integer Overflow Behavior

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Wed, 30 Jan 2019 16:05:53 -0500
On Wed, Jan 30, 2019 at 2:08 PM Scott Schurr <s.scott.schurr_at_[hidden]>

> Thanks for pointing that out. Yes, saturation might be considered a
> desirable behavior, and I believe it's fairly common for floating point. I
> haven't personally seen hardware- or language-level saturation implemented
> anywhere for integers. The three Analog Devices DSPs that I have used in
> the past did not support saturation for integer operations. But that
> doesn't say anything about TI, Motorola, or other DSP vendors. So integer
> saturation might be out there in the wild. If anyone is aware of a
> documented case, that would be great to know about.
vadd[us][bhw]s on POWER (vector add saturate for various widths of
(un)signed integers) is saturating. VADD for ARM NEON has a saturating form
and supported integer types.

Received on 2019-01-30 22:06:12