| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "SkFloatingPoint.h" |
| 8 #include "SkOpts.h" | 9 #include "SkOpts.h" |
| 9 #include "SkFloatingPoint.h" | 10 #include "SkXfermode_opts.h" |
| 10 | 11 |
| 11 namespace neon { // This helps identify methods from this file when debugging /
profiling. | 12 namespace neon { // This helps identify methods from this file when debugging /
profiling. |
| 12 | 13 |
| 13 static float rsqrt(float x) { | 14 static float rsqrt(float x) { |
| 14 return sk_float_rsqrt(x); // This sk_float_rsqrt copy will take the NEON co
mpile-time path. | 15 return sk_float_rsqrt(x); // This sk_float_rsqrt copy will take the NEON co
mpile-time path. |
| 15 } | 16 } |
| 16 | 17 |
| 17 static void memset16(uint16_t* dst, uint16_t value, int n) { | 18 static void memset16(uint16_t* dst, uint16_t value, int n) { |
| 18 uint16x8_t v8 = vdupq_n_u16(value); | 19 uint16x8_t v8 = vdupq_n_u16(value); |
| 19 uint16x8x4_t v32 = {{ v8, v8, v8, v8 }}; | 20 uint16x8x4_t v32 = {{ v8, v8, v8, v8 }}; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 60 } |
| 60 if (n & 1) { | 61 if (n & 1) { |
| 61 *dst = value; | 62 *dst = value; |
| 62 } | 63 } |
| 63 } | 64 } |
| 64 | 65 |
| 65 } // namespace neon | 66 } // namespace neon |
| 66 | 67 |
| 67 namespace SkOpts { | 68 namespace SkOpts { |
| 68 void Init_neon() { | 69 void Init_neon() { |
| 69 rsqrt = neon::rsqrt; | 70 rsqrt = neon::rsqrt; |
| 70 memset16 = neon::memset16; | 71 memset16 = neon::memset16; |
| 71 memset32 = neon::memset32; | 72 memset32 = neon::memset32; |
| 73 create_xfermode = SkCreate4pxXfermode; |
| 72 } | 74 } |
| 73 } | 75 } |
| OLD | NEW |