Simplify saturated integer add/sub
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Dec 2014 02:46:32 +0000 (02:46 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Dec 2014 02:46:32 +0000 (02:46 +0000)
commit990f58cd5aabf8232d2cfe2010cacdc938b20dd5
treedd5fc9b7fef61697679c34ed29ca3f5b897e8b55
parentc32242eb129c0f3cb7a400bae83cdf8f5c879ad4
Simplify saturated integer add/sub
https://bugs.webkit.org/show_bug.cgi?id=139854

Reviewed by Darin Adler.

* wtf/Compiler.h:
Make a wrapper for __has_builtin for compilers that do not support it.

* wtf/SaturatedArithmetic.h:
(saturatedAddition):
(saturatedSubtraction):
Use the builtins when possible instead of reinventing the wheel.
On ARMv7, use the saturated math instructions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/Compiler.h
Source/WTF/wtf/SaturatedArithmetic.h