New issue
Advanced search Search tips

Issue 672489 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocked on:
issue 746420
issue 746505



Sign in to add a comment

Cleanup base/numerics/saturated_* code ported from blink

Project Member Reported by jsc...@chromium.org, Dec 8 2016

Issue description

The major things I see are:

- The generic code should support at least the range of signed integral types (that's a very straight-forward change).
- The naming conventions and general structure should more closely align with what we're already doing with the CheckedNumeric code (this might require some discussion).
- We need to resolve and document the semantics for corner cases like pegging saturation, saturated_max * 0, or saturated_max + saturated_min (the last two are NaN for IEEE floating points, but they're normal math in this code, which feels a bit scary to me).
- This really should be C++11 constexpr clean, which can't be done with the way the assembler is implemented today (although we should be able to work it with __builtin_constant_p and some wrapper hackery).
- Blink specific code like SaturatedSet should be moved back into blink, along with the corresponding tests.
- In keeping with the rest of the library, this should have no external dependencies to base or other Chrome code (it looks like we just have some compiler-specific stuff, which is easy enough to fix).

I probably should have been a reviewer on the CL that landed this. I was fine with pulling the math in from blink, but I've put a lot of effort in keeping this library consistent and portable, because it's pulled into a lot of other code. Unfortunately, this addition kinda breaks that. However, I might make it my X-mas project to take care of this for fun.

 
Thanks, it'd be great if you can. We needed to move this for partitionalloc, but it'd be nice to improve it now that it's moved.
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/186c7dbbea5eef852bf0c4277d1da16f56f9156e

commit 186c7dbbea5eef852bf0c4277d1da16f56f9156e
Author: jschuh <jschuh@chromium.org>
Date: Fri Dec 16 07:32:31 2016

Support saturation overrides in saturated_cast

This is a requirement for adding a full saturated type implementation.

BUG= 672489 
NOTRY=true

Review-Url: https://codereview.chromium.org/2578613002
Cr-Commit-Position: refs/heads/master@{#439061}

[modify] https://crrev.com/186c7dbbea5eef852bf0c4277d1da16f56f9156e/base/numerics/safe_conversions.h
[modify] https://crrev.com/186c7dbbea5eef852bf0c4277d1da16f56f9156e/base/numerics/safe_conversions_impl.h
[modify] https://crrev.com/186c7dbbea5eef852bf0c4277d1da16f56f9156e/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Dec 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7772a0500fa206d81a4a7fb00c92934eeb609b50

commit 7772a0500fa206d81a4a7fb00c92934eeb609b50
Author: agrieve <agrieve@chromium.org>
Date: Fri Dec 16 18:18:48 2016

Revert of Support saturation overrides in saturated_cast (patchset #7 id:180001 of https://codereview.chromium.org/2578613002/ )

Reason for revert:
Suspect breaking base_unittests (missing test name in unittest macro).
https://uberchromegw.corp.google.com/i/chromium.linux/builders/Android%20Tests%20%28dbg%29/builds/38202

Original issue's description:
> Support saturation overrides in saturated_cast
>
> This is a requirement for adding a full saturated type implementation.
>
> BUG= 672489 
> NOTRY=true
>
> Committed: https://crrev.com/186c7dbbea5eef852bf0c4277d1da16f56f9156e
> Cr-Commit-Position: refs/heads/master@{#439061}

TBR=eae@chromium.org,jschuh@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 672489 ,674849

Review-Url: https://codereview.chromium.org/2582063002
Cr-Commit-Position: refs/heads/master@{#439150}

[modify] https://crrev.com/7772a0500fa206d81a4a7fb00c92934eeb609b50/base/numerics/safe_conversions.h
[modify] https://crrev.com/7772a0500fa206d81a4a7fb00c92934eeb609b50/base/numerics/safe_conversions_impl.h
[modify] https://crrev.com/7772a0500fa206d81a4a7fb00c92934eeb609b50/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Dec 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71b669adca7b10a7fcecec151ec8b1c66a4c90a0

commit 71b669adca7b10a7fcecec151ec8b1c66a4c90a0
Author: jschuh <jschuh@chromium.org>
Date: Sat Dec 17 01:13:31 2016

Support saturation overrides in saturated_cast

This is a requirement for adding a full saturated type implementation.

BUG= 672489 
TBR=eae
NOTRY=true

Review-Url: https://codereview.chromium.org/2579363002
Cr-Commit-Position: refs/heads/master@{#439274}

[modify] https://crrev.com/71b669adca7b10a7fcecec151ec8b1c66a4c90a0/base/numerics/safe_conversions.h
[modify] https://crrev.com/71b669adca7b10a7fcecec151ec8b1c66a4c90a0/base/numerics/safe_conversions_impl.h
[modify] https://crrev.com/71b669adca7b10a7fcecec151ec8b1c66a4c90a0/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b180f39aa6a2edc68a5c0e2308aabe639ec029f8

commit b180f39aa6a2edc68a5c0e2308aabe639ec029f8
Author: jschuh <jschuh@chromium.org>
Date: Mon Jul 03 15:09:22 2017

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}

[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/BUILD.gn
[add] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/README.md
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/checked_math.h
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/checked_math_impl.h
[add] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/clamped_math.h
[add] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/clamped_math_impl.h
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/safe_conversions.h
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/safe_conversions_impl.h
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/safe_math.h
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/safe_math_shared_impl.h
[modify] https://crrev.com/b180f39aa6a2edc68a5c0e2308aabe639ec029f8/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/48b272671a15f02ae84cfb147c793467731eeb5f

commit 48b272671a15f02ae84cfb147c793467731eeb5f
Author: Justin Schuh <jschuh@chromium.org>
Date: Tue Jul 11 02:46:26 2017

Move base/numerics compiler-specific intrinsics to their own file

Splits the optimized builtins into their own file, which creates the
interfaces for adding the optimized ARM versions in a follow-up CL.

BUG= 672489 

Change-Id: I356fb4d166f4773b111f3c61c6206e3d4b4ccd40
Reviewed-on: https://chromium-review.googlesource.com/562754
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485500}
[modify] https://crrev.com/48b272671a15f02ae84cfb147c793467731eeb5f/base/BUILD.gn
[modify] https://crrev.com/48b272671a15f02ae84cfb147c793467731eeb5f/base/numerics/checked_math_impl.h
[modify] https://crrev.com/48b272671a15f02ae84cfb147c793467731eeb5f/base/numerics/clamped_math_impl.h
[modify] https://crrev.com/48b272671a15f02ae84cfb147c793467731eeb5f/base/numerics/safe_conversions.h
[add] https://crrev.com/48b272671a15f02ae84cfb147c793467731eeb5f/base/numerics/safe_math_clang_gcc_impl.h
[modify] https://crrev.com/48b272671a15f02ae84cfb147c793467731eeb5f/base/numerics/safe_math_shared_impl.h

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f3a69e04904490b38e515492118f32c69e772e87

commit f3a69e04904490b38e515492118f32c69e772e87
Author: Justin Schuh <jschuh@chromium.org>
Date: Thu Jul 13 18:07:25 2017

Add optimized arm implementations to base/numerics

BUG= 672489 

Change-Id: I7bb13d0ae3850f3334978bd8d483550ea2f3e3fd
Reviewed-on: https://chromium-review.googlesource.com/567436
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486438}
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/BUILD.gn
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/clamped_math_impl.h
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_conversions.h
[add] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_conversions_arm_impl.h
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_conversions_impl.h
[add] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_math_arm_impl.h
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_math_clang_gcc_impl.h
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_math_shared_impl.h
[modify] https://crrev.com/f3a69e04904490b38e515492118f32c69e772e87/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42

commit e9d94b7d5d3874c9e1c182e0e80977fb0675cf42
Author: Justin Schuh <jschuh@chromium.org>
Date: Thu Jul 13 19:32:36 2017

Revert "Add optimized arm implementations to base/numerics"

This reverts commit f3a69e04904490b38e515492118f32c69e772e87.

Reason for revert: ios-device and ios-device-xcode-clang broken

Original change's description:
> Add optimized arm implementations to base/numerics
> 
> BUG= 672489 
> 
> Change-Id: I7bb13d0ae3850f3334978bd8d483550ea2f3e3fd
> Reviewed-on: https://chromium-review.googlesource.com/567436
> Commit-Queue: Emil A Eklund <eae@chromium.org>
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#486438}

TBR=jschuh@chromium.org,eae@chromium.org

Change-Id: I2555ad7458b1379675e2c9fd4385d4bdaef0212c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  672489 
Reviewed-on: https://chromium-review.googlesource.com/570898
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486455}
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/BUILD.gn
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/numerics/clamped_math_impl.h
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/numerics/safe_conversions.h
[delete] https://crrev.com/2caa66fd7e8f735a14c54f940e7637149a874056/base/numerics/safe_conversions_arm_impl.h
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/numerics/safe_conversions_impl.h
[delete] https://crrev.com/2caa66fd7e8f735a14c54f940e7637149a874056/base/numerics/safe_math_arm_impl.h
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/numerics/safe_math_clang_gcc_impl.h
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/numerics/safe_math_shared_impl.h
[modify] https://crrev.com/e9d94b7d5d3874c9e1c182e0e80977fb0675cf42/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Jul 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a26da27271822e842b106f0b58b61766d1b5da39

commit a26da27271822e842b106f0b58b61766d1b5da39
Author: Justin Schuh <jschuh@chromium.org>
Date: Thu Jul 13 23:04:30 2017

Add optimized arm implementations to base/numerics

This is a reland of f3a69e04904490b38e515492118f32c69e772e87

Bug:  672489 
Change-Id: I7f4c6a679ced59e839650f372a3c79bea106534e
Reviewed-on: https://chromium-review.googlesource.com/570508
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486515}
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/BUILD.gn
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/clamped_math_impl.h
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_conversions.h
[add] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_conversions_arm_impl.h
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_conversions_impl.h
[add] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_math_arm_impl.h
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_math_clang_gcc_impl.h
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_math_shared_impl.h
[modify] https://crrev.com/a26da27271822e842b106f0b58b61766d1b5da39/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a81d2e5d1c20b936eb8ed358fb3d06c0db87e01d

commit a81d2e5d1c20b936eb8ed358fb3d06c0db87e01d
Author: Justin Schuh <jschuh@chromium.org>
Date: Fri Jul 14 02:53:34 2017

Fix Max/Min methods for ClampedNumeric and add tests

Bug:  672489 
Change-Id: Iae92cb94375f5067b16dea72972e742e0cea3377
Reviewed-on: https://chromium-review.googlesource.com/571452
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486649}
[modify] https://crrev.com/a81d2e5d1c20b936eb8ed358fb3d06c0db87e01d/base/numerics/clamped_math.h
[modify] https://crrev.com/a81d2e5d1c20b936eb8ed358fb3d06c0db87e01d/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/191d11489cb9f83e1e1575a29abf3904e7efa87b

commit 191d11489cb9f83e1e1575a29abf3904e7efa87b
Author: Justin Schuh <jschuh@chromium.org>
Date: Fri Jul 14 22:12:07 2017

Replace Saturated*() calls with Clamp*() templates

This replaces the calls but leaves the saturated_arithmetic headers
where they are. Those will be moved in the next CL.

Bug:  672489 
Change-Id: If901e49240b2e8d1f85155b9b395d9bb584300cf
Reviewed-on: https://chromium-review.googlesource.com/571317
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486905}
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/base/numerics/clamped_math.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/base/numerics/saturated_arithmetic.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/base/numerics/saturated_arithmetic_arm.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/base/numerics/saturated_arithmetic_unittest.cc
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/cc/base/rtree.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/third_party/WebKit/Source/platform/LayoutUnit.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/third_party/WebKit/Source/platform/geometry/IntPoint.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/third_party/WebKit/Source/platform/wtf/SaturatedArithmetic.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/ui/gfx/geometry/point.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/ui/gfx/geometry/rect.cc
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/ui/gfx/geometry/rect.h
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/ui/gfx/geometry/size.cc
[modify] https://crrev.com/191d11489cb9f83e1e1575a29abf3904e7efa87b/ui/gfx/geometry/vector2d.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b1573039b77716775b1309715ef8c9d3b34eef70

commit b1573039b77716775b1309715ef8c9d3b34eef70
Author: Justin Schuh <jschuh@chromium.org>
Date: Fri Jul 14 23:04:47 2017

Revert "Replace Saturated*() calls with Clamp*() templates"

This reverts commit 191d11489cb9f83e1e1575a29abf3904e7efa87b.

Reason for revert: NaCl broke on the Linux x64 builder

Original change's description:
> Replace Saturated*() calls with Clamp*() templates
> 
> This replaces the calls but leaves the saturated_arithmetic headers
> where they are. Those will be moved in the next CL.
> 
> Bug:  672489 
> Change-Id: If901e49240b2e8d1f85155b9b395d9bb584300cf
> Reviewed-on: https://chromium-review.googlesource.com/571317
> Commit-Queue: Justin Schuh <jschuh@chromium.org>
> Reviewed-by: Emil A Eklund <eae@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#486905}

TBR=danakj@chromium.org,jschuh@chromium.org,eae@chromium.org

Change-Id: I6515c4ffa226fe39027c91f77d42051f2638686e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  672489 
Reviewed-on: https://chromium-review.googlesource.com/572307
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486916}
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/base/numerics/clamped_math.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/base/numerics/saturated_arithmetic.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/base/numerics/saturated_arithmetic_arm.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/base/numerics/saturated_arithmetic_unittest.cc
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/cc/base/rtree.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/third_party/WebKit/Source/platform/LayoutUnit.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/third_party/WebKit/Source/platform/geometry/IntPoint.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/third_party/WebKit/Source/platform/wtf/SaturatedArithmetic.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/ui/gfx/geometry/point.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/ui/gfx/geometry/rect.cc
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/ui/gfx/geometry/rect.h
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/ui/gfx/geometry/size.cc
[modify] https://crrev.com/b1573039b77716775b1309715ef8c9d3b34eef70/ui/gfx/geometry/vector2d.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Jul 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a15cf3ca707d95f5899f99c24d2b96862ad8e630

