Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Issue 2945433003: Add ClampedNumeric templates (Closed)

Created:
3 years, 6 months ago by jschuh
Modified:
3 years, 5 months ago
Reviewers:
dcheng
CC:
chromium-reviews, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add ClampedNumeric templates Add template classes for clamped (not sticky) saturating math. BUG=672489 Review-Url: https://codereview.chromium.org/2945433003 Cr-Commit-Position: refs/heads/master@{#484005} Committed: https://chromium.googlesource.com/chromium/src/+/b180f39aa6a2edc68a5c0e2308aabe639ec029f8

Patch Set 1 #

Patch Set 2 : wip #

Patch Set 3 : mostly done and added tests #

Patch Set 4 : docs, nits, remove asm #

Patch Set 5 : more docs and modulus #

Total comments: 27

Patch Set 6 : post-review fixes #

Total comments: 35

Patch Set 7 : feedback round 2 #

Total comments: 6

Patch Set 8 : final #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1320 lines, -202 lines) Patch
M base/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A base/numerics/README.md View 1 2 3 4 5 6 7 1 chunk +260 lines, -0 lines 0 comments Download
M base/numerics/checked_math.h View 1 2 3 3 chunks +6 lines, -82 lines 0 comments Download
M base/numerics/checked_math_impl.h View 1 2 3 4 5 4 chunks +17 lines, -16 lines 0 comments Download
A base/numerics/clamped_math.h View 1 2 3 4 5 6 7 1 chunk +266 lines, -0 lines 0 comments Download
A base/numerics/clamped_math_impl.h View 1 2 3 4 5 6 1 chunk +290 lines, -0 lines 0 comments Download
M base/numerics/safe_conversions.h View 1 2 3 4 5 6 4 chunks +44 lines, -52 lines 0 comments Download
M base/numerics/safe_conversions_impl.h View 2 chunks +6 lines, -2 lines 0 comments Download
M base/numerics/safe_math.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M base/numerics/safe_math_shared_impl.h View 1 chunk +8 lines, -7 lines 0 comments Download
M base/numerics/safe_numerics_unittest.cc View 1 2 3 4 5 6 7 33 chunks +419 lines, -42 lines 0 comments Download

Messages

Total messages: 31 (21 generated)
jschuh
The big changes are in these files: * base/numerics/clamped_math.h * base/numerics/clamped_math_impl.h And all the tests ...
3 years, 5 months ago (2017-06-26 20:26:50 UTC) #17
jschuh
Oh, one more piece of context. After this CL I have to land some assembler ...
3 years, 5 months ago (2017-06-26 20:32:52 UTC) #18
dcheng
I'm still reviewing clamped_math* in detail (sorry!) but some initial comments to get things started. ...
3 years, 5 months ago (2017-06-28 07:25:07 UTC) #19
jschuh
Thanks for the review. Hopefully this covers everything. https://codereview.chromium.org/2945433003/diff/200001/base/numerics/README.md File base/numerics/README.md (right): https://codereview.chromium.org/2945433003/diff/200001/base/numerics/README.md#newcode32 base/numerics/README.md:32: of ...
3 years, 5 months ago (2017-06-28 12:32:38 UTC) #20
dcheng
https://codereview.chromium.org/2945433003/diff/200001/base/numerics/README.md File base/numerics/README.md (right): https://codereview.chromium.org/2945433003/diff/200001/base/numerics/README.md#newcode32 base/numerics/README.md:32: of the same width. On 2017/06/28 12:32:37, jschuh wrote: ...
3 years, 5 months ago (2017-06-30 07:39:32 UTC) #21
jschuh
Back at ya. https://codereview.chromium.org/2945433003/diff/220001/base/numerics/checked_math_impl.h File base/numerics/checked_math_impl.h (right): https://codereview.chromium.org/2945433003/diff/220001/base/numerics/checked_math_impl.h#newcode290 base/numerics/checked_math_impl.h:290: as_unsigned(shift) < IntegerBitsPlusSign<T>::value) { On 2017/06/30 ...
3 years, 5 months ago (2017-07-01 06:32:00 UTC) #23
dcheng
🎆 LGTM 🎆 https://codereview.chromium.org/2945433003/diff/220001/base/numerics/clamped_math.h File base/numerics/clamped_math.h (right): https://codereview.chromium.org/2945433003/diff/220001/base/numerics/clamped_math.h#newcode84 base/numerics/clamped_math.h:84: NegateWrapper(value_) != std::numeric_limits<T>::lowest()) On 2017/07/01 06:31:59, ...
3 years, 5 months ago (2017-07-03 10:01:44 UTC) #24
jschuh
https://codereview.chromium.org/2945433003/diff/260001/base/numerics/README.md File base/numerics/README.md (right): https://codereview.chromium.org/2945433003/diff/260001/base/numerics/README.md#newcode205 base/numerics/README.md:205: limit (max/min). 0 shifted any amount results in 0. ...
3 years, 5 months ago (2017-07-03 13:03:46 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2945433003/280001
3 years, 5 months ago (2017-07-03 13:04:02 UTC) #28
commit-bot: I haz the power
3 years, 5 months ago (2017-07-03 15:09:44 UTC) #31
Message was sent while issue was closed.
Committed patchset #8 (id:280001) as
https://chromium.googlesource.com/chromium/src/+/b180f39aa6a2edc68a5c0e2308aa...

Powered by Google App Engine
This is Rietveld 408576698