diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-12 15:38:00 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-12 15:38:00 +0000 |
commit | f31fa24914c683abcc2c860093b142725c43fbe6 (patch) | |
tree | 1a50aa9fc85a19fff6f0ed83f2ebfcb7706cb2e4 /src/opts | |
parent | 205ce48c38c55ec7527d26042b5cea689369be8b (diff) |
Make gMask_00FF00FF a constant
This is to optimize SkAlphaMulQ() in PIC mode. With the visibility=default
symbol the constant is not known at compile time (and is not a constant), but
instead is fetched through a double indirection through GOT. The function is
quite hot on one of the chromium benchmarks:
rasterize_and_record_micro.key_silk_cases.
This change replaces the symbol with a compile-time constant. As a bonus the
variable is not exported from the dynamic library, i. e. a cleaner library
interface.
See specific performance improvements on Android here:
http://goo.gl/iMuTDt
R=skyostil@chromium.org, tomhudson@chromium.org, mtklein@google.com, reed@google.com, tomhudson@google.com
Author: pasko@chromium.org
Review URL: https://codereview.chromium.org/270473003
git-svn-id: http://skia.googlecode.com/svn/trunk@14696 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/opts')
-rw-r--r-- | src/opts/SkColor_opts_SSE2.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opts/SkColor_opts_SSE2.h b/src/opts/SkColor_opts_SSE2.h index b06fe1a76f..7e61d526b3 100644 --- a/src/opts/SkColor_opts_SSE2.h +++ b/src/opts/SkColor_opts_SSE2.h @@ -42,7 +42,7 @@ static inline __m128i SkAlphaMulAlpha_SSE2(const __m128i& a, // Portable version SkAlphaMulQ is in SkColorPriv.h. static inline __m128i SkAlphaMulQ_SSE2(const __m128i& c, const __m128i& scale) { - __m128i mask = _mm_set1_epi32(gMask_00FF00FF); + __m128i mask = _mm_set1_epi32(0xFF00FF); __m128i s = _mm_or_si128(_mm_slli_epi32(scale, 16), scale); // uint32_t rb = ((c & mask) * scale) >> 8 |