diff options
author | mtklein <mtklein@chromium.org> | 2016-06-07 09:35:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-07 09:35:28 -0700 |
commit | 12dfaaa53c23f3d03050bde8f64136ac1f44164a (patch) | |
tree | 63cfa96123575974f0560f785b3bc63367e15e63 /include/private/SkFloatingPoint.h | |
parent | d62e28b19a23b913c549b7891ecf79e779577181 (diff) |
Move immintrin/arm_neon includes to where they are used.
On my Mac (so, immintrin), this improves compile time, both wall and cpu,
by about 16%. To test I ran this on an SSD with files hot in their caches:
$ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
ninja -C out/Release -t clean && \
time ninja -C out/Release
Before: 159 wall / 3367 cpu
159 wall / 3368 cpu
After: 137 wall / 2860 cpu
136 wall / 2863 cpu
I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
That made no signficant difference, so I've kept immintrin for its simplicity.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
TBR=reed@google.com
No public API changes.
Review-Url: https://codereview.chromium.org/2045633002
Diffstat (limited to 'include/private/SkFloatingPoint.h')
-rw-r--r-- | include/private/SkFloatingPoint.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h index 6ed6144d18..a7aa50cf9f 100644 --- a/include/private/SkFloatingPoint.h +++ b/include/private/SkFloatingPoint.h @@ -15,6 +15,12 @@ #include <math.h> #include <float.h> +#if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1 + #include <xmmintrin.h> +#elif defined(SK_ARM_HAS_NEON) + #include <arm_neon.h> +#endif + // For _POSIX_VERSION #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) #include <unistd.h> |