Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1154)

Unified Diff: src/opts/SkUtils_opts_SSE2.cpp

Issue 21703003: Minor sk_memset{16|32}_SSE2 optimization. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkUtils_opts_SSE2.cpp
diff --git a/src/opts/SkUtils_opts_SSE2.cpp b/src/opts/SkUtils_opts_SSE2.cpp
index 08e4f669483b0a6c66931cdd916c781d45bec7a9..e22044d39d36821726cb95ff3e1605e8976ec29c 100644
--- a/src/opts/SkUtils_opts_SSE2.cpp
+++ b/src/opts/SkUtils_opts_SSE2.cpp
@@ -25,10 +25,11 @@ void sk_memset16_SSE2(uint16_t *dst, uint16_t value, int count)
__m128i *d = reinterpret_cast<__m128i*>(dst);
__m128i value_wide = _mm_set1_epi16(value);
while (count >= 32) {
- _mm_store_si128(d++, value_wide);
- _mm_store_si128(d++, value_wide);
- _mm_store_si128(d++, value_wide);
- _mm_store_si128(d++, value_wide);
+ _mm_store_si128(d , value_wide);
+ _mm_store_si128(d + 1, value_wide);
+ _mm_store_si128(d + 2, value_wide);
+ _mm_store_si128(d + 3, value_wide);
+ d += 4;
count -= 32;
}
dst = reinterpret_cast<uint16_t*>(d);
@@ -54,10 +55,11 @@ void sk_memset32_SSE2(uint32_t *dst, uint32_t value, int count)
__m128i *d = reinterpret_cast<__m128i*>(dst);
__m128i value_wide = _mm_set1_epi32(value);
while (count >= 16) {
- _mm_store_si128(d++, value_wide);
- _mm_store_si128(d++, value_wide);
- _mm_store_si128(d++, value_wide);
- _mm_store_si128(d++, value_wide);
+ _mm_store_si128(d , value_wide);
+ _mm_store_si128(d + 1, value_wide);
+ _mm_store_si128(d + 2, value_wide);
+ _mm_store_si128(d + 3, value_wide);
+ d += 4;
count -= 16;
}
dst = reinterpret_cast<uint32_t*>(d);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698