commit a15cf3ca707d95f5899f99c24d2b96862ad8e630
Author: Justin Schuh <jschuh@chromium.org>
Date: Fri Jul 14 23:16:58 2017

Add optimized negation to ClampedNumeric

Integrates the GCC subtract-carry intrinsics for intel, etc, and the
saturated instructions on arm.

Bug:  672489 
Change-Id: I5db9d94224ab9c87fb025e0150879558a64f238f
Reviewed-on: https://chromium-review.googlesource.com/571404
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486929}
[modify] https://crrev.com/a15cf3ca707d95f5899f99c24d2b96862ad8e630/base/numerics/clamped_math.h
[modify] https://crrev.com/a15cf3ca707d95f5899f99c24d2b96862ad8e630/base/numerics/safe_math_clang_gcc_impl.h
[modify] https://crrev.com/a15cf3ca707d95f5899f99c24d2b96862ad8e630/base/numerics/safe_numerics_unittest.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Jul 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36

commit c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36
Author: Justin Schuh <jschuh@chromium.org>
Date: Tue Jul 18 05:35:46 2017

Replace Saturated*() calls with Clamp*() templates

This replaces the calls but leaves the saturated_arithmetic headers
where they are. Those will be moved in the next CL.
This is a reland of 191d11489cb9f83e1e1575a29abf3904e7efa87b

