Go to file
mtklein 4311f01661 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

Review URL: https://codereview.chromium.org/1890483002
2016-04-19 14:00:13 -07:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Add bench for image encodes 2016-04-18 12:37:46 -07:00
bin Fix gyp-and-sync for windows 2016-02-22 12:59:53 -08:00
cmake exernalize imagefactory guard 2016-04-15 10:56:52 -07:00
debugger Fix old debugger for sk_sp changes 2016-03-25 07:04:35 -07:00
dm Move DM png code to picture_utils, for use by other tools. 2016-04-19 09:18:11 -07:00
example switch surface to sk_sp 2016-03-23 18:59:25 -07:00
experimental experimental/fiddle -> tools/fiddle 2016-04-18 11:50:07 -07:00
fuzz Update TileImageFilter to sk_sp 2016-04-15 07:57:40 -07:00
gm Update TileImageFilter to sk_sp 2016-04-15 07:57:40 -07:00
gyp Move CPU feature detection to its own file. 2016-04-19 14:00:13 -07:00
include Switch SkColorFilterImageFilter over to new onFilterImage interface (again) 2016-04-19 10:21:03 -07:00
infra Add new coverage_skia.isolate 2016-04-18 04:13:48 -07:00
platform_tools Cleanup android build files and tools 2016-04-18 12:57:35 -07:00
resources Parse icc profiles and exif orientation from jpeg markers 2016-03-21 08:04:40 -07:00
samplecode Update TileImageFilter to sk_sp 2016-04-15 07:57:40 -07:00
site Explain Rietveld patching better on site. 2016-04-14 10:25:01 -07:00
src Move CPU feature detection to its own file. 2016-04-19 14:00:13 -07:00
tests Add more diagnostic messages to ReadWriteAlpha test 2016-04-19 08:32:40 -07:00
third_party Make is_ktx safer 2016-04-12 07:41:22 -07:00
tools Adding support for controlling the global sRGB SkColor switch. 2016-04-19 12:47:54 -07:00
.gitignore Ignore sampleapp_prefs.txt in git. 2016-03-24 12:20:02 -07:00
AUTHORS Add AVX/AVX2 support for runtime check 2016-04-08 15:31:45 -07:00
codereview.settings Automatically add a docs preview link and NOTRY=true when there are only docs changes. 2015-02-26 10:16:13 -08:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Update to ToT shaderc 2016-04-18 13:42:02 -07:00
Doxyfile Documentation: SkCanvas API 2015-05-19 10:21:29 -07:00
gyp_skia Make Win runtime DLLs writeable before overwriting 2016-03-18 08:33:38 -07:00
gyp_skia.py Roll gyp deps from 1765 to 1796. 2013-11-21 18:11:14 +00:00
LICENSE Include resources directory in google3 sync. 2015-10-20 13:00:48 -07:00
make.bat Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
make.py GYP: remove stale skia_scalar gyp variable 2015-11-10 13:25:12 -05:00
Makefile Add visualbench as valid target to Makefile 2015-12-18 08:05:06 -08:00
OWNERS add root files from chrome 2013-08-13 19:11:15 +00:00
PRESUBMIT.py 10.9 is no more 2016-02-25 06:52:18 -08:00
public.bzl exernalize imagefactory guard 2016-04-15 10:56:52 -07:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
SK_IMAGE_VERSION Update SK_IMAGE_VERSION to 3 2016-02-23 08:14:19 -08:00
skia.gyp Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
SKP_VERSION Update SKP version 2016-04-10 00:30:13 -07:00
whitespace.txt Reland of Whitespace change to test Bugdroid+AutoRoll (patchset #1 id:1 of https://codereview.chromium.org/1861713002/ ) 2016-04-05 10:12:56 -07:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.