summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp')
-rw-r--r--chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp b/chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp
index e22044d39d3..bd2f9b29a44 100644
--- a/chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp
+++ b/chromium/third_party/skia/src/opts/SkUtils_opts_SSE2.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2009 The Android Open Source Project
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#include <emmintrin.h>
#include "SkUtils_opts_SSE2.h"
@@ -69,3 +67,33 @@ void sk_memset32_SSE2(uint32_t *dst, uint32_t value, int count)
--count;
}
}
+
+void sk_memcpy32_SSE2(uint32_t *dst, const uint32_t *src, int count)
+{
+ if (count >= 16) {
+ while (((size_t)dst) & 0x0F) {
+ *dst++ = *src++;
+ --count;
+ }
+ __m128i *dst128 = reinterpret_cast<__m128i*>(dst);
+ const __m128i *src128 = reinterpret_cast<const __m128i*>(src);
+ while (count >= 16) {
+ __m128i a = _mm_loadu_si128(src128++);
+ __m128i b = _mm_loadu_si128(src128++);
+ __m128i c = _mm_loadu_si128(src128++);
+ __m128i d = _mm_loadu_si128(src128++);
+
+ _mm_store_si128(dst128++, a);
+ _mm_store_si128(dst128++, b);
+ _mm_store_si128(dst128++, c);
+ _mm_store_si128(dst128++, d);
+ count -= 16;
+ }
+ dst = reinterpret_cast<uint32_t*>(dst128);
+ src = reinterpret_cast<const uint32_t*>(src128);
+ }
+ while (count > 0) {
+ *dst++ = *src++;
+ --count;
+ }
+}