TBR=eae@chromium.org

Bug:  672489 
Change-Id: I7efb5025ace03b3fc8ff8b698a456162b27ee2a7
Reviewed-on: https://chromium-review.googlesource.com/572145
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487393}
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/base/numerics/clamped_math.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/base/numerics/saturated_arithmetic.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/base/numerics/saturated_arithmetic_arm.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/base/numerics/saturated_arithmetic_unittest.cc
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/cc/base/rtree.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/third_party/WebKit/Source/platform/LayoutUnit.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/third_party/WebKit/Source/platform/geometry/IntPoint.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/third_party/WebKit/Source/platform/wtf/SaturatedArithmetic.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/ui/gfx/geometry/point.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/ui/gfx/geometry/rect.cc
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/ui/gfx/geometry/rect.h
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/ui/gfx/geometry/size.cc
[modify] https://crrev.com/c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36/ui/gfx/geometry/vector2d.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Jul 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea

commit 5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea
Author: Justin Schuh <jschuh@chromium.org>
Date: Tue Jul 18 06:44:35 2017

Revert "Replace Saturated*() calls with Clamp*() templates"

This reverts commit c8067e05e5e11cdb0b5b57e09bc7275e6a7abc36.

Reason for revert: failure on Google Chrome Linux x64
https://build.chromium.org/p/chromium.chrome/buildstatus?builder=Google%20Chrome%20Linux%20x64&number=19288

