OLD | NEW |
1 #ifndef Sk4x_DEFINED | 1 #ifndef Sk4x_DEFINED |
2 #define Sk4x_DEFINED | 2 #define Sk4x_DEFINED |
3 | 3 |
4 #include "SkTypes.h" | 4 #include "SkTypes.h" |
5 | 5 |
6 #define SK4X_PREAMBLE 1 | 6 #define SK4X_PREAMBLE 1 |
7 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 7 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
8 #include "Sk4x_sse.h" | 8 #include "Sk4x_sse.h" |
9 #else | 9 #else |
10 #include "Sk4x_portable.h" | 10 #include "Sk4x_portable.h" |
11 #endif | 11 #endif |
12 #undef SK4X_PREAMBLE | 12 #undef SK4X_PREAMBLE |
13 | 13 |
14 template <typename T> class Sk4x; | 14 template <typename T> class Sk4x; |
15 typedef Sk4x<float> Sk4f; | 15 typedef Sk4x<float> Sk4f; |
16 typedef Sk4x<int32_t> Sk4i; | 16 typedef Sk4x<int32_t> Sk4i; |
17 | 17 |
18 // Some Sk4x methods are implemented only for Sk4f or Sk4i. | 18 // Some Sk4x methods are implemented only for Sk4f or Sk4i. |
19 // They might be unavailable, really slow, or just a bad idea. | 19 // They might be unavailable, really slow, or just a bad idea. |
20 // Talk to mtklein if you find yourself unable to link and | 20 // Talk to mtklein if you find yourself unable to link and |
21 // really need one of those methods. | 21 // really need one of those methods. |
22 | 22 |
23 template <typename T> class Sk4x { | 23 template <typename T> class Sk4x { |
24 public: | 24 public: |
25 Sk4x(); // Uninitialized; use Sk4x(0,0,0,0) for zero. | 25 Sk4x(); // Uninitialized; use Sk4x(0) for zero. |
| 26 /*implicit*/ Sk4x(T); // Same as Sk4x(T,T,T,T); |
26 Sk4x(T, T, T, T); | 27 Sk4x(T, T, T, T); |
27 | 28 |
28 Sk4x(const Sk4x&); | 29 Sk4x(const Sk4x&); |
29 Sk4x& operator=(const Sk4x&); | 30 Sk4x& operator=(const Sk4x&); |
30 | 31 |
31 static Sk4x Load (const T[4]); | 32 static Sk4x Load (const T[4]); |
32 static Sk4x LoadAligned(const T[4]); | 33 static Sk4x LoadAligned(const T[4]); |
33 | 34 |
34 void store (T[4]) const; | 35 void store (T[4]) const; |
35 void storeAligned(T[4]) const; | 36 void storeAligned(T[4]) const; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #undef SK4X_PRIVATE | 84 #undef SK4X_PRIVATE |
84 }; | 85 }; |
85 | 86 |
86 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 87 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
87 #include "Sk4x_sse.h" | 88 #include "Sk4x_sse.h" |
88 #else | 89 #else |
89 #include "Sk4x_portable.h" | 90 #include "Sk4x_portable.h" |
90 #endif | 91 #endif |
91 | 92 |
92 #endif//Sk4x_DEFINED | 93 #endif//Sk4x_DEFINED |
OLD | NEW |