diff options
author | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-10-29 12:39:58 +0100 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-11-20 11:08:05 +0000 |
commit | 5ff7a3d96e0ce0dcb3d388b53d038cdd40c7a975 (patch) | |
tree | 0a188d045a0aa86e0f94c80f6ef43ec964592c7b /LICENSE.GPLv3 | |
parent | 986a5262e3e753958a6ec9058eb7332d44a9065f (diff) |
Add {add,sub,mul}_overflow for signed integers.
In C++, signed overflow math is Undefined Behavior. However, many CPUs
do implement some way to check for overflow. Some compilers expose
intrinsics to use this functionality. If the no intrinsic is exposed,
overflow checking can be done by widening the result type and "manually"
checking for overflow. Or, for X86, by using inline assembly to use the
CPU features.
Used in QtQml.
Change-Id: I2ef2523ccaa98f6757a45e24862a2fa730a26bb0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'LICENSE.GPLv3')
0 files changed, 0 insertions, 0 deletions