Original change's description:
> Replace Saturated*() calls with Clamp*() templates
> 
> This replaces the calls but leaves the saturated_arithmetic headers
> where they are. Those will be moved in the next CL.
> This is a reland of 191d11489cb9f83e1e1575a29abf3904e7efa87b
> 
> TBR=eae@chromium.org
> 
> Bug:  672489 
> Change-Id: I7efb5025ace03b3fc8ff8b698a456162b27ee2a7
> Reviewed-on: https://chromium-review.googlesource.com/572145
> Commit-Queue: Justin Schuh <jschuh@chromium.org>
> Reviewed-by: Justin Schuh <jschuh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#487393}

TBR=jschuh@chromium.org,eae@chromium.org

Change-Id: Ie9432e293f7d1f9670209d1e8223c0632ff63105
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  672489 
Reviewed-on: https://chromium-review.googlesource.com/575852
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487398}
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/base/numerics/clamped_math.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/base/numerics/saturated_arithmetic.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/base/numerics/saturated_arithmetic_arm.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/base/numerics/saturated_arithmetic_unittest.cc
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/cc/base/rtree.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/third_party/WebKit/Source/platform/LayoutUnit.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/third_party/WebKit/Source/platform/geometry/IntPoint.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/third_party/WebKit/Source/platform/wtf/SaturatedArithmetic.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/ui/gfx/geometry/point.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/ui/gfx/geometry/rect.cc
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/ui/gfx/geometry/rect.h
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/ui/gfx/geometry/size.cc
[modify] https://crrev.com/5a28bfad5b3d5c0e09d15b06c35924cc79f8bcea/ui/gfx/geometry/vector2d.cc

