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

Unified Diff: bench/MemcpyBench.cpp

Issue 291893008: Fix memcpy32_sse2_unalign. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: hoist, for align too Created 6 years, 7 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: bench/MemcpyBench.cpp
diff --git a/bench/MemcpyBench.cpp b/bench/MemcpyBench.cpp
index 0bb7b617b46dbf10ee8fa8581f9192ceaa2cca64..aec2a4774d9efc45f85fc2c32b37425d561952f5 100644
--- a/bench/MemcpyBench.cpp
+++ b/bench/MemcpyBench.cpp
@@ -90,6 +90,8 @@ static void memcpy32_sse2_align(uint32_t* dst, const uint32_t* src, int count) {
__m128i* dst128 = reinterpret_cast<__m128i*>(dst);
const __m128i* src128 = reinterpret_cast<const __m128i*>(src);
+ dst += 16 * (count / 16);
+ src += 16 * (count / 16);
while (count >= 16) {
__m128i a = _mm_loadu_si128(src128++);
__m128i b = _mm_loadu_si128(src128++);
@@ -103,9 +105,6 @@ static void memcpy32_sse2_align(uint32_t* dst, const uint32_t* src, int count) {
count -= 16;
}
-
- dst = reinterpret_cast<uint32_t*>(dst128);
- src = reinterpret_cast<const uint32_t*>(src128);
}
while (count --> 0) {
@@ -122,6 +121,8 @@ BENCH(memcpy32_sse2_align, 100000)
static void memcpy32_sse2_unalign(uint32_t* dst, const uint32_t* src, int count) {
__m128i* dst128 = reinterpret_cast<__m128i*>(dst);
const __m128i* src128 = reinterpret_cast<const __m128i*>(src);
+ dst += 16 * (count / 16);
+ src += 16 * (count / 16);
while (count >= 16) {
__m128i a = _mm_loadu_si128(src128++);
__m128i b = _mm_loadu_si128(src128++);
@@ -136,14 +137,11 @@ static void memcpy32_sse2_unalign(uint32_t* dst, const uint32_t* src, int count)
count -= 16;
}
- dst = reinterpret_cast<uint32_t*>(dst128);
- src = reinterpret_cast<const uint32_t*>(src128);
while (count --> 0) {
*dst++ = *src++;
}
}
-// skia:2589: Crashing on ChromeOS Alex bot. TODO(mtklein): why?
-//BENCH(memcpy32_sse2_unalign, 10)
+BENCH(memcpy32_sse2_unalign, 10)
BENCH(memcpy32_sse2_unalign, 100)
BENCH(memcpy32_sse2_unalign, 1000)
BENCH(memcpy32_sse2_unalign, 10000)
« 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