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

Unified Diff: src/opts/SkOpts_neon.cpp

Issue 1264423002: Reorganize to keep similar code together. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 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 | « src/opts/SkFloatingPoint_opts.h ('k') | src/opts/SkOpts_sse2.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkOpts_neon.cpp
diff --git a/src/opts/SkOpts_neon.cpp b/src/opts/SkOpts_neon.cpp
index aa718272e15957f8e2243aab0a2f42b8d5ef4df2..2db976d5c9bbeda1b1b5f60149647c660927ba32 100644
--- a/src/opts/SkOpts_neon.cpp
+++ b/src/opts/SkOpts_neon.cpp
@@ -5,68 +5,14 @@
* found in the LICENSE file.
*/
-#include "SkFloatingPoint.h"
#include "SkOpts.h"
+
#define SK_OPTS_NS neon
#include "SkBlurImageFilter_opts.h"
+#include "SkFloatingPoint_opts.h"
+#include "SkUtils_opts.h"
#include "SkXfermode_opts.h"
-namespace neon { // This helps identify methods from this file when debugging / profiling.
-
-static float rsqrt(float x) {
- return sk_float_rsqrt(x); // This sk_float_rsqrt copy will take the NEON compile-time path.
-}
-
-static void memset16(uint16_t* dst, uint16_t value, int n) {
- uint16x8_t v8 = vdupq_n_u16(value);
- uint16x8x4_t v32 = {{ v8, v8, v8, v8 }};
-
- while (n >= 32) {
- vst4q_u16(dst, v32); // This swizzles, but we don't care: all lanes are the same, value.
- dst += 32;
- n -= 32;
- }
- switch (n / 8) {
- case 3: vst1q_u16(dst, v8); dst += 8;
- case 2: vst1q_u16(dst, v8); dst += 8;
- case 1: vst1q_u16(dst, v8); dst += 8;
- }
- if (n & 4) {
- vst1_u16(dst, vget_low_u16(v8));
- dst += 4;
- }
- switch (n & 3) {
- case 3: *dst++ = value;
- case 2: *dst++ = value;
- case 1: *dst = value;
- }
-}
-
-static void memset32(uint32_t* dst, uint32_t value, int n) {
- uint32x4_t v4 = vdupq_n_u32(value);
- uint32x4x4_t v16 = {{ v4, v4, v4, v4 }};
-
- while (n >= 16) {
- vst4q_u32(dst, v16); // This swizzles, but we don't care: all lanes are the same, value.
- dst += 16;
- n -= 16;
- }
- switch (n / 4) {
- case 3: vst1q_u32(dst, v4); dst += 4;
- case 2: vst1q_u32(dst, v4); dst += 4;
- case 1: vst1q_u32(dst, v4); dst += 4;
- }
- if (n & 2) {
- vst1_u32(dst, vget_low_u32(v4));
- dst += 2;
- }
- if (n & 1) {
- *dst = value;
- }
-}
-
-} // namespace neon
-
namespace SkOpts {
void Init_neon() {
rsqrt = neon::rsqrt;
« no previous file with comments | « src/opts/SkFloatingPoint_opts.h ('k') | src/opts/SkOpts_sse2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698