diff options
author | mtklein <mtklein@chromium.org> | 2015-11-11 11:39:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-11 11:39:09 -0800 |
commit | 084db25d47dbad3ffbd7d15c04b63d344b351f90 (patch) | |
tree | 1152701d1608211322670f1246c7228978d8e32e /src/opts/SkNx_sse.h | |
parent | 9be5ff6f9871ef22740094e7c25dd67329a73d20 (diff) |
float xfermodes (burn, dodge, softlight) in Sk8f, possibly using AVX.
Xfermode_ColorDodge_aa 10.3ms -> 7.85ms 0.76x
Xfermode_SoftLight_aa 13.8ms -> 10.2ms 0.74x
Xfermode_ColorBurn_aa 10.7ms -> 7.82ms 0.73x
Xfermode_SoftLight 33.6ms -> 23.2ms 0.69x
Xfermode_ColorDodge 25ms -> 16.5ms 0.66x
Xfermode_ColorBurn 26.1ms -> 16.6ms 0.63x
Ought to be no pixel diffs:
https://gold.skia.org/search2?issue=1432903002&unt=true&query=source_type%3Dgm&master=false
Incidental stuff:
I made the SkNx(T) constructors implicit to make writing math expressions simpler.
This allows us to write expressions like
Sk4f v;
...
v = v*4;
rather than
Sk4f v;
...
v = v * Sk4f(4);
As written it only works when the constant is on the right-hand side,
so expressions like `(Sk4f(1) - da)` have to stay for now. I plan on
following up with a CL that lets those become `(1 - da)` too.
BUG=skia:4117
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review URL: https://codereview.chromium.org/1432903002
Diffstat (limited to 'src/opts/SkNx_sse.h')
-rw-r--r-- | src/opts/SkNx_sse.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h index 6e9c59c5cb..32e94a6d66 100644 --- a/src/opts/SkNx_sse.h +++ b/src/opts/SkNx_sse.h @@ -19,7 +19,7 @@ public: SkNf(const __m128& vec) : fVec(vec) {} SkNf() {} - explicit SkNf(float val) : fVec(_mm_set1_ps(val)) {} + SkNf(float val) : fVec(_mm_set1_ps(val)) {} static SkNf Load(const float vals[2]) { return _mm_castsi128_ps(_mm_loadl_epi64((const __m128i*)vals)); } @@ -68,7 +68,7 @@ public: SkNi(const __m128i& vec) : fVec(vec) {} SkNi() {} - explicit SkNi(int val) : fVec(_mm_set1_epi32(val)) {} + SkNi(int val) : fVec(_mm_set1_epi32(val)) {} static SkNi Load(const int vals[4]) { return _mm_loadu_si128((const __m128i*)vals); } SkNi(int a, int b, int c, int d) : fVec(_mm_setr_epi32(a,b,c,d)) {} @@ -106,7 +106,7 @@ public: SkNf(const __m128& vec) : fVec(vec) {} SkNf() {} - explicit SkNf(float val) : fVec( _mm_set1_ps(val) ) {} + SkNf(float val) : fVec( _mm_set1_ps(val) ) {} static SkNf Load(const float vals[4]) { return _mm_loadu_ps(vals); } static SkNf FromBytes(const uint8_t bytes[4]) { @@ -178,7 +178,7 @@ public: SkNi(const __m128i& vec) : fVec(vec) {} SkNi() {} - explicit SkNi(uint16_t val) : fVec(_mm_set1_epi16(val)) {} + SkNi(uint16_t val) : fVec(_mm_set1_epi16(val)) {} static SkNi Load(const uint16_t vals[4]) { return _mm_loadl_epi64((const __m128i*)vals); } SkNi(uint16_t a, uint16_t b, uint16_t c, uint16_t d) : fVec(_mm_setr_epi16(a,b,c,d,0,0,0,0)) {} @@ -205,7 +205,7 @@ public: SkNi(const __m128i& vec) : fVec(vec) {} SkNi() {} - explicit SkNi(uint16_t val) : fVec(_mm_set1_epi16(val)) {} + SkNi(uint16_t val) : fVec(_mm_set1_epi16(val)) {} static SkNi Load(const uint16_t vals[8]) { return _mm_loadu_si128((const __m128i*)vals); } SkNi(uint16_t a, uint16_t b, uint16_t c, uint16_t d, uint16_t e, uint16_t f, uint16_t g, uint16_t h) : fVec(_mm_setr_epi16(a,b,c,d,e,f,g,h)) {} @@ -247,7 +247,7 @@ public: SkNi(const __m128i& vec) : fVec(vec) {} SkNi() {} - explicit SkNi(uint8_t val) : fVec(_mm_set1_epi8(val)) {} + SkNi(uint8_t val) : fVec(_mm_set1_epi8(val)) {} static SkNi Load(const uint8_t vals[16]) { return _mm_loadu_si128((const __m128i*)vals); } SkNi(uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t h, |