diff options
author | mtklein <mtklein@chromium.org> | 2016-07-11 09:59:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-07-11 09:59:21 -0700 |
commit | 5608e2ed2299496eee3c57e0fe426ae9bd0d07a4 (patch) | |
tree | 62fccd2b4c04aaa60b898c5c5b0b41ce1f40cfb0 /src/core/SkHalf.h | |
parent | d6767aa2d52d2612f2b7f9b27b1c3e72ac1389cd (diff) |
Clean up hyper-local SkCpu feature test experiment.
This removes the code paths where we make SkCpu::Supports() calls
from within a tight loop. It keeps code paths using SkCpu::Supports()
to choose entire routines from src/opts/.
We can't rely on these hyper-local checks to be hoisted up reliably enough.
It worked pretty well with the first couple platforms we tried (e.g. Clang
on Linux/Mac) but we can't gaurantee it works everywhere.
Further, I'm not able to actually do anything fancy with those tests
outside of x86... I've not found a way to get, say, NEON+F16 conversion
code embedded into ordinary NEON code outside writing then entire function
in external assembly.
This whole idea becomes less important now that we've got a way to chain
separate function calls together efficiently. We can now, e.g., use an
AVX+F16C method to load some pixels, then chain that into an ordinary AVX
method to color filter them.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2138073002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review-Url: https://codereview.chromium.org/2138073002
Diffstat (limited to 'src/core/SkHalf.h')
-rw-r--r-- | src/core/SkHalf.h | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/core/SkHalf.h b/src/core/SkHalf.h index 82d4fb414c..5f5575ae1a 100644 --- a/src/core/SkHalf.h +++ b/src/core/SkHalf.h @@ -8,7 +8,6 @@ #ifndef SkHalf_DEFINED #define SkHalf_DEFINED -#include "SkCpu.h" #include "SkNx.h" #include "SkTypes.h" @@ -123,32 +122,3 @@ static inline uint64_t SkFloatToHalf_01(const Sk4f& fs) { } #endif - -static inline Sk4f SkHalfToFloat_01(const uint64_t* hs) { -#if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 - if (SkCpu::Supports(SkCpu::F16C)) { - __m128 fs; - #if defined(__GNUC__) || defined(__clang__) - asm("vcvtph2ps %[hs], %[fs]" : [fs]"=x"(fs) : [hs]"m"(*hs)); - #else - fs = _mm_cvtph_ps(_mm_loadl_epi64((const __m128i*)hs)); - #endif - return fs; - } -#endif - return SkHalfToFloat_01(*hs); -} - -static inline void SkFloatToHalf_01(const Sk4f& fs, uint64_t* hs) { -#if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 - if (SkCpu::Supports(SkCpu::F16C)) { - #if defined(__GNUC__) || defined(__clang__) - asm("vcvtps2ph $0, %[fs], %[hs]" : [hs]"=m"(*hs) : [fs]"x"(fs.fVec)); - #else - _mm_storel_epi64((__m128i*)hs, _mm_cvtps_ph(fs.fVec, 0)); - #endif - return; - } -#endif - *hs = SkFloatToHalf_01(fs); -} |