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

Issue 1890483002: Move CPU feature detection to its own file. (Closed)

Created:
4 years, 8 months ago by mtklein_C
Modified:
4 years, 8 months ago
Reviewers:
herb_g, mtklein, f(malita), reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Move CPU feature detection to its own file. - Moves CPU feature detection to its own file. - Cleans up some redundant feature detection scattered around core/ and opts/. - Can now detect a few new CPU features: * F16C -> Intel f16<->f32 instructions, added between AVX and AVX2 * FMA -> Intel FMA instructions, added at the same time as AVX2 * VFP_FP16 -> ARM f16<->f32 instructions, quite common * NEON_FMA -> ARM FMA instructions, also quite common * SSE and SSE3... why not? This new internal API makes it very cheap to do fine-grained runtime CPU feature detection. Redundant calls to SkCpu::Supports() should be eliminated and it's hoistable out of loops. It compiles away entirely when we have the appropriate instructions available at compile time. This means we can call it to guard even a little snippet of 1 or 2 instructions right where needed and let inlining hoist the check (if any at all) up to somewhere that doesn't hurt performance. I've explained how I made this work in the private section of the new header. Once this lands and bakes a bit, I'll start following up with CLs to use it more and to add a bunch of those little 1-2 instruction snippets we've been wanting, e.g. cvtps2ph, cvtph2ps, ptest, pmulld, pmovzxbd, blendvps, pshufb, roundps (for floor) on x86, and vcvt.f32.f16, vcvt.f16.f32 on ARM. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890483002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/872ea29357439f05b1f6995dd300fc054733e607 Committed: https://skia.googlesource.com/skia/+/4311f016612a814282029daa4bd102053a853d82

Patch Set 1 #

Patch Set 2 : port opts_check_x86 #

Patch Set 3 : typo #

Patch Set 4 : warning #

Patch Set 5 : Update old NEON detection code too. #

Patch Set 6 : getting ahead of myself on F16C #

Total comments: 6

Patch Set 7 : link #

Unified diffs Side-by-side diffs Delta from patch set Stats (+240 lines, -307 lines) Patch
M gyp/core.gyp View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download
M gyp/core.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
A src/core/SkCpu.h View 1 2 3 4 5 1 chunk +123 lines, -0 lines 0 comments Download
A src/core/SkCpu.cpp View 1 2 3 4 5 6 1 chunk +90 lines, -0 lines 0 comments Download
M src/core/SkOpts.cpp View 3 chunks +11 lines, -51 lines 0 comments Download
M src/core/SkUtilsArm.h View 1 2 3 4 2 chunks +5 lines, -9 lines 0 comments Download
M src/core/SkUtilsArm.cpp View 1 2 3 4 1 chunk +1 line, -138 lines 0 comments Download
M src/opts/opts_check_x86.cpp View 1 7 chunks +8 lines, -102 lines 0 comments Download

Messages

Total messages: 51 (27 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/40001
4 years, 8 months ago (2016-04-13 16:27:09 UTC) #5
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Ubuntu-GCC-x86_64-Release-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-Trybot/builds/7819)
4 years, 8 months ago (2016-04-13 16:28:45 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/60001
4 years, 8 months ago (2016-04-13 16:30:19 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-13 16:40:02 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/80001
4 years, 8 months ago (2016-04-13 16:52:22 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-13 17:02:20 UTC) #20
mtklein_C
4 years, 8 months ago (2016-04-13 17:16:22 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/80001
4 years, 8 months ago (2016-04-13 17:16:25 UTC) #24
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
4 years, 8 months ago (2016-04-13 17:16:27 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/100001
4 years, 8 months ago (2016-04-13 20:31:07 UTC) #27
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-13 20:42:38 UTC) #29
mtklein_C
+Mike and Florin I think I can take yesterday's half<->float CL in a slightly different ...
4 years, 8 months ago (2016-04-13 22:28:14 UTC) #31
herb_g
lgtm Yeah!!! https://codereview.chromium.org/1890483002/diff/100001/src/core/SkCpu.cpp File src/core/SkCpu.cpp (right): https://codereview.chromium.org/1890483002/diff/100001/src/core/SkCpu.cpp#newcode18 src/core/SkCpu.cpp:18: #include <cpuid.h> If you have a link ...
4 years, 8 months ago (2016-04-14 15:38:34 UTC) #32
f(malita)
lgtm https://codereview.chromium.org/1890483002/diff/100001/src/core/SkCpu.cpp File src/core/SkCpu.cpp (right): https://codereview.chromium.org/1890483002/diff/100001/src/core/SkCpu.cpp#newcode39 src/core/SkCpu.cpp:39: if (abcd[3] & (1<<25)) { features |= SkCpu:: ...
4 years, 8 months ago (2016-04-14 15:40:36 UTC) #33
mtklein
https://codereview.chromium.org/1890483002/diff/100001/src/core/SkCpu.cpp File src/core/SkCpu.cpp (right): https://codereview.chromium.org/1890483002/diff/100001/src/core/SkCpu.cpp#newcode18 src/core/SkCpu.cpp:18: #include <cpuid.h> On 2016/04/14 at 15:38:34, herb_g wrote: > ...
4 years, 8 months ago (2016-04-14 15:52:28 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/120001
4 years, 8 months ago (2016-04-14 15:53:27 UTC) #38
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://skia.googlesource.com/skia/+/872ea29357439f05b1f6995dd300fc054733e607
4 years, 8 months ago (2016-04-14 16:03:38 UTC) #40
mtklein
A revert of this CL (patchset #7 id:120001) has been created in https://codereview.chromium.org/1892643003/ by mtklein@google.com. ...
4 years, 8 months ago (2016-04-15 15:40:06 UTC) #41
mtklein
On 2016/04/15 at 15:40:06, mtklein wrote: > A revert of this CL (patchset #7 id:120001) ...
4 years, 8 months ago (2016-04-19 15:32:39 UTC) #42
mtklein
On 2016/04/19 at 15:32:39, mtklein wrote: > On 2016/04/15 at 15:40:06, mtklein wrote: > > ...
4 years, 8 months ago (2016-04-19 15:36:33 UTC) #43
mtklein
On 2016/04/19 at 15:36:33, mtklein wrote: > On 2016/04/19 at 15:32:39, mtklein wrote: > > ...
4 years, 8 months ago (2016-04-19 16:05:04 UTC) #44
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/120001
4 years, 8 months ago (2016-04-19 20:41:58 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1890483002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1890483002/120001
4 years, 8 months ago (2016-04-19 20:49:58 UTC) #49
commit-bot: I haz the power
4 years, 8 months ago (2016-04-19 21:00:20 UTC) #51
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://skia.googlesource.com/skia/+/4311f016612a814282029daa4bd102053a853d82

Powered by Google App Engine
This is Rietveld 408576698