Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBenchmark.h" | 8 #include "SkBenchmark.h" |
| 9 #include "SkRandom.h" | 9 #include "SkRandom.h" |
| 10 #include "SkTemplates.h" | 10 #include "SkTemplates.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 __m128i a = _mm_loadu_si128(src128++); | 126 __m128i a = _mm_loadu_si128(src128++); |
| 127 __m128i b = _mm_loadu_si128(src128++); | 127 __m128i b = _mm_loadu_si128(src128++); |
| 128 __m128i c = _mm_loadu_si128(src128++); | 128 __m128i c = _mm_loadu_si128(src128++); |
| 129 __m128i d = _mm_loadu_si128(src128++); | 129 __m128i d = _mm_loadu_si128(src128++); |
| 130 | 130 |
| 131 _mm_storeu_si128(dst128++, a); | 131 _mm_storeu_si128(dst128++, a); |
| 132 _mm_storeu_si128(dst128++, b); | 132 _mm_storeu_si128(dst128++, b); |
| 133 _mm_storeu_si128(dst128++, c); | 133 _mm_storeu_si128(dst128++, c); |
| 134 _mm_storeu_si128(dst128++, d); | 134 _mm_storeu_si128(dst128++, d); |
| 135 | 135 |
| 136 dst += 16; | |
| 137 src += 16; | |
|
f(malita)
2014/05/22 16:46:34
Is the compiler smart enough to hoist these?
mtklein
2014/05/22 16:48:59
Probably. I was worried that _I_ wasn't smart eno
mtklein
2014/05/22 16:59:02
Done.
While I was looking at it, I realized that,
| |
| 136 count -= 16; | 138 count -= 16; |
| 137 } | 139 } |
| 138 | 140 |
| 139 dst = reinterpret_cast<uint32_t*>(dst128); | |
| 140 src = reinterpret_cast<const uint32_t*>(src128); | |
| 141 while (count --> 0) { | 141 while (count --> 0) { |
| 142 *dst++ = *src++; | 142 *dst++ = *src++; |
| 143 } | 143 } |
| 144 } | 144 } |
| 145 // skia:2589: Crashing on ChromeOS Alex bot. TODO(mtklein): why? | 145 BENCH(memcpy32_sse2_unalign, 10) |
| 146 //BENCH(memcpy32_sse2_unalign, 10) | |
| 147 BENCH(memcpy32_sse2_unalign, 100) | 146 BENCH(memcpy32_sse2_unalign, 100) |
| 148 BENCH(memcpy32_sse2_unalign, 1000) | 147 BENCH(memcpy32_sse2_unalign, 1000) |
| 149 BENCH(memcpy32_sse2_unalign, 10000) | 148 BENCH(memcpy32_sse2_unalign, 10000) |
| 150 BENCH(memcpy32_sse2_unalign, 100000) | 149 BENCH(memcpy32_sse2_unalign, 100000) |
| 151 | 150 |
| 152 #endif // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 151 #endif // SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
| 153 | 152 |
| 154 #undef BENCH | 153 #undef BENCH |
| OLD | NEW |