Changeset 184369 in webkit
- Timestamp:
- May 14, 2015, 9:36:27 PM (10 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r184341 r184369 1 2015-05-14 Dan Bernstein <mitz@apple.com> 2 3 Reverted r177753, now that <rdar://problem/19347133> is fixed. 4 5 Rubber-stamped by Benjamin Poulain. 6 7 * wtf/SaturatedArithmetic.h: 8 (signedAddOverflows): 9 (signedSubtractOverflows): 10 1 11 2015-05-14 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/Source/WTF/wtf/SaturatedArithmetic.h
r182676 r184369 40 40 inline bool signedAddOverflows(int32_t a, int32_t b, int32_t& result) 41 41 { 42 #if COMPILER_HAS_CLANG_BUILTIN(__builtin_sadd_overflow) 43 return __builtin_sadd_overflow(a, b, &result); 44 #else 42 45 uint32_t ua = a; 43 46 uint32_t ub = b; … … 48 51 // bit of the result and one of the values differ it did overflow. 49 52 return !((ua ^ ub) >> 31) && (uresult ^ ua) >> 31; 53 #endif 50 54 } 51 55 … … 68 72 inline bool signedSubtractOverflows(int32_t a, int32_t b, int32_t& result) 69 73 { 74 #if COMPILER_HAS_CLANG_BUILTIN(__builtin_ssub_overflow) 75 return __builtin_ssub_overflow(a, b, &result); 76 #else 70 77 uint32_t ua = a; 71 78 uint32_t ub = b; … … 76 83 // signed bit of the result and the first value differ it did overflow. 77 84 return (ua ^ ub) >> 31 && (uresult ^ ua) >> 31; 85 #endif 78 86 } 79 87
Note:
See TracChangeset
for help on using the changeset viewer.