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 #ifndef Sk2x_DEFINED | 8 #ifndef Sk2x_DEFINED |
9 #define Sk2x_DEFINED | 9 #define Sk2x_DEFINED |
10 | 10 |
11 #include "SkTypes.h" | 11 #include "SkTypes.h" |
12 #include "SkNx.h" | 12 #include "SkNx.h" |
13 | 13 |
14 #define SK2X_PREAMBLE 1 | 14 #define SK2X_PREAMBLE 1 |
15 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) | 15 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) |
16 #include "../opts/Sk2x_sse.h" | 16 #include "../opts/Sk2x_sse.h" |
17 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD) | 17 #elif defined(__ARM_NEON__) && !defined(SKNX_NO_SIMD) |
18 #include "../opts/Sk2x_neon.h" | 18 #include "../opts/Sk2x_neon.h" |
19 #else | 19 #else |
20 #include "../opts/Sk2x_none.h" | 20 #include "../opts/Sk2x_none.h" |
21 #endif | 21 #endif |
22 #undef SK2X_PREAMBLE | 22 #undef SK2X_PREAMBLE |
23 | 23 |
24 template <typename T> class Sk2x; | 24 template <typename T> class Sk2x; |
25 typedef Sk2x<float> Sk2f; | 25 typedef Sk2x<float> Sk2f; |
26 typedef Sk2x<double> Sk2d; | 26 typedef Sk2x<double> Sk2d; |
27 | 27 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 Sk2x rsqrt() const; // Approximate 1/this->sqrt(). | 61 Sk2x rsqrt() const; // Approximate 1/this->sqrt(). |
62 Sk2x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but le
ss precise. | 62 Sk2x sqrt() const; // this->multiply(this->rsqrt()) may be faster, but le
ss precise. |
63 | 63 |
64 static Sk2x Min(const Sk2x&, const Sk2x&); | 64 static Sk2x Min(const Sk2x&, const Sk2x&); |
65 static Sk2x Max(const Sk2x&, const Sk2x&); | 65 static Sk2x Max(const Sk2x&, const Sk2x&); |
66 | 66 |
67 private: | 67 private: |
68 #define SK2X_PRIVATE 1 | 68 #define SK2X_PRIVATE 1 |
69 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) | 69 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) |
70 #include "../opts/Sk2x_sse.h" | 70 #include "../opts/Sk2x_sse.h" |
71 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD) | 71 #elif defined(__ARM_NEON__) && !defined(SKNX_NO_SIMD) |
72 #include "../opts/Sk2x_neon.h" | 72 #include "../opts/Sk2x_neon.h" |
73 #else | 73 #else |
74 #include "../opts/Sk2x_none.h" | 74 #include "../opts/Sk2x_none.h" |
75 #endif | 75 #endif |
76 #undef SK2X_PRIVATE | 76 #undef SK2X_PRIVATE |
77 }; | 77 }; |
78 | 78 |
79 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) | 79 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 && !defined(SKNX_NO_SIMD) |
80 #include "../opts/Sk2x_sse.h" | 80 #include "../opts/Sk2x_sse.h" |
81 #elif defined(SK_ARM_HAS_NEON) && !defined(SKNX_NO_SIMD) | 81 #elif defined(__ARM_NEON__) && !defined(SKNX_NO_SIMD) |
82 #include "../opts/Sk2x_neon.h" | 82 #include "../opts/Sk2x_neon.h" |
83 #else | 83 #else |
84 #include "../opts/Sk2x_none.h" | 84 #include "../opts/Sk2x_none.h" |
85 #endif | 85 #endif |
86 | 86 |
87 #endif//Sk2x_DEFINED | 87 #endif//Sk2x_DEFINED |
OLD | NEW |