Blockedon: 746420
Blockedon: 746505
Project Member

Comment 19 by bugdroid1@chromium.org, Jul 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4a572da99ce704e632221bd05e6d894d49a73dcc

commit 4a572da99ce704e632221bd05e6d894d49a73dcc
Author: Justin Schuh <jschuh@chromium.org>
Date: Mon Jul 24 14:37:24 2017

Replace Saturated*() calls with Clamp*() templates

This replaces the calls but leaves the saturated_arithmetic headers
where they are. Those will be moved in the next CL.
This is a reland of 191d11489cb9f83e1e1575a29abf3904e7efa87b

TBR=eae@chromium.org

Bug:  672489 
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I8e88f30fe3d22db3cac5bfcf13e83fc8dbaff870
Reviewed-on: https://chromium-review.googlesource.com/576137
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Justin Schuh <jschuh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488966}
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/base/numerics/clamped_math.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/base/numerics/saturated_arithmetic.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/base/numerics/saturated_arithmetic_arm.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/base/numerics/saturated_arithmetic_unittest.cc
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/cc/base/rtree.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/third_party/WebKit/Source/core/layout/LayoutListItem.cpp
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/third_party/WebKit/Source/core/paint/NinePieceImageGrid.cpp
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/third_party/WebKit/Source/platform/LayoutUnit.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/third_party/WebKit/Source/platform/geometry/IntPoint.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/third_party/WebKit/Source/platform/wtf/SaturatedArithmetic.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/ui/gfx/geometry/point.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/ui/gfx/geometry/rect.cc
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/ui/gfx/geometry/rect.h
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/ui/gfx/geometry/size.cc
[modify] https://crrev.com/4a572da99ce704e632221bd05e6d894d49a73dcc/ui/gfx/geometry/vector2d.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Jul 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0d61b7ad82f191b22ccc7774bf6abd932af96eaa

commit 0d61b7ad82f191b22ccc7774bf6abd932af96eaa
Author: Justin Schuh <jschuh@chromium.org>
Date: Tue Jul 25 15:41:32 2017

Move blink layout-specific saturated math back to WTF

With the move to ClampedNumeric<> the only API left is SaturatedSet(),
which is specific to the blink layout code.

Bug:  672489 
Change-Id: I6806cfcd05d5e83c25cb112d0d25417014f10e06
Reviewed-on: https://chromium-review.googlesource.com/582509
Commit-Queue: Justin Schuh <jschuh@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489313}
[modify] https://crrev.com/0d61b7ad82f191b22ccc7774bf6abd932af96eaa/base/BUILD.gn
[delete] https://crrev.com/36f87e57654c712296d4ebdad6533f427be631e8/base/numerics/saturated_arithmetic.h
[modify] https://crrev.com/0d61b7ad82f191b22ccc7774bf6abd932af96eaa/chromecast/media/cma/backend/alsa/stream_mixer_alsa.cc
[modify] https://crrev.com/0d61b7ad82f191b22ccc7774bf6abd932af96eaa/third_party/WebKit/Source/platform/wtf/BUILD.gn
[modify] https://crrev.com/0d61b7ad82f191b22ccc7774bf6abd932af96eaa/third_party/WebKit/Source/platform/wtf/SaturatedArithmetic.h
[rename] https://crrev.com/0d61b7ad82f191b22ccc7774bf6abd932af96eaa/third_party/WebKit/Source/platform/wtf/SaturatedArithmeticARM.h
[rename] https://crrev.com/0d61b7ad82f191b22ccc7774bf6abd932af96eaa/third_party/WebKit/Source/platform/wtf/SaturatedArithmeticTest.cpp

Owner: jsc...@chromium.org
Status: Fixed (was: Untriaged)
The blink-specific code is now moved back following the Clank roll. And with r489313 I have BUILD.gn and DEPS files in place to prevent future regressions. So, I'm calling it fixed.

Sign in to add a comment